github/workflows/pycopy-test: Upgrade Pycopy to 3.6.1.
[ScratchABlock.git] / run_tests_inter
blob4ba5f0ef021e2181d21d2c248bcef14cd275f438
1 #!/bin/sh
2 set -e
4 ARCH="--arch=dummy"
6 failed() {
7 echo "TESTS FAILED!"
8 exit 1
11 run_test() {
12 name=$1
13 rm -f $name/funcdb.yaml
14 script=$(cat $name/script)
16 # First we just need to figure out what functions call which, that's
17 # exactly what script_callgraph does.
18 ./apply_xform.py $ARCH --script script_callgraph --format none $name
19 ./apply_xform.py $ARCH --script script_callgraph_func_refs --format none $name
20 ./funcdb_util.py $name/funcdb.yaml called_by
22 ./apply_xform.py $ARCH --script script_preserveds $name
24 ./apply_xform.py $ARCH --script $script --iter $name
26 # Now actually check the expected results
27 diff -u $name/funcdb.yaml.exp $name/funcdb.yaml
28 if [ -f $name/callgraph.dot.exp ]; then
29 ./funcdb_dot.py $name/funcdb.yaml -o $name/callgraph.dot
30 diff -u $name/callgraph.dot.exp $name/callgraph.dot
34 if [ -n "$1" ]; then
35 run_test $1
36 exit
39 for test in $(find -type d -path './tests/interproc-*' | sort); do
40 echo $test
41 $0 $test || failed
42 done