forked from ocaml/merlin
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest.sh
More file actions
executable file
·32 lines (31 loc) · 882 Bytes
/
Copy pathtest.sh
File metadata and controls
executable file
·32 lines (31 loc) · 882 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#!/usr/bin/env bash
if test -n "$1" ; then
out=`mktemp`
while test -n "$1"; do
./ocamlmerlin.native < ./tests/$1.in > $out
# Use more appropriate jsondiff if available
if which jsondiff >& /dev/null; then
DIFF="jsondiff -color"
else
DIFF="diff -u"
fi
$DIFF ./tests/$1.out $out
shift 1
done
rm $out
else
for file in tests/*.in ; do
test_nb=`basename $file .in`
temp_out=`mktemp`
real_out=`echo "$file"|sed 's/\.in$/.out/'`
./ocamlmerlin.native < $file > $temp_out
diff $temp_out $real_out > /dev/null
if [[ $? != 0 ]] ; then
echo -e "$test_nb: \e[1;31mFAILED\e[0m"
echo " run ./test.sh $test_nb to have more informations"
else
echo -e "$test_nb: \e[1;32mOK\e[0m"
fi
rm $temp_out
done
fi