From 90820002693fe6eaaec2e55884472c654186207e Mon Sep 17 00:00:00 2001 From: Justin Goshi Date: Tue, 17 Dec 2024 15:54:42 -1000 Subject: [PATCH] Add support for running only edg tests (#5194) --- tests/CMakeLists.txt | 1 + tests/utils/stl/test/params.py | 3 +++ tests/utils/stl/test/tests.py | 7 +++++-- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 980ddcf194..51c1dbae1f 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -34,3 +34,4 @@ get_property(STL_LIT_TEST_DIRS GLOBAL PROPERTY STL_LIT_TEST_DIRS) add_custom_target(STL-CI COMMAND ${STL_LIT_COMMAND} -Dnotags=ASAN ${STL_LIT_TEST_DIRS} USES_TERMINAL) add_custom_target(STL-ASan-CI COMMAND ${STL_LIT_COMMAND} -Dtags=ASAN ${STL_LIT_TEST_DIRS} USES_TERMINAL) +add_custom_target(test-only-edg COMMAND ${STL_LIT_COMMAND} -Dnotags=ASAN -Dtest-only-edg=True --xunit-xml-output test-results.xml ${STL_LIT_TEST_DIRS} USES_TERMINAL) diff --git a/tests/utils/stl/test/params.py b/tests/utils/stl/test/params.py index c3dd091d5d..7799733767 100644 --- a/tests/utils/stl/test/params.py +++ b/tests/utils/stl/test/params.py @@ -58,6 +58,9 @@ def beNice(prio: str) -> list[ConfigAction]: def getDefaultParameters(config, litConfig): DEFAULT_PARAMETERS = [ + Parameter(name='test-only-edg', choices=[True, False], type=bool, default=False, + help="Whether to only run edg tests (those that use the /BE flag).", + actions=lambda enabled: [AddFeature(name='test-only-edg')] if enabled else []), Parameter(name='long_tests', choices=[True, False], type=bool, default=True, help="Whether to run tests that take a long time. This can be useful when running on a slow device.", actions=lambda enabled: [AddFeature(name='long_tests')] if enabled else []), diff --git a/tests/utils/stl/test/tests.py b/tests/utils/stl/test/tests.py index 7217d49bab..4e1b99eba5 100644 --- a/tests/utils/stl/test/tests.py +++ b/tests/utils/stl/test/tests.py @@ -71,9 +71,12 @@ def configureTest(self, litConfig): return Result(UNSUPPORTED, "Test does not require any of the features specified in limit_to_features: %s" % msg) + if 'test-only-edg' in self.config.available_features and 'edg' not in self.requires: + return Result(UNSUPPORTED, 'We run only /BE tests with the test-only-edg flag') + if 'edg_drop' in self.config.available_features: - if not 'edg' in self.requires: - return Result(UNSUPPORTED, 'We only run /BE tests with the edg drop') + if 'edg' not in self.requires: + return Result(UNSUPPORTED, 'We run only /BE tests with the edg drop') _, tmpBase = self.getTempPaths() self.isenseRspPath = tmpBase + '.isense.rsp'