main_testing5/bf_test.sh
changeset 475 59e005dcf163
parent 426 b51467741af2
child 477 a4e1f63157d8
equal deleted inserted replaced
474:b528d1d3d3c3 475:59e005dcf163
    12 
    12 
    13 
    13 
    14 # compilation tests
    14 # compilation tests
    15 
    15 
    16 function scala_compile {
    16 function scala_compile {
    17   (ulimit -t 30; JAVA_OPTS="-Xmx1g" scala -Xprint:parser "$1" 2> c$out 1> c$out)
    17   (ulimit -t 30; JAVA_OPTS="-Xmx1g" scala-cli compile "$1" 2> c$out 1> c$out)
    18 }
    18 }
    19 
    19 
    20 # functional tests
    20 # functional tests
    21 
    21 
    22 function scala_assert {
    22 function scala_assert {
    23   (ulimit -t 30; JAVA_OPTS="-Xmx1g" scala -i "$1" -- "$2" -e "" 2> /dev/null 1> /dev/null)
    23   (ulimit -t 30; JAVA_OPTS="-Xmx1g" scala-cli -i "$1" "$2" -e "urbanmain()" 2> /dev/null 1> /dev/null)
    24 }
    24 }
    25 
    25 
    26 # purity test
    26 # purity test
    27 
       
    28 function scala_vars {
    27 function scala_vars {
    29     (sed 's/immutable/ok/g' c$out > cb$out;
    28    (sed 's/immutable/ok/g' c$out > cb$out;
    30      egrep '\bvar\b|\breturn\b|\.par\.|\.par |ListBuffer|AtomicInteger|mutable|util.control|new Array' cb$out 2> /dev/null 1> /dev/null)
    29     egrep '\bvar\b|\breturn\b|\.par\.|\.par |ListBuffer|AtomicInteger|mutable|util.control|new Array' cb$out 2> /dev/null 1> /dev/null)
    31 }
    30 }
    32 
    31 
    33 
    32 
    34 
    33 
    35 # compilation test
    34 # compilation test