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:
25
test/test.sh
25
test/test.sh
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user