testing1/collatz_test.sh
changeset 218 22705d22c105
parent 210 63a1376cbebd
child 261 8997430d9765
equal deleted inserted replaced
217:e689375abcc1 218:22705d22c105
    35 #
    35 #
    36 echo "collatz.scala does not contain vars, returns etc?" >> $out
    36 echo "collatz.scala does not contain vars, returns etc?" >> $out
    37 
    37 
    38 if (scala_vars collatz.scala)
    38 if (scala_vars collatz.scala)
    39 then
    39 then
    40   echo "  --> fail (make triple-sure your program conforms to the required format)" >> $out
    40   echo "  --> FAIL (make triple-sure your program conforms to the required format)\n" >> $out
    41   tsts0=$(( 0 ))
    41   tsts0=$(( 0 ))
    42 else
    42 else
    43   echo "  --> success" >> $out
    43   echo "  --> success" >> $out
    44   tsts0=$(( 0 )) 
    44   tsts0=$(( 0 )) 
    45 fi
    45 fi
    54   if (scala_compile collatz.scala)
    54   if (scala_compile collatz.scala)
    55   then
    55   then
    56     echo "  --> success" >> $out
    56     echo "  --> success" >> $out
    57     tsts=$(( 0 ))
    57     tsts=$(( 0 ))
    58   else
    58   else
    59     echo "  --> scala did not run collatz.scala" >> $out
    59     echo "  --> SCALA DID NOT RUN COLLATZ.SCALA\n" >> $out
    60     tsts=$(( 1 )) 
    60     tsts=$(( 1 )) 
    61   fi
    61   fi
    62 else
    62 else
    63   tsts=$(( 1 ))     
    63   tsts=$(( 1 ))     
    64 fi
    64 fi
    74 
    74 
    75   if (scala_assert "collatz.scala" "collatz_test1.scala")
    75   if (scala_assert "collatz.scala" "collatz_test1.scala")
    76   then
    76   then
    77     echo "  --> success" >> $out
    77     echo "  --> success" >> $out
    78   else
    78   else
    79     echo "  --> one of the tests failed" >> $out
    79     echo "  --> ONE OF THE TESTS FAILED\n" >> $out
    80   fi
    80   fi
    81 fi
    81 fi
    82 
    82 
    83 ### collatz-max tests
    83 ### collatz-max tests
    84 
    84 
    93 
    93 
    94   if (scala_assert "collatz.scala" "collatz_test2.scala") 
    94   if (scala_assert "collatz.scala" "collatz_test2.scala") 
    95   then
    95   then
    96     echo "  --> success" >> $out
    96     echo "  --> success" >> $out
    97   else
    97   else
    98     echo "  --> one of the tests failed" >> $out
    98     echo "  --> ONE OF THE TESTS FAILED\n" >> $out
    99   fi
    99   fi
   100 fi
   100 fi
   101 
   101 
   102 
   102