| Line | |
|---|
| 1 | #!/bin/sh
|
|---|
| 2 |
|
|---|
| 3 | TESTFILES="Makefile.am scanner.l parser.y .cvsignore test.input"
|
|---|
| 4 |
|
|---|
| 5 | if [ ! $# -eq 1 ] ; then
|
|---|
| 6 | echo 1>&2 Usage: $0 test-name
|
|---|
| 7 | exit 1
|
|---|
| 8 | fi
|
|---|
| 9 |
|
|---|
| 10 | if test -e "$1" ; then
|
|---|
| 11 | echo 1>&2 "$1 exists already"
|
|---|
| 12 | exit 1
|
|---|
| 13 | fi
|
|---|
| 14 |
|
|---|
| 15 | mkdir $1
|
|---|
| 16 | if test "$?" -ne 0 ; then
|
|---|
| 17 | echo 1>&2 "mkdir $1 failed"
|
|---|
| 18 | exit 1
|
|---|
| 19 | fi
|
|---|
| 20 |
|
|---|
| 21 | for i in $TESTFILES ; do
|
|---|
| 22 | cp TEMPLATE/$i $1/$i
|
|---|
| 23 | done
|
|---|
| 24 |
|
|---|
| 25 | # Modify .cvsignore
|
|---|
| 26 | echo "$1" >> "$1"/.cvsignore
|
|---|
| 27 |
|
|---|
| 28 | # Modify top-level configure.in
|
|---|
| 29 | sed '/--new-test-here--/i\
|
|---|
| 30 | tests/'"$1"'/Makefile' < ../configure.in > configure.in.tmp
|
|---|
| 31 |
|
|---|
| 32 | mv configure.in.tmp ../configure.in
|
|---|
| 33 |
|
|---|
| 34 | # Modify Makefile.am
|
|---|
| 35 | sed '/^\(DIST_\)\?SUBDIRS/a\
|
|---|
| 36 | '"$1"' \\' < Makefile.am > Makefile.am.tmp
|
|---|
| 37 |
|
|---|
| 38 | mv Makefile.am.tmp Makefile.am
|
|---|
| 39 |
|
|---|
| 40 | # Modify new-test/Makefile.am
|
|---|
| 41 | sed "s:TEMPLATE:$1:g" < "$1"/Makefile.am > "$1"/Makefile.am.tmp
|
|---|
| 42 | mv "$1"/Makefile.am.tmp "$1"/Makefile.am
|
|---|
Note:
See
TracBrowser
for help on using the repository browser.