-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest_snippets.sh
More file actions
executable file
·85 lines (79 loc) · 1.45 KB
/
test_snippets.sh
File metadata and controls
executable file
·85 lines (79 loc) · 1.45 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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
#!/bin/bash
argc=$#
red="\e[0;31m"
green="\e[0;32m"
nc="\e[0m"
function run_test_case {
./llvm-p86 -e "samples/snippets/$1" > /dev/null 2>&1
status=$?
str=$(printf "%-30s %s" $1)
if [ $status -ne 0 ]; then
echo -e "${str} ${red}FAIL${nc}"
else
echo -e "${str} ${green}PASS${nc}"
fi
}
function test {
# spawn if argc is anything but one
if [ $argc -ne 1 ]; then
run_test_case $1
else
run_test_case $1 &
fi
}
echo ""
echo ""
echo "Running snippets from $(pwd)/samples/snippets/"
echo ""
test "array.p"
test "assign.p"
test "assign2.p"
test "builtins.p"
test "case.p"
test "cast.p"
test "comparisons.p"
test "const.p"
test "enum.p"
test "folding.p"
test "function.p"
test "if.p"
test "if_else.p"
test "include.p"
test "int_calc.p"
test "label.p"
test "linked_list.p"
test "logic.p"
test "loop_for.p"
test "loop_repeat.p"
test "loop_while.p"
test "nested_function1.p"
test "nested_function2.p"
test "nested_function3.p"
test "nested_proc.p"
test "opttest.p"
test "params.p"
test "parsetest3.p"
test "pointer.p"
test "procedure.p"
test "procedure1.p"
test "real_calc1.p"
test "real_calc2.p"
test "real_calc3.p"
test "real_calc4.p"
test "record.p"
test "record2.p"
test "scopes.p"
test "semtest.p"
test "sets.p"
test "signes.p"
test "simple.p"
test "simple_array.p"
test "simple_case.p"
test "simple_function.p"
test "simple_record.p"
test "typedef.p"
test "types.p"
test "unnamed_record.p"
test "variant.p"
test "with.p"
wait