-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest_all.sh
More file actions
executable file
·51 lines (42 loc) · 1.11 KB
/
test_all.sh
File metadata and controls
executable file
·51 lines (42 loc) · 1.11 KB
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
39
40
41
42
43
44
45
46
47
48
49
50
51
#!/bin/bash
# Usage: ./test_all.sh <impl> <example>
# Tests all modes for a given example
# Examples:
# ./test_all.sh jjpy enums
# ./test_all.sh jjswift numbers
IMPL="${1:-jjpy}"
EXAMPLE="${2:-numbers}"
SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
PASSED=0
FAILED=0
FAILED_LIST=""
echo "Testing $EXAMPLE with $IMPL"
echo "=========================================="
run_test() {
local mode="$1"
local target="$2"
local label="$mode"
[ -n "$target" ] && label="$mode:$target"
printf " %-20s " "$label"
if "$SCRIPT_DIR/test_example.sh" "$IMPL" "$mode" "$EXAMPLE" "$target" > /dev/null 2>&1; then
echo "PASS"
((PASSED++))
else
echo "FAIL"
((FAILED++))
FAILED_LIST="$FAILED_LIST $label"
fi
}
# Core modes
run_test run
run_test compile
run_test asm
# Build and exec with all targets
for target in py js c cpp swift objc objcpp go; do
run_test build "$target"
run_test exec "$target"
done
echo "=========================================="
echo "Results: $PASSED passed, $FAILED failed"
[ $FAILED -gt 0 ] && echo "Failed:$FAILED_LIST"
exit $FAILED