File: create-test

package info (click to toggle)
flex 2.5.39-8%2Bdeb8u2
  • links: PTS, VCS
  • area: main
  • in suites: jessie
  • size: 9,532 kB
  • ctags: 2,388
  • sloc: sh: 12,380; ansic: 11,993; lex: 3,902; makefile: 1,261; yacc: 1,003; awk: 78; cpp: 25; sed: 16
file content (33 lines) | stat: -rwxr-xr-x 559 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
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