File: qed-time.sh

package info (click to toggle)
coq 9.1.0%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: experimental
  • size: 35,968 kB
  • sloc: ml: 239,908; sh: 4,355; python: 2,985; ansic: 2,644; makefile: 874; lisp: 171; javascript: 63; xml: 24; sed: 2
file content (35 lines) | stat: -rwxr-xr-x 740 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#!/usr/bin/bash

set -ex

export COQBIN=$BIN
export PATH=$COQBIN:$PATH

cd misc/qed-time/

# This test checks that the Qed time includes the time of the replayed command

# The version of this test in output-modulo-time checks that each
# command gets 1 time line, but because output-modulo-time normalizes
# times to 0 it can't check that the replayed command is not ignored

rocq c -time file.v > out

last=$(tail -n 1 out)

last=${last#"Chars 98 - 102 [Qed.] "}
last=${last%" secs"*}

# sanity check: regex produces a float
[[ $last =~ [0-9]+"."[0-9]* ]]

test() {
    printf 'if %s <= 0.9:\n\texit (1)\n' "$1" | python3
}

# sanity checks: python works on the code we produce
if test 0.9; then exit 1; fi
test 1.
test 1.1

test "$last"