[igt-dev] [i-g-t 1/2] scripts/test_list: Ignore uncompiled tests

Bhanuprakash Modem bhanuprakash.modem at intel.com
Thu Aug 31 15:21:59 UTC 2023


As we are using wildcards in test_config json file, script
assumes each file in the list is compiled & <file_name>.testlist
is generated. But it is not always true.

Example:
 - kms_test_config.json includes all files inside chamelium dir
 - And if we compile without chamelium tests, will endup with
   build failures.

$ meson -Dchamelium=disabled build && ninja -C build
FileNotFoundError: [Errno 2] No such file or directory: 'igt/build/tests/kms_chamelium_frames.testlist'
[1551/1555] Compiling C object 'runner/527aa9f@@runner_test at exe/runner_tests.c.o'.
ninja: build stopped: subcommand failed.
make: *** [Makefile:10: all] Error 1

So, update the scripts to just ignore if <file_name>.testlist isn't find.

$ meson -Dchamelium=disabled build && ninja -C build
[5/7] Generating kms_tests.rst with a custom command
kms_chamelium_hpd.testlist: Testlist file not found.
kms_chamelium_frames.testlist: Testlist file not found.
kms_chamelium_audio.testlist: Testlist file not found.
kms_chamelium_edid.testlist: Testlist file not found.
kms_chamelium_color.testlist: Testlist file not found.
[7/7] Generating kms_tests.html with a custom command

Cc: Mauro Carvalho Chehab <mchehab at kernel.org>
Signed-off-by: Bhanuprakash Modem <bhanuprakash.modem at intel.com>
---
 scripts/test_list.py | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/scripts/test_list.py b/scripts/test_list.py
index c23d6d735..0bcc96869 100755
--- a/scripts/test_list.py
+++ b/scripts/test_list.py
@@ -914,8 +914,12 @@ class TestList:
         """ Return a list of tests as reported by --list-subtests """
         tests = []
         for name in self.filenames:
-            fname = re.sub(r"\.c$", ".testlist", name.split('/')[-1])
-            fname = os.path.join(self.igt_build_path, "tests", fname)
+            testlist = re.sub(r"\.c$", ".testlist", name.split('/')[-1])
+            fname = os.path.join(self.igt_build_path, "tests", testlist)
+
+            if not os.path.isfile(fname):
+                print(f"{testlist}: Testlist file not found.")
+                continue
 
             with open(fname, 'r', encoding='utf8') as handle:
                 for line in handle:
-- 
2.40.0



More information about the igt-dev mailing list