core_testing1/collatz_test.sh
changeset 474 b528d1d3d3c3
parent 472 6a77c260c8a5
child 477 a4e1f63157d8
equal deleted inserted replaced
473:ac79c2e534bd 474:b528d1d3d3c3
    13 
    13 
    14 
    14 
    15 # compilation tests
    15 # compilation tests
    16 
    16 
    17 function scala_compile {
    17 function scala_compile {
    18   (ulimit -t 30; JAVA_OPTS="-Xmx1g" scala-cli compile "$1" ) #2> c$out 1> c$out)
    18   (ulimit -t 30; JAVA_OPTS="-Xmx1g" scala-cli compile "$1" 2> c$out 1> c$out)
    19 }
    19 }
    20 
    20 
    21 # functional tests
    21 # functional tests
    22 
    22 
    23 function scala_assert {
    23 function scala_assert {
    24   (ulimit -t 30; JAVA_OPTS="-Xmx1g" scala-cli -i "$1" "$2" -e "urbanmain()" ) #2> /dev/null 1> /dev/null)
    24   (ulimit -t 30; JAVA_OPTS="-Xmx1g" scala-cli -i "$1" "$2" -e "urbanmain()" 2> /dev/null 1> /dev/null)
    25 }
    25 }
    26 
    26 
    27 # purity test
    27 # purity test
    28 function scala_vars {
    28 function scala_vars {
    29    (sed 's/immutable/ok/g' c$out > cb$out;
    29    (sed 's/immutable/ok/g' c$out > cb$out;
    40 then
    40 then
    41     echo -e "  --> success" >> $out
    41     echo -e "  --> success" >> $out
    42     tsts=$(( 0 ))
    42     tsts=$(( 0 ))
    43 else
    43 else
    44     echo -e "  --> SCALA DID NOT RUN collatz.scala\n" >> $out
    44     echo -e "  --> SCALA DID NOT RUN collatz.scala\n" >> $out
       
    45     echo -e "  --> try running scala-cli compile collatz.scala on your own computer\n" >> $out
    45     tsts=$(( 1 )) 
    46     tsts=$(( 1 )) 
    46 fi
    47 fi
    47 
    48 
    48 
    49 
    49 
    50