Skip to content

Commit 48efcc0

Browse files
committed
Use --filter option with lit. Adress comments
1 parent ba1f9ad commit 48efcc0

File tree

1 file changed

+12
-21
lines changed

1 file changed

+12
-21
lines changed

test/CMakeLists.txt

Lines changed: 12 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -113,35 +113,25 @@ function(get_test_dependencies SDK result_var_name)
113113
set("${result_var_name}" "${deps}" PARENT_SCOPE)
114114
endfunction()
115115

116-
function (write_component_test_script test_bin_dir component_suffix component_default_value)
116+
function (write_component_test_script test_bin_dir component_name)
117117
file(
118118
WRITE
119-
${test_bin_dir}/check-swift-${component_suffix}.sh
120-
"source_test_dir=\"${SWIFT_SOURCE_DIR}/test\"
121-
bin_test_dir=\"${test_bin_dir}\"
122-
default_component=\"${component_default_value}\"
123-
124-
dirs_to_test=$(find "\${source_test_dir}" -type f -name \"*${component_suffix}*\" | grep -o \"\\(.*\\)/\")
125-
dirs_to_test+=(\${source_test_dir}/\${default_component})
126-
dirs_to_test=$(echo \${dirs_to_test} | tr ' ' '\\n' | sort -u)
127-
128-
for directory in \${dirs_to_test}
129-
do
130-
rel_path="\${directory\#\"\${source_test_dir}\"}"
131-
${PYTHON_EXECUTABLE} ${LIT} \${bin_test_dir}\${rel_path}
132-
done\n")
119+
${test_bin_dir}/check-swift-${component_name}.sh
120+
"${PYTHON_EXECUTABLE} ${LIT} \\
121+
${test_bin_dir}/ \\
122+
--filter=${component_name}\n")
133123

134124
file(
135125
INSTALL
136-
${test_bin_dir}/check-swift-${component_suffix}.sh
126+
${test_bin_dir}/check-swift-${component_name}.sh
137127
DESTINATION ${test_bin_dir}/../test
138128
FILE_PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ
139129
GROUP_EXECUTE WORLD_READ WORLD_EXECUTE
140130
)
141131

142132
file(
143133
REMOVE
144-
${test_bin_dir}/check-swift-${component_suffix}.sh
134+
${test_bin_dir}/check-swift-${component_name}.sh
145135
)
146136

147137
endfunction()
@@ -467,10 +457,11 @@ _Block_release(void) { }\n")
467457
PROPERTY FOLDER "Tests/check-swift")
468458
endforeach()
469459
endforeach()
470-
471-
write_component_test_script("${test_bin_dir}" "irgen" "IRGen" )
472-
write_component_test_script("${test_bin_dir}" "silgen" "SILGen")
473-
write_component_test_script("${test_bin_dir}" "typecheck" "Sema")
460+
if(NOT "${SDK}" STREQUAL "WINDOWS")
461+
write_component_test_script("${test_bin_dir}" "irgen")
462+
write_component_test_script("${test_bin_dir}" "silgen")
463+
write_component_test_script("${test_bin_dir}" "sema")
464+
endif()
474465
endforeach()
475466
endforeach()
476467
endforeach()

0 commit comments

Comments
 (0)