chiark / gitweb /
test: eliminate shell wrapper for Python test
authorMartin Pitt <martin.pitt@ubuntu.com>
Tue, 20 Jan 2015 20:26:35 +0000 (21:26 +0100)
committerMartin Pitt <martin.pitt@ubuntu.com>
Tue, 20 Jan 2015 20:26:35 +0000 (21:26 +0100)
Use the parallel test runner's TEST_EXTENSIONS/*_LOG_COMPILER feature
(https://www.gnu.org/software/automake/manual/html_node/Parallel-Test-Harness.html)
to run *.py tests through $(PYTHON), and only if we have python
available/enabled.

This eliminates the need of having shell wrappers, thus drop
test/rules-test.sh.

Makefile.am
test/rules-test.sh [deleted file]

index b6a4e3e4e5477bc766974c41fae3a6260a429c53..b368e107e90145b29165e49db8268e71999adb1d 100644 (file)
@@ -148,8 +148,9 @@ check_PROGRAMS =
 check_DATA =
 tests=
 manual_tests =
 check_DATA =
 tests=
 manual_tests =
+TEST_EXTENSIONS = .py
+PY_LOG_COMPILER = $(PYTHON)
 if ENABLE_TESTS
 if ENABLE_TESTS
-export PYTHON
 noinst_PROGRAMS = $(manual_tests) $(tests)
 TESTS = $(tests)
 else
 noinst_PROGRAMS = $(manual_tests) $(tests)
 TESTS = $(tests)
 else
@@ -3767,7 +3768,13 @@ endif
 # ------------------------------------------------------------------------------
 TESTS += \
        test/udev-test.pl \
 # ------------------------------------------------------------------------------
 TESTS += \
        test/udev-test.pl \
-       test/rules-test.sh
+       $(NULL)
+
+if HAVE_PYTHON
+TESTS += \
+       test/rule-syntax-check.py \
+       $(NULL)
+endif
 
 manual_tests += \
        test-libudev \
 
 manual_tests += \
        test-libudev \
@@ -3811,7 +3818,6 @@ DISTCLEAN_LOCAL_HOOKS += test-sys-distclean
 EXTRA_DIST += \
        test/sys.tar.xz \
        test/udev-test.pl \
 EXTRA_DIST += \
        test/sys.tar.xz \
        test/udev-test.pl \
-       test/rules-test.sh \
        test/rule-syntax-check.py
 
 # ------------------------------------------------------------------------------
        test/rule-syntax-check.py
 
 # ------------------------------------------------------------------------------
diff --git a/test/rules-test.sh b/test/rules-test.sh
deleted file mode 100755 (executable)
index 50b83a3..0000000
+++ /dev/null
@@ -1,26 +0,0 @@
-#!/bin/sh
-# Call the udev rule syntax checker on all rules that we ship
-#
-# (C) 2010 Canonical Ltd.
-# Author: Martin Pitt <martin.pitt@ubuntu.com>
-#
-# systemd is free software; you can redistribute it and/or modify it
-# under the terms of the GNU Lesser General Public License as published by
-# the Free Software Foundation; either version 2.1 of the License, or
-# (at your option) any later version.
-
-# systemd is distributed in the hope that it will be useful, but
-# WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-# Lesser General Public License for more details.
-#
-# You should have received a copy of the GNU Lesser General Public License
-# along with systemd; If not, see <http://www.gnu.org/licenses/>.
-
-# skip if we don't have python
-type ${PYTHON:-python} >/dev/null 2>&1 || {
-        echo "$0: No $PYTHON installed, skipping udev rule syntax check"
-        exit 0
-}
-
-$PYTHON $srcdir/test/rule-syntax-check.py