Skip to content

Commit 03c8d0d

Browse files
committed
Review feedback
1 parent af61d5f commit 03c8d0d

File tree

2 files changed

+124
-136
lines changed

2 files changed

+124
-136
lines changed

llvm/cmake/modules/AddLLVM.cmake

Lines changed: 20 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -2192,35 +2192,20 @@ endfunction()
21922192

21932193
function(add_lit_testsuites project directory)
21942194
if (NOT LLVM_ENABLE_IDE)
2195-
cmake_parse_arguments(ARG "EXCLUDE_FROM_CHECK_ALL" "FOLDER;BINARY_DIR"
2196-
"PARAMS;DEPENDS;ARGS;EXCLUDE_DIR;INCLUDE_DIR" ${ARGN})
2195+
cmake_parse_arguments(ARG "EXCLUDE_FROM_CHECK_ALL"
2196+
"FOLDER;BINARY_DIR;EXCLUDE_DIRS;INCLUDE_DIRS"
2197+
"PARAMS;DEPENDS;ARGS"
2198+
${ARGN})
21972199

21982200
if (NOT ARG_FOLDER)
21992201
get_subproject_title(subproject_title)
22002202
set(ARG_FOLDER "${subproject_title}/Tests/LIT Testsuites")
22012203
endif()
22022204

2203-
# Create a list of excluded paths. If not empty, any directory that begins
2204-
# with one of the excluded paths will excluded, others will be included.
2205-
set(excluded_dirs "")
2206-
if (ARG_EXCLUDE_DIR)
2207-
foreach(path ${ARG_EXCLUDE_DIR})
2208-
list(APPEND excluded_dirs ${path})
2209-
endforeach()
2210-
endif()
2211-
2212-
# Create a list of included paths. If not empty, any directory that begins
2213-
# with any of the included paths will included, others will be excluded.
2214-
# If both included and excluded lists are empty, all directories will be
2215-
# included.
2216-
set(included_dirs "")
2217-
if (ARG_INCLUDE_DIR)
2218-
foreach(path ${ARG_INCLUDE_DIR})
2219-
list(APPEND included_dirs ${path})
2220-
endforeach()
2221-
endif()
2205+
separate_arguments(ARG_EXCLUDE_DIRS)
2206+
separate_arguments(ARG_INCLUDE_DIRS)
22222207

2223-
if (excluded_dirs AND included_dirs)
2208+
if (ARG_EXCLUDE_DIRS AND ARG_INCLUDE_DIRS)
22242209
message(FATAL_ERROR, "Cannot specify both include and exclude directories")
22252210
endif()
22262211

@@ -2245,28 +2230,36 @@ function(add_lit_testsuites project directory)
22452230
endif()
22462231

22472232
# Determine whether to skip this directory.
2248-
if (excluded_dirs)
2233+
#
2234+
# If the exclude list is specified, any directory that begins with one of
2235+
# the excluded paths will be excluded, others will be included.
2236+
#
2237+
# If the include list is specified, any directory that begins with one of
2238+
# the included paths will be included, others will be excluded.
2239+
#
2240+
# If neither is specified, all directories will be included.
2241+
if (ARG_EXCLUDE_DIRS)
22492242
# Include by default, unless in the exclude list.
22502243
set(is_skipped false)
2251-
foreach (excluded_dir ${excluded_dirs})
2244+
foreach (excluded_dir ${ARG_EXCLUDE_DIRS})
22522245
string(FIND "${name_slash}" "${excluded_dir}" exclude_index)
22532246
if (exclude_index EQUAL 0)
22542247
set(is_skipped true)
22552248
break()
22562249
endif()
22572250
endforeach()
2258-
elseif(included_dirs)
2251+
elseif(ARG_INCLUDE_DIRS)
22592252
# Exclude by default, unless in the include list.
22602253
set(is_skipped true)
2261-
foreach (included_dir ${included_dirs})
2254+
foreach (included_dir ${ARG_INCLUDE_DIRS})
22622255
string(FIND "${name_slash}" "${included_dir}" include_index)
22632256
if (include_index EQUAL 0)
22642257
set(is_skipped false)
22652258
break()
22662259
endif()
22672260
endforeach()
22682261
else()
2269-
# Neither include nor exclude list specified. Include
2262+
# If neither include nor exclude list is specified, include all.
22702263
set(is_skipped false)
22712264
endif()
22722265

