forked from root-project/roottest
-
Notifications
You must be signed in to change notification settings - Fork 0
/
mktest
executable file
·55 lines (39 loc) · 1.06 KB
/
mktest
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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
#!/bin/bash
# Name: mktest
# Desc: Add test directories, copies Makefiles and update CVS repository
# Args: $1 -> dest dir
thisscript=$0
scriptdir=`dirname $0`
printUSAGE() { echo "Usage: mktest [path]" ;
echo " Where path is the directory path for the test to be added";
echo "";
echo "mktest is a script to add test directories, copy Makefile
and update cvs repository";
exit 1; }
if [ $# -lt 1 ] ; then
printUSAGE ;
fi
# Saves the parent directory
PARENT_DIR=${1%/*}
# if this is the top directory or not
r=`echo $1 | grep '/'`
if [ "$r" == "$1" ]; then
if [ ! -d "$PARENT_DIR" ] ; then
$thisscript $PARENT_DIR
fi
fi
#Make Direcroty
mkdir $1
git add $1
#Copy Makefile.template to the new test directory
cp $scriptdir/scripts/Makefile.template $1/Makefile
cp $scriptdir/scripts/rootrc.template $1/.rootrc
git add $1/Makefile $1/.rootrc
#Add to CVS
#cvs add $1
# change directory
cd $1
#Add & Commit Makefile to CVS
#cvs add Makefile
#cvs commit -m "Makefile" Makefile
echo "Message: $1 successfully created "