Basic go_proto_library functionality
====================================

.. _go_proto_library: /proto/core.rst#_go_proto_library
.. _go_library: /docs/go/core/rules.md#_go_library
.. _protobuf v1.26.0: https://github.com/protocolbuffers/protobuf-go/releases/tag/v1.26.0
.. _#1422: https://github.com/bazelbuild/rules_go/issues/1422
.. _#1596: https://github.com/bazelbuild/rules_go/issues/1596

Tests to ensure the basic features of `go_proto_library`_ are working.

.. contents::

embed_test
----------

Checks that `go_proto_library`_ can embed rules that provide `GoLibrary`_.

transitive_test
---------------

Checks that `go_proto_library`_ can import a proto dependency that is
embedded in a `go_library`_. Verifies `#1422`_.

adjusted_import_test
--------------------

Checks that `go_proto_library`_ can build ``proto_library`` with
``import_prefix`` and ``strip_import_prefix``.

gofast_test and gofast_grpc_test
--------------------------------

Checks that the gogo `gofast` compiler plugins build and link.  In
particular, these plugins only depoend on `github.com/golang/protobuf`.

gogofast_test and gogofast_grpc_test
------------------------------------

Checks that the `gogofast` compiler plugins build and link.  In
particular, these plugins depend on both `github.com/gogo/protobuf`
and `github.com/golang/protobuf`.

proto_package_test
------------------

Checks that `go_proto_library`_ generates files with a package name based on
``importpath``, not the proto package, when ``option go_package`` is not given.
This changed in `protobuf v1.26.0`_: the import path must either be specified
with an ``option go_package`` in each proto file or with an ``M`` flag passed
in from ``go_proto_library``. Previously, the Go package name was derived from
the proto package name. Previously verified `#1596`_.

wkt_wrapper_test
----------------

Checks that most of the well known types in ``//proto/wkt`` are wrappers
for packages in ``@org_golang_google_protobuf``. The proto types should be
type aliases.

protos_alias_test
-----------------

Checks that packages generated by `go_proto_library` can be imported using one of the strings
listed in ``importpath_aliases``.
