Skip to content

Commit 96c6023

Browse files
committed
CMake: fix a bug where only_validation-only_non_executable test configuration was running all tests
A nested loop was adding arguments specific to the current iteration to a variable, where the arguments persisted into the next iteration. The issue only affected the only_validation-only_non_executable configuration, here's why. The test subsets were configured in the following order: primary, validation, all, only_validation, only_long. The first three were not adding new arguments. 'all' was adding arguments that were affecting 'only_validation'. Then 'only_long' was adding an argument of its own that was overriding the argument from 'all'.
1 parent c0eb32a commit 96c6023

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

test/CMakeLists.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -236,6 +236,10 @@ if(PYTHONINTERP_FOUND)
236236
endif()
237237

238238
foreach(test_subset ${TEST_SUBSETS})
239+
# We will add arguments specific for this subset to LIT_ARGS. Copy
240+
# the original value and restore it later.
241+
set(LIT_ARGS_COPY "${LIT_ARGS}")
242+
239243
set(want_this_combination TRUE)
240244
if(test_subset STREQUAL "only_long")
241245
# Long tests are only run in 'optimize_none' mode.
@@ -282,6 +286,7 @@ if(PYTHONINTERP_FOUND)
282286
COMMENT "Running ${test_subset} Swift tests for ${VARIANT_TRIPLE}"
283287
${cmake_3_2_USES_TERMINAL})
284288
endif()
289+
set(LIT_ARGS "${LIT_ARGS_COPY}")
285290
endforeach()
286291
endforeach()
287292
endforeach()

0 commit comments

Comments
 (0)