| 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 |
# includes 6 file extensions, ignores others such as .c, .vo |
| 12 |
# recursive expansion |
| 13 |
# explicit non-existent file included |
| 14 |
actual=`rocq makefile -sources-of -o CoqMakefile . nonexistent.v` |
| 15 |
expected="a/b/g.v a/g.mlg a/g.mllib a/g.mlpack g.ml g.mli nonexistent.v" |
| 16 |
if [ "$actual" != "$expected" ]; then |
| 17 |
echo actual: $actual |
| 18 |
echo expected: $expected |
| 19 |
exit 1 |
| 20 |
fi |
| 21 |
|
| 22 |
# expands specific directory, not ., gets the right subset |
| 23 |
actual=`rocq makefile -sources-of -o CoqMakefile a` |
| 24 |
expected="a/b/g.v a/g.mlg a/g.mllib a/g.mlpack" |
| 25 |
if [ "$actual" != "$expected" ]; then |
| 26 |
echo actual: $actual |
| 27 |
echo expected: $expected |
| 28 |
exit 1 |
| 29 |
fi |
| 30 |
|
| 31 |
# command line args are in Makefile.conf |
| 32 |
rocq makefile -o CoqMakefile . x |
| 33 |
actual=`grep "COQMF_CMDLINE_VFILES := . x" CoqMakefile.conf` |
| 34 |
if test $? -ne 0; then |
| 35 |
echo bad COQMF_CMDLINE_VFILES: |
| 36 |
grep "COQMF_CMDLINE_VFILES" CoqMakefile.conf |
| 37 |
exit 1 |
| 38 |
fi |