git @ Cat's Eye Technologies ZOWIE / 879fedd
Replace test appliances with Falderal 0.14 "but only if" clauses. Chris Pressey 10 months ago
6 changed file(s) with 43 addition(s) and 44 deletion(s). Raw diff Collapse all Expand all
00 #!/bin/sh
11
2 APPLIANCES=""
3 if command -v python2 > /dev/null 2>&1; then
4 APPLIANCES="$APPLIANCES tests/appliances/zowie.py2.md"
5 fi
6 if command -v python3 > /dev/null 2>&1; then
7 APPLIANCES="$APPLIANCES tests/appliances/zowie.py3.md"
8 fi
9 if [ -x bin/zowie-c ]; then
10 APPLIANCES="$APPLIANCES tests/appliances/zowie-c.md"
11 fi
12 if [ -x impl/zowie-hs/bin/zowie-hs ]; then
13 APPLIANCES="$APPLIANCES tests/appliances/zowie-hs.md"
14 fi
15
16 if [ "x$APPLIANCES" = "x" ]; then
17 echo "No suitable Python versions or ZOWIE implementations found."
18 exit 1
19 fi
20
21 falderal $APPLIANCES tests/ZOWIE.md
2 falderal tests/ZOWIE.md
00 Tests for ZOWIE
11 ===============
22
3 This non-exhaustive test suite is written in format of Falderal 0.9.
3 This non-exhaustive test suite is written in format of Falderal 0.14.
4
5 Appliances
6 ----------
7
8 -> Functionality "Interpret ZOWIE Program" is implemented by
9 -> shell command
10 -> "python2 src/zowie.py %(test-body-file)"
11 -> but only if shell command "command -v python2" succeeds
12
13 -> Functionality "Interpret ZOWIE Program" is implemented by
14 -> shell command
15 -> "python3 src/zowie.py %(test-body-file)"
16 -> but only if shell command "command -v python3" succeeds
17
18 -> Functionality "Interpret ZOWIE Program" is implemented by
19 -> shell command
20 -> "./impl/zowie-hs/bin/zowie-hs run %(test-body-file)"
21 -> but only if shell command "[ -x impl/zowie-hs/bin/zowie-hs ]" succeeds
22
23 -> Functionality "Interpret ZOWIE Program" is implemented by
24 -> shell command
25 -> "./impl/zowie-hs/bin/zowie-hs run %(test-body-file)"
26 -> but only if shell command "[ -x impl/zowie-hs/bin/zowie-hs ]" succeeds
27
28 This last Falderal appliance tests the compiled-with-RPython version of the ZOWIE
29 reference interpreter.
30
31 This requires `fa-under-pty`, which is a part of Falderal since version 0.10.
32
33 It requires `fa-under-pty` because, for whatever reason, executables produced
34 by RPython from PyPy version 7.3.5 do not handle having their stdout redirected
35 very well. Specifically, they dump core. It is for this very reason that
36 `fa-under-pty` was written, in fact.
37
38 -> Functionality "Interpret ZOWIE Program" is implemented by
39 -> shell command
40 -> "fa-under-pty ./bin/zowie-c %(test-body-file)"
41 -> but only if shell command "[ -x bin/zowie-c ]" succeeds
42
43 Tests
44 -----
445
546 -> Tests for functionality "Interpret ZOWIE Program"
647
+0
-14
tests/appliances/zowie-c.md less more
0 This Falderal appliance tests the compiled-with-RPython version of the ZOWIE
1 reference interpreter.
2
3 This requires `fa-under-pty`, which is a part of Falderal since version 0.10.
4
5 It requires `fa-under-pty` because, for whatever reason, executables produced
6 by RPython from PyPy version 7.3.5 do not handle having their stdout redirected
7 very well. Specifically, they dump core. It is for this very reason that
8 `fa-under-pty` was written, in fact.
9
10 -> Functionality "Interpret ZOWIE Program" is implemented by
11 -> shell command
12 -> "fa-under-pty ./bin/zowie-c %(test-body-file)"
13
+0
-3
tests/appliances/zowie-hs.md less more
0 -> Functionality "Interpret ZOWIE Program" is implemented by
1 -> shell command
2 -> "./impl/zowie-hs/bin/zowie-hs run %(test-body-file)"
+0
-3
tests/appliances/zowie.py2.md less more
0 -> Functionality "Interpret ZOWIE Program" is implemented by
1 -> shell command
2 -> "python2 src/zowie.py %(test-body-file)"
+0
-3
tests/appliances/zowie.py3.md less more
0 -> Functionality "Interpret ZOWIE Program" is implemented by
1 -> shell command
2 -> "python3 src/zowie.py %(test-body-file)"