| •1 |
#!/usr/bin/bash |
| 2 |
|
| 3 |
export COQBIN=$BIN |
| 4 |
export PATH=$COQBIN:$PATH |
| 5 |
|
| 6 |
set -e |
| 7 |
|
| 8 |
TMP=`mktemp -d` |
| 9 |
cd $TMP |
| 10 |
mkdir -p overridden/theories/Init/ |
| 11 |
|
| 12 |
mkdir overridden/plugins |
| 13 |
touch overridden/theories/Init/Prelude.vo |
| 14 |
|
| 15 |
cat > coq_environment.txt <<EOT |
| 16 |
# we override ROCQLIB because we can |
| 17 |
ROCQLIB="$TMP/overridden" # bla bla |
| 18 |
ROCQRUNTIMELIB="$TMP/overridden" # bla bla |
| 19 |
OCAMLFIND="$TMP/overridden" |
| 20 |
FOOBAR="one more" |
| 21 |
EOT |
| 22 |
|
| 23 |
cp $BIN/rocq . |
| 24 |
mkdir -p overridden/tools/ |
| 25 |
cp $ROCQLIB/../rocq-runtime/tools/CoqMakefile.in overridden/tools/ |
| 26 |
|
| 27 |
set +e |
| 28 |
|
| 29 |
unset ROCQLIB |
| 30 |
N=`./rocq c -config | grep COQLIB | grep /overridden | wc -l` |
| 31 |
if [ $N -ne 1 ]; then |
| 32 |
echo ROCQLIB not overridden by coq_environment |
| 33 |
rocq -config |
| 34 |
exit 1 |
| 35 |
fi |
| 36 |
N=`./rocq c -config | grep OCAMLFIND | grep /overridden | wc -l` |
| 37 |
if [ $N -ne 1 ]; then |
| 38 |
echo OCAMLFIND not overridden by coq_environment |
| 39 |
rocq -config |
| 40 |
exit 1 |
| 41 |
fi |
| 42 |
./rocq makefile -o CoqMakefile -R . foo > /dev/null |
| 43 |
N=`grep COQMF_OCAMLFIND CoqMakefile.conf | grep /overridden | wc -l` |
| 44 |
if [ $N -ne 1 ]; then |
| 45 |
echo COQMF_OCAMLFIND not overridden by coq_environment |
| 46 |
cat CoqMakefile.conf |
| 47 |
exit 1 |
| 48 |
fi |
| 49 |
|
| 50 |
mkdir -p overridden2/theories/Init/ |
| 51 |
|
| 52 |
mkdir overridden2/plugins |
| 53 |
touch overridden2/theories/Init/Prelude.vo |
| 54 |
|
| 55 |
export ROCQLIB="$PWD/overridden2" |
| 56 |
N=`./rocq c -config | grep COQLIB | grep overridden2 | wc -l` |
| 57 |
if [ $N -ne 1 ]; then |
| 58 |
echo ROCQLIB not overridden by ROCQLIB when coq_environment present |
| 59 |
rocq -config |
| 60 |
exit 1 |
| 61 |
fi |
| 62 |
|
| 63 |
rm -rf $TMP |
| 64 |
exit 0 |