3 # This file is part of NIT ( http://www.nitlanguage.org ).
5 # Copyright 2016 Alexandre Terrasa <alexandre@moz-code.org>.
7 # Licensed under the Apache License, Version 2.0 (the "License");
8 # you may not use this file except in compliance with the License.
9 # You may obtain a copy of the License at
11 # http://www.apache.org/licenses/LICENSE-2.0
13 # Unless required by applicable law or agreed to in writing, software
14 # distributed under the License is distributed on an "AS IS" BASIS,
15 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 # See the License for the specific language governing permissions and
17 # limitations under the License.
23 NITC
=..
/..
/..
/bin
/nitc
27 $NITC $test.nit
-o
$OUT/$test.bin
1>&2 2> $OUT/$test.cmp_err
34 chmod +x
$OUT/$test.bin
2> $OUT/$test.err
35 $OUT/$test.bin
> $OUT/$test.res
2> $OUT/$test.err
37 diff $OUT/$test.res
$RES/$test.res
> $OUT/$test.
diff 2> /dev
/null
41 # 0 if the sav not exists
42 # 1 if the file does match
43 # 2 if the file does not match
47 if [ -s
"$OUT/$test.cmp_err" ]; then
49 elif [ -s
"$OUT/$test.err" ]; then
51 elif [ ! -r
"$RES/$test.res" ]; then
53 elif [ -s
"$OUT/$test.diff" ]; then
63 rm -rf
$OUT 2>/dev
/null
64 mkdir
$OUT 2>/dev
/null
71 for file in `ls test_*.nit`; do
82 echo "compile error (cat $OUT/$test.cmp_err)"
86 echo "error (cat $OUT/$test.cmp_err)"
90 echo "skip ($test.res not found)"
94 echo "error (diff $OUT/$test.res $RES/$test.res)"
105 echo "==> success $ok/$all ($ko tests failed, $sk skipped)"