OILS / testdata / control-flow-graph.sh View on Github | oilshell.org

35 lines, 26 significant
1#!/usr/bin/env bash
2
3: ${LIB_OSH=stdlib/osh}
4source $LIB_OSH/bash-strict.sh
5source $LIB_OSH/task-five.sh
6
7REPO_ROOT=$(cd "$(dirname $0)/.."; pwd)
8readonly REPO_ROOT
9
10source build/common.sh
11
12generate_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
29generate_all() {
30 generate_one control_flow cf_edge
31 generate_one scoped_resource cf_edge
32 generate_one test_switch cf_edge
33}
34
35task-five "$@"