summaryrefslogtreecommitdiff
path: root/doc/articles/wiki/test.bash
diff options
context:
space:
mode:
authorMichael Stapelberg <stapelberg@debian.org>2013-12-03 09:43:15 +0100
committerMichael Stapelberg <stapelberg@debian.org>2013-12-03 09:43:15 +0100
commit64d2a7c8945ba05af859901f5e248f1befdd8621 (patch)
tree013fcb7e9e3296ecdda876012252c36bd6bcb063 /doc/articles/wiki/test.bash
parentb901efe83e212f0c34c769c079e41373da12d723 (diff)
downloadgolang-64d2a7c8945ba05af859901f5e248f1befdd8621.tar.gz
Imported Upstream version 1.2upstream/1.2
Diffstat (limited to 'doc/articles/wiki/test.bash')
-rwxr-xr-xdoc/articles/wiki/test.bash9
1 files changed, 8 insertions, 1 deletions
diff --git a/doc/articles/wiki/test.bash b/doc/articles/wiki/test.bash
index 02ed1894a..54a632c30 100755
--- a/doc/articles/wiki/test.bash
+++ b/doc/articles/wiki/test.bash
@@ -7,10 +7,17 @@ set -e
wiki_pid=
cleanup() {
kill $wiki_pid
- rm -f test_*.out Test.txt final-test.bin final-test.go
+ rm -f test_*.out Test.txt final-test.bin final-test.go a.out get.bin
}
trap cleanup 0 INT
+# If called with -all, check that all code snippets compile.
+if [ "$1" == "-all" ]; then
+ for fn in *.go; do
+ go build -o a.out $fn
+ done
+fi
+
go build -o get.bin get.go
addr=$(./get.bin -addr)
sed s/:8080/$addr/ < final.go > final-test.go