-
-
Notifications
You must be signed in to change notification settings - Fork 36
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
tests: Combine cross-compile lifecycle BATS tests into one test
- Loading branch information
Drew Robinson
committed
Jul 27, 2022
1 parent
83481eb
commit 60c87a0
Showing
1 changed file
with
15 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,31 @@ | ||
#!/usr/bin/env bats | ||
|
||
load './test_helpers/bats-support/load' | ||
load './test_helpers/bats-assert/load' | ||
load 'test_helpers/bats-support/load' | ||
load 'test_helpers/bats-assert/load' | ||
|
||
@test "clean out any cross compiled binaries" { | ||
@test "test cross compilation command lifecycle" { | ||
run make clean | ||
assert_success | ||
assert_output --partial 'rm -vRf ./builds/ahoy-bin-*' | ||
} | ||
|
||
@test "cross compile binaries with make" { | ||
run ls ./builds/ahoy-* | ||
assert_failure | ||
assert_output --partial 'No such file' | ||
|
||
run make cross | ||
assert_success | ||
assert_output --partial 'mv ./builds/ahoy-bin-windows-amd64 ./builds/ahoy-bin-windows-amd64.exe; mv ./builds/ahoy-bin-windows-arm64 ./builds/ahoy-bin-windows-arm64.exe;' | ||
} | ||
|
||
@test "check cross compiled binaries exist" { | ||
run ls ./builds/ahoy-* | ||
assert_output --partial 'ahoy-bin-darwin-amd64' | ||
assert_output --partial 'ahoy-bin-linux-arm64' | ||
assert_output --partial 'ahoy-bin-windows-amd64.exe' | ||
|
||
run make clean | ||
assert_success | ||
assert_output --partial 'rm -vRf ./builds/ahoy-bin-*' | ||
|
||
run ls ./builds/ahoy-* | ||
assert_failure | ||
assert_output --partial 'No such file' | ||
} |