aboutsummaryrefslogtreecommitdiff
path: root/tests/unittest.bash
diff options
context:
space:
mode:
Diffstat (limited to 'tests/unittest.bash')
-rwxr-xr-xtests/unittest.bash10
1 files changed, 7 insertions, 3 deletions
diff --git a/tests/unittest.bash b/tests/unittest.bash
index a43678d..9a9a7a5 100755
--- a/tests/unittest.bash
+++ b/tests/unittest.bash
@@ -238,7 +238,7 @@ capture_test_stderr () {
# Force XML_OUTPUT_FILE to an existing path
if [ -z "${XML_OUTPUT_FILE:-}" ]; then
- XML_OUTPUT_FILE=${TEST_TMPDIR}/ouput.xml
+ XML_OUTPUT_FILE=${TEST_TMPDIR}/output.xml
fi
#### Global variables:
@@ -674,8 +674,12 @@ if [ "$UNAME" = "linux" ] || [[ "$UNAME" =~ msys_nt* ]]; then
}
else
function timestamp() {
- # OS X and FreeBSD do not have %N so python is the best we can do
- python -c 'import time; print int(round(time.time() * 1000))'
+ # macOS and BSDs do not have %N, so Python is the best we can do.
+ # LC_ALL=C works around python 3.8 and 3.9 crash on macOS when the
+ # filesystem encoding is unspecified (e.g. when LANG=en_US).
+ local PYTHON=python
+ command -v python3 &> /dev/null && PYTHON=python3
+ LC_ALL=C "${PYTHON}" -c 'import time; print(int(round(time.time() * 1000)))'
}
fi