Debian Codegraph @

test-suite/coq-makefile/expand-directories2/run.sh

raw
1 #!/usr/bin/env bash
2
3 . ../template/path-init.sh
4
5 rm -rf _test
6 mkdir _test
7 find . -maxdepth 1 -not -name . -not -name _test -exec cp -r '{}' -t _test ';'
8
9 cd _test || exit 1
10
11 # check cmd line arg is included in coqdep
12 # preserves order of args (cmd line args last)
13 actual=$(rocq makefile -sources-of -f _CoqProject -o CoqMakefile b.v)
14 expected="x/a.v b.v"
15 if [ "$actual" != "$expected" ]; then
16 echo actual: $actual
17 echo expected: $expected
18 exit 1
19 fi
20
21 # correct compile steps reflecting dependency on cmd line arg
22 rocq makefile -f _CoqProject -o CoqMakefile b.v
23 make -f CoqMakefile > makeout
24 cat >expected <<EOT
25 ROCQ DEP VFILES
26 ROCQ compile b.v
27 ROCQ compile x/a.v
28 EOT
29
30 grep -v "make" makeout >actual
31 diff -u actual expected
32
33 # new file is included without running rocq makefile
34 cat >x/c.v <<EOT
35 Require Import T.x.a.
36 EOT
37 make -f CoqMakefile clean
38 make -f CoqMakefile > makeout
39 cat >expected <<EOT
40 ROCQ DEP VFILES
41 ROCQ compile b.v
42 ROCQ compile x/a.v
43 ROCQ compile x/c.v
44 EOT
45
46 grep -v "make" makeout >actual
47 diff -u actual expected