summaryrefslogtreecommitdiff
path: root/tests/create-test
diff options
context:
space:
mode:
Diffstat (limited to 'tests/create-test')
-rwxr-xr-xtests/create-test33
1 files changed, 33 insertions, 0 deletions
diff --git a/tests/create-test b/tests/create-test
new file mode 100755
index 0000000..05e6864
--- /dev/null
+++ b/tests/create-test
@@ -0,0 +1,33 @@
+#!/bin/sh
+
+TESTFILES="Makefile.am scanner.l parser.y .cvsignore test.input"
+
+if [ ! $# -eq 1 ] ; then
+ echo 1>&2 Usage: $0 test-name
+ exit 1
+fi
+
+if test -e "$1" ; then
+ echo 1>&2 "$1 exists already"
+ exit 1
+fi
+
+mkdir $1
+if test "$?" -ne 0 ; then
+ echo 1>&2 "mkdir $1 failed"
+ exit 1
+fi
+
+for i in $TESTFILES ; do
+ cp TEMPLATE/$i $1/$i
+done
+
+echo "$1" >> "$1"/.cvsignore
+
+sed -i '/--new-test-here--/i\
+tests/'"$1"'/Makefile' ../configure.in
+
+sed -i '/^\(DIST_\)\?SUBDIRS/a\
+ '"$1"' \\' Makefile.am
+
+sed -i "s:TEMPLATE:$1:g" "$1"/Makefile.am