You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
garble/testdata/scripts/seed.txt

43 lines
1.1 KiB
Plaintext

# Check the binary with a given base64 encoded seed
garble -literals -seed=OQg9kACEECQ= build main.go
exec ./main$exe
cmp stderr main.stdout
! binsubstr main$exe 'teststring' 'teststringVar'
[short] stop # checking that the build is reproducible and random is slow
# Also check that the binary is reproducible.
cp main$exe main_old$exe
rm main$exe
garble -literals -seed=OQg9kACEECQ= build main.go
bincmp main$exe main_old$exe
# Also check that a different seed leads to a different binary
cp main$exe main_old$exe
rm main$exe
garble -literals -seed=NruiDmVz6/s= build main.go
! bincmp main$exe main_old$exe
# Check the random binary
garble -literals -seed=random build main.go
exec ./main$exe
cmp stderr main.stdout
! binsubstr main$exe 'teststring' 'teststringVar'
# Also check that the random binary is not reproducible.
cp main$exe main_old$exe
rm main$exe
garble -literals -seed=random build main.go
! bincmp main$exe main_old$exe
-- main.go --
package main
var teststringVar = "teststring"
func main() {
println(teststringVar)
}
-- main.stdout --
teststring