Browse Source

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>
main
David Gibson 5 years ago
parent
commit
9b75292c33
  1. 16
      tests/run_tests.sh

16
tests/run_tests.sh

@ -11,6 +11,20 @@ if [ -z "$PYTHON" ]; then @@ -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 @@ -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

Loading…
Cancel
Save