Fri, 19 Nov 2010 16:57:32 +0000
Fix native function return values for the new calling interface
57 | 1 | #!/bin/bash |
2 | ||
3 | failed=""; | |
4 | function failtest { | |
5 | echo "FAILED: $1"; | |
6 | failed="$failed $1"; | |
7 | failed_count=$(($failed_count+1)) | |
8 | } | |
9 | test_count=0 | |
10 | failed_count=0 | |
11 | ||
12 | for script in tests/pass/*.lua; do | |
13 | luac "$script" && node lvm.js >/dev/null || failtest "$script"; | |
14 | test_count=$(($test_count+1)) | |
15 | done | |
16 | ||
17 | for script in tests/fail/*.lua; do | |
18 | luac "$script" && node lvm.js >/dev/null && failtest "$script"; | |
19 | test_count=$(($test_count+1)) | |
20 | done | |
21 | ||
22 | echo $(($test_count-$failed_count))"/$test_count TESTS PASSED"; | |
23 | if ! [ "$failed" == "" ]; then | |
24 | echo "$failed_count TESTS FAILED:"; | |
25 | echo "$failed"; | |
26 | exit 1; | |
27 | fi | |
28 | exit 0; |