]> git.lttng.org Git - lttng-tools.git/commitdiff
tests: Exit serial test runner gracefully when no tests are specified
authorKienan Stewart <kstewart@efficios.com>
Fri, 31 Jan 2025 15:55:16 +0000 (10:55 -0500)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Tue, 11 Feb 2025 14:48:43 +0000 (09:48 -0500)
This avoids the test failing when invoking make with `TESTS=xxx` to
limit which tests are run.

Change-Id: I89c7096a64acc68114d4ca2d0042a219c57ad23a
Signed-off-by: Kienan Stewart <kstewart@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
tests/regression/tests.serial

index a99352fe1c523f5b9dab0bf66d575a375387351a..c936309f6ed46af3858ca48b4878ad6c53c0920d 100755 (executable)
@@ -191,5 +191,11 @@ if __name__ == "__main__":
 
     logging.info("Serial tests received %d tests", len(tests))
     logging.debug("Serial tests: {}".format(tests))
+
+    if len(tests) == 0:
+        tap = lttngtest.TapGenerator(1)
+        tap.skip("No tests specified by the environment")
+        sys.exit(0)
+
     if not run_tests(tests):
         sys.exit(1)
This page took 0.030324 seconds and 4 git commands to generate.