| 1 | #!/bin/sh |
| 2 | # Check that both coqdep and coqtop/coqc supports -R |
| 3 | # Check that both coqdep and coqtop/coqc takes -R preferably to installed $ROCQPATH |
| 4 | # See bugs 2242, 2337, 2339 |
| 5 | rm -f misc/deps/lib/*.vo misc/deps/client/*.vo |
| 6 | output=misc/deps/deps.real |
| 7 | |
| 8 | $coqdep -worker @ROCQWORKER@ -R misc/deps/lib lib -R misc/deps/client client misc/deps/client/bar.v 2>&1 | head -n 1 > "$output" |
| 9 | diff -u --strip-trailing-cr misc/deps/deps.out "$output" 2>&1 |
| 10 | R=$? |
| 11 | times |
| 12 | $coqc -R misc/deps/lib lib misc/deps/lib/foo.v 2>&1 |
| 13 | $coqc -R misc/deps/lib lib -R misc/deps/client client misc/deps/client/foo.v 2>&1 |
| 14 | export ROCQPATH=misc/deps |
| 15 | $coqc -R misc/deps/client client misc/deps/client/bar.v 2>&1 |
| 16 | S=$? |
| 17 | if [ $R = 0 ] && [ $S = 0 ]; then |
| 18 | printf "coqdep and coqc agree\n" |
| 19 | exit 0 |
| 20 | else |
| 21 | printf "coqdep and coqc disagree\n" |
| 22 | exit 1 |
| 23 | fi |