1 | #!/usr/bin/env bash
|
2 |
|
3 | : ${LIB_OSH=stdlib/osh}
|
4 | source $LIB_OSH/bash-strict.sh
|
5 | source $LIB_OSH/task-five.sh
|
6 |
|
7 | REPO_ROOT=$(cd "$(dirname $0)/.."; pwd)
|
8 | readonly REPO_ROOT
|
9 |
|
10 | source build/common.sh
|
11 |
|
12 | generate_one() {
|
13 | pushd $REPO_ROOT
|
14 | local mycpp=_bin/shwrap/mycpp_main
|
15 | ninja $mycpp
|
16 |
|
17 | local ex=$1
|
18 | shift
|
19 | $mycpp '.:pyext' _tmp/mycpp-cfg-testdata mycpp/examples/"${ex}.py"
|
20 |
|
21 | for fact in "$@";
|
22 | do
|
23 | local fact_file="${fact}.facts"
|
24 | cp _tmp/mycpp-facts/$fact_file testdata/control-flow-graph/$ex/$fact_file
|
25 | done
|
26 | popd
|
27 | }
|
28 |
|
29 | generate_all() {
|
30 | generate_one control_flow cf_edge
|
31 | generate_one scoped_resource cf_edge
|
32 | generate_one test_switch cf_edge
|
33 | }
|
34 |
|
35 | task-five "$@"
|