Use "but only if shell command succeeds", ditch test appliances.
Chris Pressey
2 years ago
17 | 17 |
will illustrate.
|
18 | 18 |
|
19 | 19 |
[Falderal]: http://catseye.tc/node/Falderal
|
|
20 |
|
|
21 |
-> Functionality "Run Samovar Simulation" is implemented by shell command
|
|
22 |
-> "python2 bin/samovar %(test-body-file) --min-events 4 --randomness-type canned"
|
|
23 |
-> but only if shell command "command -v python2" succeeds
|
|
24 |
|
|
25 |
-> Functionality "Run Samovar Simulation" is implemented by shell command
|
|
26 |
-> "python3 bin/samovar %(test-body-file) --min-events 4 --randomness-type canned"
|
|
27 |
-> but only if shell command "command -v python3" succeeds
|
20 | 28 |
|
21 | 29 |
-> Tests for functionality "Run Samovar Simulation"
|
22 | 30 |
|
0 | |
-> Functionality "Run Samovar Simulation" is implemented by
|
1 | |
-> shell command
|
2 | |
-> "python2 bin/samovar %(test-body-file) --min-events 4 --randomness-type canned"
|
3 | |
-> but only if shell command "command -v python2" is successful
|
0 | |
-> Functionality "Run Samovar Simulation" is implemented by
|
1 | |
-> shell command
|
2 | |
-> "python3 bin/samovar %(test-body-file) --min-events 4 --randomness-type canned"
|
3 | |
-> but only if shell command "command -v python3" is successful
|
0 | 0 |
#!/bin/sh
|
1 | |
|
2 | |
APPLIANCES=""
|
3 | 1 |
|
4 | 2 |
if [ "x$PYTHON" != "x" ]; then
|
5 | 3 |
if command -v "$PYTHON" > /dev/null 2>&1; then
|
|
12 | 10 |
MISSING=""
|
13 | 11 |
if command -v python2 > /dev/null 2>&1; then
|
14 | 12 |
PYTHONPATH=src python2 src/samovar/tests.py || exit 1
|
15 | |
APPLIANCES="$APPLIANCES doc/appliances/samovar.py2.md"
|
16 | 13 |
else
|
17 | 14 |
MISSING="${MISSING}2"
|
18 | 15 |
fi
|
19 | 16 |
if command -v python3 > /dev/null 2>&1; then
|
20 | 17 |
PYTHONPATH=src python3 src/samovar/tests.py || exit 1
|
21 | |
APPLIANCES="$APPLIANCES doc/appliances/samovar.py3.md"
|
22 | 18 |
else
|
23 | 19 |
MISSING="${MISSING}3"
|
24 | 20 |
fi
|
|
28 | 24 |
fi
|
29 | 25 |
fi
|
30 | 26 |
|
31 | |
falderal $APPLIANCES doc/Samovar.md || exit 1
|
|
27 |
falderal --verbose doc/Samovar.md || exit 1
|