summaryrefslogtreecommitdiff
path: root/test/scorsh_testsuite
diff options
context:
space:
mode:
authorKatolaZ <katolaz@freaknet.org>2017-08-09 09:53:34 +0100
committerKatolaZ <katolaz@freaknet.org>2017-08-09 09:53:34 +0100
commit231beb5c3fc50f40e31b9e00237c67f267188057 (patch)
tree269eff309883d5ae7e8e3fdfc012aa91d53416cf /test/scorsh_testsuite
parent8062fc191395fbedd431fd18d23a7a60e2107e90 (diff)
preliminary testbed
Diffstat (limited to 'test/scorsh_testsuite')
-rw-r--r--test/scorsh_testsuite57
1 files changed, 57 insertions, 0 deletions
diff --git a/test/scorsh_testsuite b/test/scorsh_testsuite
new file mode 100644
index 0000000..57954f7
--- /dev/null
+++ b/test/scorsh_testsuite
@@ -0,0 +1,57 @@
+#!/bin/sh
+
+####
+##
+## testsuite for SCORSH
+##
+
+if [ $# -lt 1 ]; then
+ echo "Usage: $0 <spec_file>"
+ exit 1
+fi
+
+. ./scorsh_functions
+
+[ -f "$1" ] || ( echo "Unable to open file $1" && exit 2 )
+
+. "$1"
+
+
+trap cleanup 0 HUP INT TRAP TERM QUIT
+
+## func
+cleanup(){
+ ## do stuff here
+ rm -rf ${SCORSH_REPO}
+ rm -rf ${SCORSH_APP}
+ rm -rf ${REMOTE_REPO}
+ rm -rf ${LOCAL_REPO}
+
+ echo "Exiting..."
+}
+
+## func
+run_tests(){
+
+ for t in $TESTS; do
+ export PASSED_TESTS FAILED_TESTS TOT_TESTS
+ echo "\033[4;7;36m-+-+- running tests in $t -+-+-\033[0m"
+ $t
+ eval $(cat ${STATUS_FILE})
+ echo "\033[35m-------------------------------------------------------------\033[0m"
+
+ done
+ export PASSED_TESTS FAILED_TESTS TOT_TESTS
+}
+
+
+## main
+
+export SCORSH_URL SCORSH_REPO SCORSH_APP REMOTE_REPO LOCAL_REPO
+PASSED_TESTS=0
+FAILED_TESTS=0
+TOT_TESTS=0
+
+run_tests
+
+report_results