Enhance testing: run all executables

Add a #! line at the beginning of each of the existing Python programs
and change these files to be executable. This sets the stage for having
the test script blindly run anything that is executable, adding support
for testing many programming languages.
This commit is contained in:
Bruce Adams
2013-09-24 21:58:27 -04:00
parent 4bae21ffbf
commit 5749c2c50f
18 changed files with 46 additions and 11 deletions

View File

@@ -11,17 +11,20 @@ files=$(echo *.txt)
for dir in ../[0-9][0-9]-* ; do
cd $dir
for file in $files ; do
exe=$(echo tf-[0-9][0-9].py)
msg testing $(basename $dir)/$exe with $file
python $exe ../$file | diff -b - $mydir/$file
result=$?
total=$((total+1))
if [ $result -ne 0 ]; then
failures=$(($failures+1))
msg FAILED!
else
msg passed.
fi
for exe in * ; do
if [ -x $exe ]; then
msg testing $(basename $dir)/$exe with $file
./$exe ../$file | diff -b - $mydir/$file
result=$?
total=$((total+1))
if [ $result -ne 0 ]; then
failures=$(($failures+1))
msg FAILED!
else
msg passed.
fi
fi
done
done
cd $mydir
done