diff options
author | Roman Mohr <rmohr@redhat.com> | 2020-01-06 23:15:43 +0100 |
---|---|---|
committer | Jay Conrod <jayconrod@google.com> | 2020-01-06 17:15:43 -0500 |
commit | e8df8b92975a87f72097a47066e40751bb7d965d (patch) | |
tree | 5d8bfae66dfd1c1b9cd688169bdbd53980e6ae82 /tests/core/go_test/BUILD.bazel | |
parent | 6a10fd6d11240834f8af685d838a0c78e782bd48 (diff) | |
download | bazelbuild-rules_go-e8df8b92975a87f72097a47066e40751bb7d965d.tar.gz |
Import all pkg which tests depend on (#2331)
All imports which gazelle identified as test dependencies should be
imported in the test main package.
This way "hidden" global registrations are properly added to the binary.
One use-case is Ginkgo. It has its own wrappers for tests and rules_go
would miss them in some cases, which would lead to tests which are not
added to the binary.
Signed-off-by: Roman Mohr <rmohr@redhat.com>
Diffstat (limited to 'tests/core/go_test/BUILD.bazel')
-rw-r--r-- | tests/core/go_test/BUILD.bazel | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/tests/core/go_test/BUILD.bazel b/tests/core/go_test/BUILD.bazel index a56800a1..6ff2f138 100644 --- a/tests/core/go_test/BUILD.bazel +++ b/tests/core/go_test/BUILD.bazel @@ -143,3 +143,12 @@ go_bazel_test( name = "test_filter_test", srcs = ["test_filter_test.go"], ) + +go_test( + name = "testmain_import_test", + srcs = [ + "testmain_import_indirect_test.go", + "testmain_import_main_test.go", + ], + importpath = "example.com/imports/test_main", +) |