Add wrapper to find the test binary

This commit is contained in:
Thomas Pelletier
2013-12-10 15:00:31 +01:00
parent bbe45c63f2
commit c163b3f68b
+15 -1
View File
@@ -3,4 +3,18 @@
go get github.com/BurntSushi/toml-test # install test suite
go get github.com/BurntSushi/toml/toml-test-go # install my parser
go build -o test_program_bin github.com/pelletier/go-toml/test_program
$GOPATH/bin/toml-test ./test_program_bin # run tests on my parser
toml_test_wrapper() {
if hash toml-test 2>/dev/null; then # test availability in $PATH
toml-test "$@"
else
p="$HOME/gopath/bin/toml-test" # try in Travi's place
if [ -f "$p" ]; then
"$p" "$@"
else
"$GOPATH/bin/toml-test" "$@"
fi
fi
}
toml_test_wrapper ./test_program_bin # run tests on my parser