Commits

Cat's Eye Technologies committed b95ca86

Make test driver more suitable for automated testing.

Comments (0)

Files changed (1)

 
 echo -n '' > test_config
 
-if [ "x$1" = "xeval" -o "x$1" = "xall" ]; then
+if [ "x$1" = x ]; then
   cat >>test_config <<EOF
     -> Functionality "Run Castile Program" is implemented by shell command
     -> "bin/castile %(test-file)"
 EOF
 fi
 
-if [ "x$1" = "xjs" -o "x$1" = "xall" ]; then
+if [ ! x`which node` = x ]; then
   cat >>test_config <<EOF
     -> Functionality "Run Castile Program" is implemented by shell command
     -> "bin/castile -c javascript %(test-file) > foo.js && node foo.js"
 EOF
 fi
 
-if [ "x$1" = "xruby" -o "x$1" = "xall" ]; then
+if [ ! x`which ruby` = x ]; then
   cat >>test_config <<EOF
     -> Functionality "Run Castile Program" is implemented by shell command
     -> "bin/castile -c ruby %(test-file) > foo.rb && ruby foo.rb"
 EOF
 fi
 
-if [ "x$1" = "xstackmac" -o "x$1" = "xall" ]; then
+if [ -e bin/stackmac ]; then
   cat >>test_config <<EOF
     -> Functionality "Run Castile Program" is implemented by shell command
     -> "bin/castile -c stackmac %(test-file) > foo.stack && bin/stackmac foo.stack"
 fi
 
 falderal -b test_config README.markdown
+RESULT=$?
 rm -f test_config foo.* a.out
+exit $RESULT