From 951d482bc6d968b1dbc9631c422a2657d7a02704 Mon Sep 17 00:00:00 2001 From: Benjamin Berg Date: Mon, 18 Nov 2019 21:09:50 +0100 Subject: [PATCH] tests: Skip umockdev based test for missing dependencies Also print a warning if umockdev-run is too old. Note that we still try to run the unreliable tests as they are still useful for development. --- tests/umockdev-test.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/tests/umockdev-test.py b/tests/umockdev-test.py index 931dcae5..f1387d6d 100755 --- a/tests/umockdev-test.py +++ b/tests/umockdev-test.py @@ -10,6 +10,18 @@ import subprocess if len(sys.argv) != 2: print("You need to specify exactly one argument, the directory with test data") +# Check that umockdev is available +try: + umockdev_version = subprocess.check_output(['umockdev-run', '--version']) + version = tuple(int(_) for _ in umockdev_version.split(b'.')) + if version < (0, 13, 2): + print('umockdev is too old for test to be reliable, expect random failures!') + print('Please update umockdev to at least 0.13.2.') +except FileNotFoundError: + print('umockdev-run not found, skipping test!') + print('Please install umockdev.') + sys.exit(77) + edir = os.path.dirname(sys.argv[0]) ddir = sys.argv[1]