| •1 |
#!/usr/bin/bash |
| 2 |
|
| 3 |
set -ex |
| 4 |
|
| 5 |
export COQBIN=$BIN |
| 6 |
export PATH=$COQBIN:$PATH |
| 7 |
|
| 8 |
cd misc/qed-time/ |
| 9 |
|
| 10 |
# This test checks that the Qed time includes the time of the replayed command |
| 11 |
|
| 12 |
# The version of this test in output-modulo-time checks that each |
| 13 |
# command gets 1 time line, but because output-modulo-time normalizes |
| 14 |
# times to 0 it can't check that the replayed command is not ignored |
| 15 |
|
| 16 |
rocq c -time file.v > out |
| 17 |
|
| 18 |
last=$(tail -n 1 out) |
| 19 |
|
| 20 |
last=${last#"Chars 98 - 102 [Qed.] "} |
| 21 |
last=${last%" secs"*} |
| 22 |
|
| 23 |
# sanity check: regex produces a float |
| 24 |
[[ $last =~ [0-9]+"."[0-9]* ]] |
| 25 |
|
| 26 |
test() { |
| 27 |
printf 'if %s <= 0.9:\n\texit (1)\n' "$1" | python3 |
| 28 |
} |
| 29 |
|
| 30 |
# sanity checks: python works on the code we produce |
| 31 |
if test 0.9; then exit 1; fi |
| 32 |
test 1. |
| 33 |
test 1.1 |
| 34 |
|
| 35 |
test "$last" |