File: newtest.sh

package info (click to toggle)
lcagent 0.1.0-1
  • links: PTS, VCS
  • area: main
  • in suites: experimental
  • size: 1,188 kB
  • sloc: ansic: 11,202; sh: 1,721; makefile: 318; yacc: 151; lex: 55
file content (25 lines) | stat: -rwxr-xr-x 443 bytes parent folder | download | duplicates (4)
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
#!/bin/sh -ue

SKEL="skel.c"

# first, find filename for new test

for i in `seq -w 0 9999`
do
	TESTEXEC="0000-$i.test"
	TESTFILE="0000-$i.c"
	if [ ! -f ${TESTFILE} ]; then
		break
	fi
done

head -n1 ${SKEL} > ${TESTFILE}
echo "/* Copyright (c) `date +"%Y"` `git config --get user.name` <`git config --get user.email`> */" >> ${TESTFILE}
tail -n+3 ${SKEL} >> ${TESTFILE}

if [ -d all ]; then
	cd all
	ln -s ../${TESTEXEC}
fi

echo ${TESTFILE}