summaryrefslogtreecommitdiffstats
path: root/llvm/cmake/modules/AddLLVM.cmake
diff options
context:
space:
mode:
authorChris Bieneman <beanz@apple.com>2015-03-18 21:19:06 +0000
committerChris Bieneman <beanz@apple.com>2015-03-18 21:19:06 +0000
commit86ee151570e7156de4ff94e9854ba4ece7ce467c (patch)
tree63c92791cf03e9c0eb96ab753a08d4e08f61db9b /llvm/cmake/modules/AddLLVM.cmake
parent050f590a0c8895211687a6b750eec159f226a246 (diff)
downloadbcm5719-llvm-86ee151570e7156de4ff94e9854ba4ece7ce467c.tar.gz
bcm5719-llvm-86ee151570e7156de4ff94e9854ba4ece7ce467c.zip
Generate targets for each lit suite.
Summary: 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. Reviewers: chandlerc Subscribers: aemerson, llvm-commits Differential Revision: http://reviews.llvm.org/D8380 llvm-svn: 232671
Diffstat (limited to 'llvm/cmake/modules/AddLLVM.cmake')
-rw-r--r--llvm/cmake/modules/AddLLVM.cmake23
1 files changed, 23 insertions, 0 deletions
diff --git a/llvm/cmake/modules/AddLLVM.cmake b/llvm/cmake/modules/AddLLVM.cmake
index 83897935e27..165b8c7cbe3 100644
--- a/llvm/cmake/modules/AddLLVM.cmake
+++ b/llvm/cmake/modules/AddLLVM.cmake
@@ -786,3 +786,26 @@ function(add_lit_testsuite target comment)
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()
OpenPOWER on IntegriCloud