Upgrade test harness to test under both Python 2 and Python 3.
Chris Pressey
3 years ago
55 | 55 |
|
56 | 56 |
This is a test suite, written in [Falderal][] format, for the `t-rext`
|
57 | 57 |
utility. It also serves as documentation for said utility.
|
58 | |
|
59 | |
-> Functionality "Clean up punctuation and spaces" is implemented by
|
60 | |
-> shell command "bin/t-rext %(test-body-file)"
|
61 | 58 |
|
62 | 59 |
-> Tests for functionality "Clean up punctuation and spaces"
|
63 | 60 |
|
|
0 |
-> Functionality "Clean up punctuation and spaces" is implemented by
|
|
1 |
-> shell command "python2 bin/t-rext %(test-body-file)"
|
|
0 |
-> Functionality "Clean up punctuation and spaces" is implemented by
|
|
1 |
-> shell command "python3 bin/t-rext %(test-body-file)"
|
0 | 0 |
#!/bin/sh
|
1 | 1 |
|
2 | |
falderal README.md
|
|
2 |
APPLIANCES=""
|
|
3 |
MISSING=""
|
|
4 |
|
|
5 |
if command -v python2 > /dev/null 2>&1; then
|
|
6 |
APPLIANCES="$APPLIANCES appliances/t-rext.py2.md"
|
|
7 |
else
|
|
8 |
MISSING="${MISSING}2"
|
|
9 |
fi
|
|
10 |
|
|
11 |
if command -v python3 > /dev/null 2>&1; then
|
|
12 |
APPLIANCES="$APPLIANCES appliances/t-rext.py3.md"
|
|
13 |
else
|
|
14 |
MISSING="${MISSING}3"
|
|
15 |
fi
|
|
16 |
|
|
17 |
if [ "x${MISSING}" = "x23" ]; then
|
|
18 |
echo "Neither python2 nor python3 found on executable search path. Aborting."
|
|
19 |
exit 1
|
|
20 |
fi
|
|
21 |
|
|
22 |
falderal $APPLIANCES README.md || exit 1
|