llvm/test/CMakeLists.txt

Lines changed: 104 additions & 109 deletions
Original file line numberDiff line numberDiff line change
@@ -59,100 +59,104 @@ configure_lit_site_cfg(
5959

6060
# Set the depends list as a variable so that it can grow conditionally.
6161
# NOTE: Sync the substitutions in test/lit.cfg when adding to this list.
62+
63+
set(LLVM_TEST_DEPENDS_COMMON
64+
FileCheck
65+
count
66+
llvm-config
67+
not
68+
)
69+
6270
set(LLVM_TEST_DEPENDS
63-
BugpointPasses
64-
FileCheck
65-
LLVMWindowsDriver
66-
UnitTests
67-
bugpoint
68-
count
69-
llc
70-
lli
71-
lli-child-target
72-
llvm-addr2line
73-
llvm-ar
74-
llvm-as
75-
llvm-bcanalyzer
76-
llvm-bitcode-strip
77-
llvm-c-test
78-
llvm-cat
79-
llvm-cfi-verify
80-
llvm-cgdata
81-
llvm-config
82-
llvm-cov
83-
llvm-ctxprof-util
84-
llvm-cvtres
85-
llvm-cxxdump
86-
llvm-cxxfilt
87-
llvm-cxxmap
88-
llvm-debuginfo-analyzer
89-
llvm-debuginfod-find
90-
llvm-diff
91-
llvm-dis
92-
llvm-dlltool
93-
dsymutil
94-
llvm-dwarfdump
95-
llvm-dwarfutil
96-
llvm-dwp
97-
llvm-exegesis
98-
llvm-extract
99-
llvm-gsymutil
100-
llvm-ir2vec
101-
llvm-isel-fuzzer
102-
llvm-ifs
103-
llvm-install-name-tool
104-
llvm-jitlink
105-
llvm-lib
106-
llvm-libtool-darwin
107-
llvm-link
108-
llvm-lipo
109-
llvm-locstats
110-
llvm-lto2
111-
llvm-mc
112-
llvm-mca
113-
llvm-ml
114-
llvm-ml64
115-
llvm-modextract
116-
llvm-nm
117-
llvm-objcopy
118-
llvm-objdump
119-
llvm-opt-fuzzer
120-
llvm-opt-report
121-
llvm-offload-wrapper
122-
llvm-otool
123-
llvm-pdbutil
124-
llvm-profdata
125-
llvm-profgen
126-
llvm-ranlib
127-
llvm-rc
128-
llvm-readobj
129-
llvm-readelf
130-
llvm-reduce
131-
llvm-remarkutil
132-
llvm-rtdyld
133-
llvm-sim
134-
llvm-size
135-
llvm-split
136-
llvm-stress
137-
llvm-strings
138-
llvm-strip
139-
llvm-symbolizer
140-
llvm-tblgen
141-
llvm-readtapi
142-
llvm-tli-checker
143-
llvm-undname
144-
llvm-windres
145-
llvm-xray
146-
not
147-
obj2yaml
148-
opt
149-
sancov
150-
sanstats
151-
split-file
152-
verify-uselistorder
153-
yaml-bench
154-
yaml2obj
155-
)
71+
BugpointPasses
72+
LLVMWindowsDriver
73+
UnitTests
74+
bugpoint
75+
llc
76+
lli
77+
lli-child-target
78+
llvm-addr2line
79+
llvm-ar
80+
llvm-as
81+
llvm-bcanalyzer
82+
llvm-bitcode-strip
83+
llvm-c-test
84+
llvm-cat
85+
llvm-cfi-verify
86+
llvm-cgdata
87+
llvm-cov
88+
llvm-ctxprof-util
89+
llvm-cvtres
90+
llvm-cxxdump
91+
llvm-cxxfilt
92+
llvm-cxxmap
93+
llvm-debuginfo-analyzer
94+
llvm-debuginfod-find
95+
llvm-diff
96+
llvm-dis
97+
llvm-dlltool
98+
dsymutil
99+
llvm-dwarfdump
100+
llvm-dwarfutil
101+
llvm-dwp
102+
llvm-exegesis
103+
llvm-extract
104+
llvm-gsymutil
105+
llvm-ir2vec
106+
llvm-isel-fuzzer
107+
llvm-ifs
108+
llvm-install-name-tool
109+
llvm-jitlink
110+
llvm-lib
111+
llvm-libtool-darwin
112+
llvm-link
113+
llvm-lipo
114+
llvm-locstats
115+
llvm-lto2
116+
llvm-mc
117+
llvm-mca
118+
llvm-ml
119+
llvm-ml64
120+
llvm-modextract
121+
llvm-nm
122+
llvm-objcopy
123+
llvm-objdump
124+
llvm-opt-fuzzer
125+
llvm-opt-report
126+
llvm-offload-wrapper
127+
llvm-otool
128+
llvm-pdbutil
129+
llvm-profdata
130+
llvm-profgen
131+
llvm-ranlib
132+
llvm-rc
133+
llvm-readobj
134+
llvm-readelf
135+
llvm-reduce
136+
llvm-remarkutil
137+
llvm-rtdyld
138+
llvm-sim
139+
llvm-size
140+
llvm-split
141+
llvm-stress
142+
llvm-strings
143+
llvm-strip
144+
llvm-symbolizer
145+
llvm-tblgen
146+
llvm-readtapi
147+
llvm-tli-checker
148+
llvm-undname
149+
llvm-windres
150+
llvm-xray
151+
obj2yaml
152+
opt
153+
sancov
154+
sanstats
155+
split-file
156+
verify-uselistorder
157+
yaml-bench
158+
yaml2obj
159+
)
156160

