Skip to content

Commit

Permalink
Add support for running only edg tests (#5194)
Browse files Browse the repository at this point in the history
  • Loading branch information
jgoshi authored Dec 18, 2024
1 parent 305346e commit 9082000
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
1 change: 1 addition & 0 deletions tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
3 changes: 3 additions & 0 deletions tests/utils/stl/test/params.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 []),
Expand Down
7 changes: 5 additions & 2 deletions tests/utils/stl/test/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down

0 comments on commit 9082000

Please sign in to comment.