2 # This file is part of NIT ( http://www.nitlanguage.org ).
4 # Copyright 2015 Alexandre Terrasa <alexandre@moz-code.org>.
6 # Licensed under the Apache License, Version 2.0 (the "License");
7 # you may not use this file except in compliance with the License.
8 # You may obtain a copy of the License at
10 # http://www.apache.org/licenses/LICENSE-2.0
12 # Unless required by applicable law or agreed to in writing, software
13 # distributed under the License is distributed on an "AS IS" BASIS,
14 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 # See the License for the specific language governing permissions and
16 # limitations under the License.
22 # Execute test with name $1.
26 $BIN/refund
$test.json
$OUT/$test.res
> $OUT/$test.out
2> $OUT/$test.err
27 diff $OUT/$test.res
$RES/$test.res
> $OUT/$test.
diff 2> /dev
/null
31 # 0 if the sav not exists
32 # 1 if the file does match
33 # 2 if the file does not match
37 if [ ! -r
"$RES/$test.res" ]; then
39 elif [ ! -s
$OUT/$test.
diff ]; then
49 rm -rf
$OUT 2>/dev
/null
50 mkdir
$OUT 2>/dev
/null
57 for file in `ls *.json`; do
67 echo "skip ($test.res not found)"
75 echo "error (diff $OUT/$test.res $RES/$test.res)"
81 # clear tmp stats file.
85 echo "==> success $ok/$all ($ko tests failed, $sk skipped)"