Skip to content

Commit

Permalink
[WPE] Skip Qt API tests if the system doesn't have a GPU available
Browse files Browse the repository at this point in the history
https://bugs.webkit.org/show_bug.cgi?id=264460

Reviewed by Philippe Normand.

Qt API tests don't work (crash) when executed on a system without GPU.
Skip this tests on such systems meanwhile the problem reported on
https://webkit.org/b/264458 is not fixed.

* Tools/glib/api_test_runner.py:
(TestRunner._has_gpu_available):
(TestRunner.run_tests):

Canonical link: https://commits.webkit.org/270441@main
  • Loading branch information
clopez committed Nov 9, 2023
1 parent 60f1940 commit c2058bf
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions Tools/glib/api_test_runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -285,6 +285,9 @@ def _run_test(self, test_program, subtests, skipped_test_cases):
sys.stderr.write("WARNING: %s doesn't seem to be a supported test program.\n" % test_program)
return {}

def _has_gpu_available(self):
return os.access("/dev/dri/card0", os.R_OK | os.W_OK) and os.access("/dev/dri/renderD128", os.R_OK | os.W_OK)

def run_tests(self):
if not self._tests:
sys.stderr.write("ERROR: tests not found in %s.\n" % (self._test_programs_base_dir()))
Expand All @@ -297,6 +300,11 @@ def run_tests(self):
# Remove skipped tests now instead of when we find them, because
# some tests might be skipped while setting up the test environment.
self._tests = [test for test in self._tests if self._should_run_test_program(test)]
# Skip Qt tests if there is no GPU <https://webkit.org/b/264458>
number_of_qt_tests = len([test for test in self._tests if self.is_qt_test(test)])
if number_of_qt_tests > 0 and not self._has_gpu_available():
sys.stderr.write("WARNING: Skipping %d Qt tests because this system doesn't have a working GPU (/dev/dri devices are not available).\n" % number_of_qt_tests)
self._tests = [test for test in self._tests if not self.is_qt_test(test)]
number_of_executed_tests = len(self._tests)

crashed_tests = {}
Expand Down

0 comments on commit c2058bf

Please sign in to comment.