[cfe-dev] r174698 - CMake: Include Clang unit tests in check-clang target in standalone builds.

Jordan Rose jordan_rose at apple.com
Thu Feb 7 23:42:04 PST 2013


Pinging the list because of this: 

> If you picked up my earlier commit, YOU WILL HAVE TO MANUALLY SET THIS OPTION BACK ON. My apologies!

If you have a CMake build that picked up r174691-7 (in the last 5 hours), the previous commit will have disabled running the Clang unit tests. This commit restores the default behavior to be "run the Clang unit tests if you're running the LLVM unit tests", but the way CMake works is that once an option is present at generation time once, it sticks.

To fix this, re-run your CMake configuration with the CLANG_INCLUDE_TESTS option set to "ON". Purging the CLANG_INCLUDE_TESTS from the CMakeCache.txt file and re-running CMake will also 

This also applies to anyone with a CMake-based buildbot. The only ones I know of are Takumi's (and I'm pinging David in case we have some I don't know about), but if there are internal Google ones this commit will probably have borked them up too.

Very sorry for the inconvenience, and I hope this won't happen again, but on the plus side, those of us with standalone builds can now run the unit tests with "check-clang" as well.

Jordan


On Feb 7, 2013, at 23:28 , Jordan Rose <jordan_rose at apple.com> wrote:

> Author: jrose
> Date: Fri Feb  8 01:28:25 2013
> New Revision: 174698
> 
> URL: http://llvm.org/viewvc/llvm-project?rev=174698&view=rev
> Log:
> CMake: Include Clang unit tests in check-clang target in standalone builds.
> 
> Also, remove CLANG_BUILD_TESTS option. It won't have consistent behavior
> between standalone and non-standalone builds, so I'm not going to bother
> hooking it up for standalone builds. LLVM_BUILD_TESTS will continue to
> control unit test inclusion in the "all" target in non-standalone builds.
> 
> Finally, fix the default value of CLANG_INCLUDE_TESTS, which was being set
> to the boolean value of "LLVM_INCLUDE_TESTS", i.e. OFF, rather than actually
> reading the variable ${LLVM_INCLUDE_TESTS}! If you picked up my earlier
> commit, YOU WILL HAVE TO MANUALLY SET THIS OPTION BACK ON. My apologies!
> 
> Part two of r174691 (allow the unit tests to be built in standalone mode).
> 
> Modified:
>    cfe/trunk/CMakeLists.txt
>    cfe/trunk/test/CMakeLists.txt
> 
> Modified: cfe/trunk/CMakeLists.txt
> URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/CMakeLists.txt?rev=174698&r1=174697&r2=174698&view=diff
> ==============================================================================
> --- cfe/trunk/CMakeLists.txt (original)
> +++ cfe/trunk/CMakeLists.txt Fri Feb  8 01:28:25 2013
> @@ -279,17 +279,12 @@ add_subdirectory(examples)
> # TODO: docs.
> add_subdirectory(test)
> 
> -option(CLANG_BUILD_TESTS
> -       "Build Clang unit tests. If OFF, just generate build targets." 
> -       LLVM_BUILD_TESTS)
> option(CLANG_INCLUDE_TESTS
>        "Generate build targets for the Clang unit tests."
> -       LLVM_INCLUDE_TESTS)
> +       ${LLVM_INCLUDE_TESTS})
> 
> if( CLANG_INCLUDE_TESTS )
>   add_subdirectory(unittests)
> -elseif( CLANG_BUILD_TESTS )
> -  message(FATAL_ERROR "CLANG_BUILD_TESTS requires CLANG_INCLUDE_TESTS")
> endif()
> 
> # Workaround for MSVS10 to avoid the Dialog Hell
> 
> Modified: cfe/trunk/test/CMakeLists.txt
> URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CMakeLists.txt?rev=174698&r1=174697&r2=174698&view=diff
> ==============================================================================
> --- cfe/trunk/test/CMakeLists.txt (original)
> +++ cfe/trunk/test/CMakeLists.txt Fri Feb  8 01:28:25 2013
> @@ -26,24 +26,27 @@ if(CLANG_TEST_USE_VG)
>   set(CLANG_TEST_EXTRA_ARGS ${CLANG_TEST_EXTRA_ARGS} "--vg")
> endif ()
> 
> -if( NOT CLANG_BUILT_STANDALONE )
> +set(CLANG_TEST_DEPS
> +  clang clang-headers
> +  c-index-test diagtool arcmt-test c-arcmt-test
> +  clang-check
> +  )
> +set(CLANG_TEST_PARAMS
> +  clang_site_config=${CMAKE_CURRENT_BINARY_DIR}/lit.site.cfg
> +  )
> +
> +if(CLANG_INCLUDE_TESTS)  
> +  list(APPEND CLANG_TEST_DEPS ClangUnitTests)
> +  list(APPEND CLANG_TEST_PARAMS
> +    clang_unit_site_config=${CMAKE_CURRENT_BINARY_DIR}/Unit/lit.site.cfg
> +    )
> +endif()
> 
> -  set(CLANG_TEST_DEPS
> -    clang clang-headers
> -    c-index-test diagtool arcmt-test c-arcmt-test
> -    clang-check
> +if( NOT CLANG_BUILT_STANDALONE )
> +  list(APPEND CLANG_TEST_DEPS
>     llc opt FileCheck count not
>     )
> -  set(CLANG_TEST_PARAMS
> -    clang_site_config=${CMAKE_CURRENT_BINARY_DIR}/lit.site.cfg
> -    )
> 
> -  if(LLVM_INCLUDE_TESTS)
> -    list(APPEND CLANG_TEST_DEPS ClangUnitTests)
> -    list(APPEND CLANG_TEST_PARAMS
> -      clang_unit_site_config=${CMAKE_CURRENT_BINARY_DIR}/Unit/lit.site.cfg
> -      )
> -  endif()
>   add_lit_testsuite(check-clang "Running the Clang regression tests"
>     ${CMAKE_CURRENT_BINARY_DIR}
>     PARAMS ${CLANG_TEST_PARAMS}
> @@ -68,18 +71,21 @@ else()
> 
>     set(LIT_ARGS "${CLANG_TEST_EXTRA_ARGS} ${LLVM_LIT_ARGS}")
>     separate_arguments(LIT_ARGS)
> +    
> +    list(APPEND CLANG_TEST_PARAMS build_mode=${CMAKE_CFG_INTDIR})
> +
> +    foreach(param ${CLANG_TEST_PARAMS})
> +      list(APPEND LIT_ARGS --param ${param})
> +    endforeach()
> 
>     add_custom_target(check-clang
>       COMMAND ${PYTHON_EXECUTABLE}
>               ${LIT}
> -              --param clang_site_config=${CMAKE_CURRENT_BINARY_DIR}/lit.site.cfg
> -              --param build_mode=${CMAKE_CFG_INTDIR}
>               ${LIT_ARGS}
>               ${CMAKE_CURRENT_BINARY_DIR}
> +              ${CLANG_TEST_EXTRA_ARGS}
>       COMMENT "Running Clang regression tests"
> -      DEPENDS clang clang-headers
> -              c-index-test diagtool arcmt-test c-arcmt-test
> -              clang-check
> +      DEPENDS ${CLANG_TEST_DEPS}
>       )
>     set_target_properties(check-clang PROPERTIES FOLDER "Clang tests")
>   endif()
> 
> 
> _______________________________________________
> cfe-commits mailing list
> cfe-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20130207/cab545fe/attachment.html>


More information about the cfe-dev mailing list