File: test.sh

package info (click to toggle)
proofgeneral 4.5-3
  • links: PTS, VCS
  • area: main
  • in suites: sid, trixie
  • size: 5,172 kB
  • sloc: lisp: 33,783; makefile: 388; sh: 118; perl: 109
file content (39 lines) | stat: -rwxr-xr-x 1,005 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
36
37
38
39
#!/bin/bash

# Print $1 in green
green () {
    echo -e "\e[32m$1\e[0m"
}

# Print $1 in red
red () {
    echo -e "\e[31m$1\e[0m"
}

assert () {
    if [ $# -lt 1 ]; then
        red "ERROR, assert expects some args (the code to run)"
        exit 1
    fi
    /bin/bash -exc '"$@"' bash "$@"
    ret=$?
    if [ "$ret" -ne 0 ]; then
        red "FAILURE, this shell command returned exit status $ret:
\$ $(printf "'%s' " "$@")\n"
        exit $ret
    fi
    echo
}

###############################################################################

assert emacs --version

rootdir=$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null && cd .. && pwd )
srcdir=$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null && pwd )

form="(progn (add-to-list 'load-path \"$rootdir\")
(add-to-list 'load-path \"$srcdir\")
(setq coq-test-dir \"$srcdir/\"))"  # we need a trailing slash here

assert emacs --batch -l ert --eval "$form" -l init-tests.el -l proof-general.el -l coq-tests.el -f ert-run-tests-batch-and-exit