-
Notifications
You must be signed in to change notification settings - Fork 23
/
run_tests_inter
executable file
·43 lines (33 loc) · 1.03 KB
/
run_tests_inter
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
#!/bin/sh
set -e
ARCH="--arch=dummy"
failed() {
echo "TESTS FAILED!"
exit 1
}
run_test() {
name=$1
rm -f $name/funcdb.yaml
script=$(cat $name/script)
# First we just need to figure out what functions call which, that's
# exactly what script_callgraph does.
./apply_xform.py $ARCH --script script_callgraph --format none $name
./apply_xform.py $ARCH --script script_callgraph_func_refs --format none $name
./funcdb_util.py $name/funcdb.yaml called_by
./apply_xform.py $ARCH --script script_preserveds $name
./apply_xform.py $ARCH --script $script --iter $name
# Now actually check the expected results
diff -u $name/funcdb.yaml.exp $name/funcdb.yaml
if [ -f $name/callgraph.dot.exp ]; then
./funcdb_dot.py $name/funcdb.yaml -o $name/callgraph.dot
diff -u $name/callgraph.dot.exp $name/callgraph.dot
fi
}
if [ -n "$1" ]; then
run_test $1
exit
fi
for test in $(find -type d -path './tests/interproc-*' | sort); do
echo $test
$0 $test || failed
done