1
1
#! /bin/bash
2
2
3
+ if [ " x$1 " != " x" ] ; then
4
+ # executing in build tree
5
+ INPPATH=$1
6
+ GRETLCLI=" ../cli/gretlcli"
7
+ else
8
+ # executing "here" using installed gretlcli
9
+ INPPATH=" ."
10
+ GRETLCLI=" gretlcli"
11
+ fi
12
+
3
13
# Remove the 'fails' file if it exists
4
14
rm -f fails
5
15
6
16
# Store the current directory path
7
17
HERE=` pwd`
8
18
9
- # Initialize status variable
19
+ # Initialize exit status variable
10
20
my_status=0
11
21
12
- # Start testing scripts in the 'practice_scripts' directory
22
+ # Test scripts in the 'practice_scripts' directory
13
23
echo " *** practice scripts ***"
14
- for f in ` find . /practice_scripts -name " *.inp" ` ; do
24
+ for f in ` find $INPPATH /practice_scripts -name " *.inp" ` ; do
15
25
# Print the name of the script being tested
16
26
echo -n ` basename $f `
17
27
@@ -30,10 +40,10 @@ for f in `find ./practice_scripts -name "*.inp"` ; do
30
40
fi
31
41
done
32
42
33
- # Start testing scripts in the 'commands', 'functions', and 'fundamentals' directories
43
+ # Test scripts in the 'commands', 'functions', and 'fundamentals' directories
34
44
for d in commands functions fundamentals ; do
35
45
echo " *** $d ***"
36
- cd . /test_scripts/$d
46
+ cd $INPPATH /test_scripts/$d
37
47
for f in ` find . -name " *.inp" ` ; do
38
48
echo -n ` basename $f `
39
49
gretlcli -b -q -e $f > /dev/null 2>&1
@@ -55,5 +65,5 @@ if test -f fails ; then
55
65
cat fails
56
66
fi
57
67
58
- # Exit with the status code. 0 if all scripts passed, 1 if any script failed.
68
+ # Exit with status code 0 if all scripts passed, 1 if any script failed.
59
69
exit $my_status
0 commit comments