157161
if(TARGET llvm-lto)
158162
set(LLVM_TEST_DEPENDS ${LLVM_TEST_DEPENDS} llvm-lto)
@@ -263,39 +267,30 @@ set_target_properties(check-llvm PROPERTIES FOLDER "LLVM/Tests")
263267
# them with a reduced set of dependencies below.
264268
add_lit_testsuites(LLVM ${CMAKE_CURRENT_SOURCE_DIR}
265269
${exclude_from_check_all}
270+
DEPENDS ${LLVM_TEST_DEPENDS_COMMON}
266271
DEPENDS ${LLVM_TEST_DEPENDS}
267272
FOLDER "Tests/Subdirectories"
268-
EXCLUDE_DIR TableGen
269-
EXCLUDE_DIR FileCheck
273+
EXCLUDE_DIRS "TableGen FileCheck"
270274
)
271275

272276
# Subset of dependencies for TableGen lit test.
273277
set(LLVM_TEST_TABLEGEN_DEPENDS
274-
FileCheck
275-
count
276-
llvm-config
277-
llvm-tblgen
278-
not
278+
llvm-tblgen
279279
)
280280

281281
add_lit_testsuites(LLVM ${CMAKE_CURRENT_SOURCE_DIR}
282282
${exclude_from_check_all}
283+
DEPENDS ${LLVM_TEST_DEPENDS_COMMON}
283284
DEPENDS ${LLVM_TEST_TABLEGEN_DEPENDS}
284285
FOLDER "Tests/Subdirectories"
285-
INCLUDE_DIR TableGen
286-
)
287-
288-
# Subset of dependencies for FileCheck lit test.
289-
set(LLVM_TEST_FILECHECK_DEPENDS
290-
FileCheck
291-
not
286+
INCLUDE_DIRS "TableGen"
292287
)
293288

294289
add_lit_testsuites(LLVM ${CMAKE_CURRENT_SOURCE_DIR}
295290
${exclude_from_check_all}
296-
DEPENDS ${LLVM_TEST_FILECHECK_DEPENDS}
291+
DEPENDS ${LLVM_TEST_DEPENDS_COMMON}
297292
FOLDER "Tests/Subdirectories"
298-
INCLUDE_DIR FileCheck
293+
INCLUDE_DIRS "FileCheck"
299294
)
300295

301296
# Setup an alias for 'check-all'.

0 commit comments

Comments
 (0)