[PATCH] Generate targets for each lit suite.
Chris Bieneman
beanz at apple.com
Tue Mar 17 09:41:59 PDT 2015
Hi chandlerc,
This change makes CMake scan for lit suites and generate a target for each lit test suite. The targets follow the format check-<project>-<suite path>.
For example:
check-llvm-unit - Runs the LLVM unit tests
check-llvm-codegen-arm - Runs the ARM codeine tests
Note: These targets are not generated during multi-configuration generators (i.e. Xcode and Visual Studio) because target clutter impacts UI usability.
http://reviews.llvm.org/D8380
Files:
CMakeLists.txt
cmake/modules/AddLLVM.cmake
Index: CMakeLists.txt
===================================================================
--- CMakeLists.txt
+++ CMakeLists.txt
@@ -641,6 +641,11 @@
DEPENDS ${LLVM_LIT_DEPENDS}
ARGS ${LLVM_LIT_EXTRA_ARGS}
)
+
+ add_lit_testsuites(LLVM ${CMAKE_SOURCE_DIR}/test
+ PARAMS ${LLVM_LIT_PARAMS}
+ DEPENDS ${LLVM_LIT_DEPENDS}
+ ARGS ${LLVM_LIT_EXTRA_ARGS})
endif()
if (LLVM_INCLUDE_DOCS)
Index: cmake/modules/AddLLVM.cmake
===================================================================
--- cmake/modules/AddLLVM.cmake
+++ cmake/modules/AddLLVM.cmake
@@ -780,3 +780,26 @@
ARGS ${ARG_ARGS}
)
endfunction()
+
+function(add_lit_testsuites project directory)
+ if (NOT CMAKE_CONFIGURATION_TYPES)
+ parse_arguments(ARG "PARAMS;DEPENDS;ARGS" "" ${ARGN})
+ file(GLOB_RECURSE litCfg ${directory}/lit*.cfg)
+ foreach(f ${litCfg})
+ get_filename_component(dir ${f} DIRECTORY)
+ string(REPLACE ${directory} "" name_slash ${dir})
+ if (name_slash)
+ string(REPLACE "/" "-" name_slash ${name_slash})
+ string(REPLACE "\\" "-" name_dashes ${name_slash})
+ string(TOLOWER "${project}${name_dashes}" name_var)
+ set(lit_args ${ARG_ARGS} ${dir})
+ add_lit_target("check-${name_var}" "Running lit suite ${dir}"
+ ${dir}
+ PARAMS ${ARG_PARAMS}
+ DEPENDS ${ARG_DEPENDS}
+ ARGS ${lit_args}
+ )
+ endif()
+ endforeach()
+ endif()
+endfunction()
EMAIL PREFERENCES
http://reviews.llvm.org/settings/panel/emailpreferences/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D8380.22098.patch
Type: text/x-patch
Size: 1465 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20150317/0c3beac2/attachment.bin>
More information about the llvm-commits
mailing list