forked from facebook/flow
-
Notifications
You must be signed in to change notification settings - Fork 0
/
runtests.sh
executable file
·38 lines (38 loc) · 910 Bytes
/
runtests.sh
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
33
34
35
36
37
38
#!/bin/bash
FLOW=$(readlink -f $1)
cd "$(dirname "${BASH_SOURCE[0]}")"
passed=0
failed=0
skipped=0
for dir in tests/*/
do
dir=${dir%*/}
cd $dir
name=${dir##*/}
exp_file="${name}.exp"
if [ -e ".flowconfig" ] && [ -e $exp_file ]
then
echo "Testing directory: ${name}"
out_file="${name}.out"
$FLOW check . --all --strip-root --module haste 1> $out_file
diff_file="${name}.diff"
diff $out_file $exp_file > $diff_file
if [ -s $diff_file ]
then
(( failed++ ))
echo "FAILED: ${name}"
else
(( passed++ ))
echo "PASSED: ${name}"
rm -f $out_file
rm -f $diff_file
fi
else
(( skipped++ ))
echo "Skipping directory: ${name}"
fi
cd ../..
done
echo
echo "Passed: ${passed}, Failed: ${failed}, Skipped: ${skipped}"
exit ${failed}