Skip to content

Commit 17ad279

Browse files
committed
prep for enabling execution of unit tests in build tree
1 parent 9750c4e commit 17ad279

File tree

1 file changed

+16
-6
lines changed

1 file changed

+16
-6
lines changed

unittests/run_scripts_quiet.sh

+16-6
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,27 @@
11
#!/bin/bash
22

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+
313
# Remove the 'fails' file if it exists
414
rm -f fails
515

616
# Store the current directory path
717
HERE=`pwd`
818

9-
# Initialize status variable
19+
# Initialize exit status variable
1020
my_status=0
1121

12-
# Start testing scripts in the 'practice_scripts' directory
22+
# Test scripts in the 'practice_scripts' directory
1323
echo "*** practice scripts ***"
14-
for f in `find ./practice_scripts -name "*.inp"` ; do
24+
for f in `find $INPPATH/practice_scripts -name "*.inp"` ; do
1525
# Print the name of the script being tested
1626
echo -n `basename $f`
1727

@@ -30,10 +40,10 @@ for f in `find ./practice_scripts -name "*.inp"` ; do
3040
fi
3141
done
3242

33-
# Start testing scripts in the 'commands', 'functions', and 'fundamentals' directories
43+
# Test scripts in the 'commands', 'functions', and 'fundamentals' directories
3444
for d in commands functions fundamentals ; do
3545
echo "*** $d ***"
36-
cd ./test_scripts/$d
46+
cd $INPPATH/test_scripts/$d
3747
for f in `find . -name "*.inp"` ; do
3848
echo -n `basename $f`
3949
gretlcli -b -q -e $f > /dev/null 2>&1
@@ -55,5 +65,5 @@ if test -f fails ; then
5565
cat fails
5666
fi
5767

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.
5969
exit $my_status

0 commit comments

Comments
 (0)