[llvm] r233009 - Re-land: Generate targets for each lit suite.
Chris Bieneman
beanz at apple.com
Mon Mar 23 13:04:00 PDT 2015
Author: cbieneman
Date: Mon Mar 23 15:04:00 2015
New Revision: 233009
URL: http://llvm.org/viewvc/llvm-project?rev=233009&view=rev
Log:
Re-land: 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.
* Also fixed a minor issue that Duncan pointed out to me I was passing the suite to lit twice
Reviewers: chandlerc
Subscribers: aemerson, llvm-commits
Differential Revision: http://reviews.llvm.org/D8380
Modified:
llvm/trunk/CMakeLists.txt
llvm/trunk/cmake/modules/AddLLVM.cmake
Modified: llvm/trunk/CMakeLists.txt
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/CMakeLists.txt?rev=233009&r1=233008&r2=233009&view=diff
==============================================================================
--- llvm/trunk/CMakeLists.txt (original)
+++ llvm/trunk/CMakeLists.txt Mon Mar 23 15:04:00 2015
@@ -631,6 +631,11 @@ if( LLVM_INCLUDE_TESTS )
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)
Modified: llvm/trunk/cmake/modules/AddLLVM.cmake
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/cmake/modules/AddLLVM.cmake?rev=233009&r1=233008&r2=233009&view=diff
==============================================================================
--- llvm/trunk/cmake/modules/AddLLVM.cmake (original)
+++ llvm/trunk/cmake/modules/AddLLVM.cmake Mon Mar 23 15:04:00 2015
@@ -786,3 +786,25 @@ function(add_lit_testsuite target commen
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)
+ add_lit_target("check-${name_var}" "Running lit suite ${dir}"
+ ${dir}
+ PARAMS ${ARG_PARAMS}
+ DEPENDS ${ARG_DEPENDS}
+ ARGS ${ARG_ARGS}
+ )
+ endif()
+ endforeach()
+ endif()
+endfunction()
More information about the llvm-commits
mailing list