Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a rough and ready indication of which tests failed #42

Merged
merged 1 commit into from
Aug 7, 2015
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 27 additions & 4 deletions tests.sh
Original file line number Diff line number Diff line change
@@ -1,8 +1,31 @@
#!/bin/bash
for f in test/test_*.tcl
do
if [ 'tclsh' == "$1" ] ; then tclsh "$f";
elif [ 'jtcl' == "$1" ] ; then jtcl "$f";

function run_test() {
if [ 'tclsh' == "$1" ] ; then tclsh "$2";
elif [ 'jtcl' == "$1" ] ; then jtcl "$2";
else echo "Usage: ./tests.sh [jtcl|tclsh]"; exit 1;
fi
}

failures=()

for file in test/test_*.tcl
do
run_test "$1" "$file"
if [ $? -gt 0 ] ; then
failures+=($file)
fi
done

echo "Test Summary"
echo "============"
if [ ${#failures[@]} -gt 0 ] ; then
echo ${#failures[@]} " tests failed:"
for failure in ${failures[@]} ; do
echo " ${failure}"
done
exit ${#failures[@]}
else
echo "All tests successful"
exit 0
fi