github.com/0xKiwi/rules_go@v0.24.3/tests/core/go_binary/README.rst (about) 1 Basic go_binary functionality 2 ============================= 3 4 .. _go_binary: /go/core.rst#_go_binary 5 .. _#2168: https://github.com/bazelbuild/rules_go/issues/2168 6 .. _#2463: https://github.com/bazelbuild/rules_go/issues/2463 7 8 Tests to ensure the basic features of go_binary are working as expected. 9 10 hello 11 ----- 12 13 Hello is a basic "hello world" program that doesn't do anything interesting. 14 Useful as a primitive smoke test -- if this doesn't build, nothing will. 15 16 out_test 17 -------- 18 19 Tests that a `go_binary`_ rule can write its executable file with a custom name 20 in the package directory (not the mode directory). 21 22 package_conflict_test 23 --------------------- 24 25 Tests that linking multiple packages with the same path (`importmap`) is an 26 error. 27 28 goos_pure_bin 29 ------------- 30 31 Tests that specifying the `goos` attribute on a `go_binary`_ target to be 32 different than the host os forces the pure mode to be on. This is achieved 33 by including a broken cgo file in the sources for the build. 34 35 many_deps 36 --------- 37 38 Test that a `go_binary`_ with many imports with long names can be linked. This 39 makes sure we don't exceed command-line length limits with -I and -L flags. 40 Verifies #1637. 41 42 stamp_test 43 ---------- 44 Test that the `go_binary`_ ``x_defs`` attribute works correctly, both in a 45 binary and in an embedded library. Tests regular stamps and stamps that 46 depend on values from the workspace status script. Verifies #2000. 47 48 pie_test 49 -------- 50 Tests that specifying the ``linkmode`` attribute on a `go_binary`_ target to be 51 pie produces a position-independent executable and that no specifying it produces 52 a position-dependent binary. 53 54 static_test 55 ----------- 56 Test that `go_binary`_ rules with ``static = "on"`` with and without cgo 57 produce static binaries. Verifies `#2168`_. 58 59 This test only runs on Linux. The darwin external linker cannot produce 60 static binaries since there is no static version of C runtime libraries. 61 62 tags_bin 63 -------- 64 Checks that setting ``gotags`` affects source filtering. This binary won't build 65 without a specific tag being set. 66 67 prefix 68 ------ 69 This binary has a name that conflicts with a subdirectory. Its output file 70 name should not have this conflict. Verifies `#2463`_.