Skip to content

Commit

Permalink
Add a test
Browse files Browse the repository at this point in the history
  • Loading branch information
peterebden committed Sep 9, 2024
1 parent 5ea1910 commit 68797c1
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 19 deletions.
9 changes: 9 additions & 0 deletions src/BUILD.plz
Original file line number Diff line number Diff line change
Expand Up @@ -48,3 +48,12 @@ filegroup(
binary = True,
visibility = ["//:install"],
)

# On Linux, we should produce statically linked binaries. Emit a test to verify this is the case.
if is_platform(os = "linux"):
gentest(
name = "static_test",
test_cmd = "file $DATA | grep 'statically linked'",
data = [":please"],
no_test_output = True,
)
19 changes: 0 additions & 19 deletions test/stamp/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -14,22 +14,3 @@ sh_test(
src = "stamp_test.sh",
data = [":stamp"],
)

if is_platform(os = "linux"):
go_binary(
name = "stamp_static",
srcs = ["main.go"],
definitions = {
"github.com/thought-machine/please/test/stamp/lib.GitRevision": "$SCM_REVISION",
"github.com/thought-machine/please/test/stamp/lib.GitDescribe": "$SCM_DESCRIBE",
},
stamp = True,
static = True,
deps = ["//test/stamp/lib"],
)

sh_test(
name = "stamp_test_static",
src = "stamp_test.sh",
data = [":stamp_static"],
)

0 comments on commit 68797c1

Please sign in to comment.