From 52c0eca5154b40f0f8af40f4ccec0e6b51977ce6 Mon Sep 17 00:00:00 2001
From: Jason Hiser <jdhiser@gmail.com>
Date: Tue, 3 Sep 2019 14:54:09 -0400
Subject: [PATCH] improved testing harness

---
 cicd_testing/do-test.sh |  3 +--
 test/test.sh            | 23 ++++++++++++++++-------
 2 files changed, 17 insertions(+), 9 deletions(-)

diff --git a/cicd_testing/do-test.sh b/cicd_testing/do-test.sh
index d458f8a..d206aaa 100755
--- a/cicd_testing/do-test.sh
+++ b/cicd_testing/do-test.sh
@@ -6,10 +6,9 @@ set -x
 
 function main()
 {
-	cd /tmp/libehp_test
 	scons -j3
 	cd test
-	./test.sh
+	./test.sh || exit 1
 	exit 0
 }
 
diff --git a/test/test.sh b/test/test.sh
index 4fc2096..341c487 100755
--- a/test/test.sh
+++ b/test/test.sh
@@ -16,16 +16,25 @@
 #   limitations under the License.
 
 
-cleanup()
+set -x
+set -e
+
+function cleanup()
 {
 	echo "Test failed"
 	exit 1
 }
 
-scons || cleanup 
-./test.exe ./test.exe || cleanup 
-./test.exe /bin/ls || cleanup 
-./test.exe /bin/bash || cleanup 
 
-echo "test passed"
-exit 0
+function main()
+{
+	scons || cleanup 
+	./test.exe ./test.exe || cleanup 
+	./test.exe /bin/ls || cleanup 
+	./test.exe /bin/bash || cleanup 
+
+	echo "test passed"
+	exit 0
+}
+
+main "$@"
-- 
GitLab