| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475 |
- #!/bin/bash
- # Run every check. Non-zero exit if anything fails.
- #
- # Four suites, in increasing order of "how much could be lying to me":
- #
- # 1. compile matrix 27 fixtures, verdict + code size + data size ASSERTED
- # from expected.tsv. Fast, no pty.
- # 2. .COM linker links every fixture, then re-verifies the bytes with an
- # independent checker that restates the layout constants
- # instead of asking the compiler.
- # 3. UI error path pty: W, C on a bad file, editor opens on the error,
- # Ctrl-K D, Q. Covers the shell behaviour that only
- # exists interactively.
- # 4. UI success path pty: Options -> Destination=COM, C, then the .COM is
- # checked ON DISK. This is the end-to-end path from
- # keystroke to artifact.
- #
- # RtProbe dumps the runtime size and its 14 entry offsets, so a
- # runtime change that moves an entry is visible here.
- #
- # rt_exec.py is NOT run: it needs Unicorn, whose 16-bit ModRM decoding is
- # wrong on this machine (see SUMMARY.md), so its failures would be the
- # emulator's, not the runtime's. Running it by default would be noise.
- set -u
- D=/home/eric/Projets/Projets-Modula2/MyWork/TP3-comp/shell
- GM2=/home/eric/bin/Modula2/Gm2/bin/gm2
- cd "$D" || exit 9
- fail=0
- run () {
- name=$1
- shift
- echo
- echo "=============================================================="
- echo "== $name"
- echo "=============================================================="
- if "$@" ; then
- echo "-- $name: PASS"
- else
- echo "-- $name: FAIL (rc=$?)"
- fail=1
- fi
- }
- echo "== build =="
- make clean >/dev/null 2>&1
- if ! make >/tmp/tp_all_mk 2>&1 ; then
- echo "BUILD FAIL"
- grep -m10 "error:" /tmp/tp_all_mk
- exit 1
- fi
- echo "make rc=0, tpshell $(stat -c%s tpshell) bytes"
- # gm2 reports a pass-3 rollup on the compiler during phase 1 of the two-phase
- # link; that is expected and is not a build failure (make rc=0 is the check).
- run "runtime probe" bash -c '
- GM2=/home/eric/bin/Modula2/Gm2/bin/gm2
- $GM2 -fiso -o /tmp/tp_rtprobe tests/RtProbe.mod Runtime.o Posix.o \
- >/tmp/tp_rt 2>&1 || { grep -m5 error: /tmp/tp_rt; exit 1; }
- /tmp/tp_rtprobe'
- run "compile matrix" tests/run_compile_tests.sh
- run "COM linker" tests/run_com_tests.sh
- run "UI error path" python3 tests/uitest.py
- run "UI success path" python3 tests/comtest.py
- echo
- echo "=============================================================="
- if [ "$fail" -eq 0 ]; then
- echo "OVERALL: ALL PASS"
- else
- echo "OVERALL: FAILURES PRESENT"
- fi
- echo "=============================================================="
- exit $fail
|