From 784165b2a0964c14d3654661bcc290281dc1ce66 Mon Sep 17 00:00:00 2001 From: Justin Goshi Date: Tue, 17 Dec 2024 09:50:02 -1000 Subject: [PATCH 1/4] Add support for running only edg tests --- tests/CMakeLists.txt | 1 + tests/utils/stl/test/params.py | 3 +++ tests/utils/stl/test/tests.py | 4 ++++ 3 files changed, 8 insertions(+) diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 980ddcf194b..ff097e8fee3 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(STL-only-edg-tests COMMAND ${STL_LIT_COMMAND} -Dnotags=ASAN -Dedg_only=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 c3dd091d5d5..39abd6ea7ad 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='edg_only', 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='edg_only')] 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 7217d49bab2..97e603f582f 100644 --- a/tests/utils/stl/test/tests.py +++ b/tests/utils/stl/test/tests.py @@ -71,6 +71,10 @@ def configureTest(self, litConfig): return Result(UNSUPPORTED, "Test does not require any of the features specified in limit_to_features: %s" % msg) + if 'edg_only' in self.config.available_features: + if not 'edg' in self.requires: + return Result(UNSUPPORTED, 'We only run /BE tests with the edg_only 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') From 887201c23a58196b9185e8477b773a5eacec497f Mon Sep 17 00:00:00 2001 From: Casey Carter Date: Tue, 17 Dec 2024 12:29:49 -0800 Subject: [PATCH 2/4] Casey's review comments --- tests/utils/stl/test/tests.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/tests/utils/stl/test/tests.py b/tests/utils/stl/test/tests.py index 97e603f582f..0de267fdb7d 100644 --- a/tests/utils/stl/test/tests.py +++ b/tests/utils/stl/test/tests.py @@ -71,13 +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 'edg_only' in self.config.available_features: - if not 'edg' in self.requires: - return Result(UNSUPPORTED, 'We only run /BE tests with the edg_only flag') + if 'edg_only' in self.config.available_features and 'edg' not in self.requires: + return Result(UNSUPPORTED, 'We run only /BE tests with the edg_only 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' From 1bd819e6c8cbdb382c8d44ec407f2bd826037280 Mon Sep 17 00:00:00 2001 From: Justin Goshi Date: Tue, 17 Dec 2024 10:56:18 -1000 Subject: [PATCH 3/4] Rename the target and flag for consistency --- tests/CMakeLists.txt | 2 +- tests/utils/stl/test/params.py | 4 ++-- tests/utils/stl/test/tests.py | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index ff097e8fee3..51c1dbae1f5 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -34,4 +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(STL-only-edg-tests COMMAND ${STL_LIT_COMMAND} -Dnotags=ASAN -Dedg_only=True --xunit-xml-output test-results.xml ${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 39abd6ea7ad..77997337673 100644 --- a/tests/utils/stl/test/params.py +++ b/tests/utils/stl/test/params.py @@ -58,9 +58,9 @@ def beNice(prio: str) -> list[ConfigAction]: def getDefaultParameters(config, litConfig): DEFAULT_PARAMETERS = [ - Parameter(name='edg_only', choices=[True, False], type=bool, default=False, + 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='edg_only')] if enabled else []), + 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 0de267fdb7d..00845784aaa 100644 --- a/tests/utils/stl/test/tests.py +++ b/tests/utils/stl/test/tests.py @@ -71,7 +71,7 @@ def configureTest(self, litConfig): return Result(UNSUPPORTED, "Test does not require any of the features specified in limit_to_features: %s" % msg) - if 'edg_only' in self.config.available_features and 'edg' not in self.requires: + 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 edg_only flag') if 'edg_drop' in self.config.available_features: From ffe9d1b64cea445bd5df00373af575eac72cca5e Mon Sep 17 00:00:00 2001 From: Justin Goshi Date: Tue, 17 Dec 2024 10:58:36 -1000 Subject: [PATCH 4/4] Fix the name of the flag in one more place. --- tests/utils/stl/test/tests.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/utils/stl/test/tests.py b/tests/utils/stl/test/tests.py index 00845784aaa..4e1b99eba5c 100644 --- a/tests/utils/stl/test/tests.py +++ b/tests/utils/stl/test/tests.py @@ -72,7 +72,7 @@ def configureTest(self, litConfig): 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 edg_only flag') + return Result(UNSUPPORTED, 'We run only /BE tests with the test-only-edg flag') if 'edg_drop' in self.config.available_features: if 'edg' not in self.requires: