aboutsummaryrefslogtreecommitdiff
path: root/scripts/test.sh
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/test.sh')
-rwxr-xr-xscripts/test.sh30
1 files changed, 30 insertions, 0 deletions
diff --git a/scripts/test.sh b/scripts/test.sh
new file mode 100755
index 00000000..1833682f
--- /dev/null
+++ b/scripts/test.sh
@@ -0,0 +1,30 @@
+#!/bin/bash
+
+[ -z "$TOPDIR" ] && TOPDIR="$(pwd)"
+
+rm -rf testdir
+mkdir -p testdir
+
+if [ -z "$OLD" ]
+then
+ make install_flat PREFIX=testdir
+fi
+
+cd testdir
+PATH=.:$PATH
+
+. "$TOPDIR"/scripts/test/testing.sh
+[ -f "$TOPDIR/gen_config.h" ] && export OPTIONFLAGS=:$(echo $(sed -nr 's/^#define CFG_(.*) 1/\1/p' "$TOPDIR/gen_config.h") | sed 's/ /:/g')
+
+if [ $# -ne 0 ]
+then
+ for i in "$@"
+ do
+ . "$TOPDIR"/scripts/test/$i.test
+ done
+else
+ for i in "$TOPDIR"/scripts/test/*.test
+ do
+ . $i
+ done
+fi