xref: /aosp_15_r20/external/bazelbuild-rules_go/tests/core/go_proto_library/README.rst (revision 9bb1b549b6a84214c53be0924760be030e66b93a)
1Basic go_proto_library functionality
2====================================
3
4.. _go_proto_library: /proto/core.rst#_go_proto_library
5.. _go_library: /docs/go/core/rules.md#_go_library
6.. _protobuf v1.26.0: https://github.com/protocolbuffers/protobuf-go/releases/tag/v1.26.0
7.. _#1422: https://github.com/bazelbuild/rules_go/issues/1422
8.. _#1596: https://github.com/bazelbuild/rules_go/issues/1596
9
10Tests to ensure the basic features of `go_proto_library`_ are working.
11
12.. contents::
13
14embed_test
15----------
16
17Checks that `go_proto_library`_ can embed rules that provide `GoLibrary`_.
18
19transitive_test
20---------------
21
22Checks that `go_proto_library`_ can import a proto dependency that is
23embedded in a `go_library`_. Verifies `#1422`_.
24
25adjusted_import_test
26--------------------
27
28Checks that `go_proto_library`_ can build ``proto_library`` with
29``import_prefix`` and ``strip_import_prefix``.
30
31gofast_test and gofast_grpc_test
32--------------------------------
33
34Checks that the gogo `gofast` compiler plugins build and link.  In
35particular, these plugins only depoend on `github.com/golang/protobuf`.
36
37gogofast_test and gogofast_grpc_test
38------------------------------------
39
40Checks that the `gogofast` compiler plugins build and link.  In
41particular, these plugins depend on both `github.com/gogo/protobuf`
42and `github.com/golang/protobuf`.
43
44proto_package_test
45------------------
46
47Checks that `go_proto_library`_ generates files with a package name based on
48``importpath``, not the proto package, when ``option go_package`` is not given.
49This changed in `protobuf v1.26.0`_: the import path must either be specified
50with an ``option go_package`` in each proto file or with an ``M`` flag passed
51in from ``go_proto_library``. Previously, the Go package name was derived from
52the proto package name. Previously verified `#1596`_.
53
54wkt_wrapper_test
55----------------
56
57Checks that most of the well known types in ``//proto/wkt`` are wrappers
58for packages in ``@org_golang_google_protobuf``. The proto types should be
59type aliases.
60
61protos_alias_test
62-----------------
63
64Checks that packages generated by `go_proto_library` can be imported using one of the strings
65listed in ``importpath_aliases``.
66