From a3ec5fe650e08aca7effc7e1c589ff7dcef79afe Mon Sep 17 00:00:00 2001 From: Kienan Stewart Date: Fri, 31 Jan 2025 10:55:16 -0500 Subject: [PATCH] tests: Exit serial test runner gracefully when no tests are specified MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit 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 Signed-off-by: Jérémie Galarneau --- tests/regression/tests.serial | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tests/regression/tests.serial b/tests/regression/tests.serial index a99352fe1..c936309f6 100755 --- a/tests/regression/tests.serial +++ b/tests/regression/tests.serial @@ -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) -- 2.39.5