diff options
author | David Gibson <david@gibson.dropbear.id.au> | 2020-03-04 15:45:47 +1100 |
---|---|---|
committer | David Gibson <david@gibson.dropbear.id.au> | 2020-03-04 16:03:28 +1100 |
commit | 9b75292c335ca4d4f93ba91db92d4de1f0269e93 (patch) | |
tree | 00165d8ed3b6986689c3ae5a03443902b0de7a7b | |
parent | 6c253afd07d4722aaa7f72d33ca7cbeba973ccfb (diff) | |
download | device-tree-compiler-9b75292c335ca4d4f93ba91db92d4de1f0269e93.tar.gz |
tests: Honour $(NO_PYTHON) flag from Makefile in run_tests.sh
Currently the test script bases whether to run the Python tests on whether
it can see a built Python module. That can easily be fooled if there is
a stale module there.
Instead, have it actually look at the NO_PYTHON variable exported from the
Makefile. If the variable doesn't exist (such as if we're running the
script manually) fall back on the old logic.
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
-rwxr-xr-x | tests/run_tests.sh | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/tests/run_tests.sh b/tests/run_tests.sh index 6fed97a..7abcb03 100755 --- a/tests/run_tests.sh +++ b/tests/run_tests.sh @@ -11,6 +11,20 @@ if [ -z "$PYTHON" ]; then PYTHON=python3 fi +if [ -n "$NO_PYTHON" ]; then + if [ "$NO_PYTHON" != "0" ]; then + no_python=true + else + no_python=false + fi +else + if [ -f ../pylibfdt/_libfdt.so ] || [ -f ../pylibfdt/_libfdt.cpython-3*.so ]; then + no_python=false + else + no_python=true + fi +fi + # stat differs between platforms if [ -z "$STATSZ" ]; then stat --version 2>/dev/null | grep -q 'GNU' @@ -1016,7 +1030,7 @@ if [ -z "$TESTSETS" ]; then TESTSETS="libfdt utilfdt dtc dtbs_equal fdtget fdtput fdtdump fdtoverlay" # Test pylibfdt if the libfdt Python module is available. - if [ -f ../pylibfdt/_libfdt.so ] || [ -f ../pylibfdt/_libfdt.cpython-3*.so ]; then + if ! $no_python; then TESTSETS="$TESTSETS pylibfdt" fi fi |