An update will be applied December 9th, between 12PM and 1:00PM EST (UTC -5:00). The site may be slow during that time.

Commit 264bdac1 authored by Kyle Edwards's avatar Kyle Edwards
Browse files

CMAKE_ROLE: Fix value for ctest --build-and-test

--build-and-test builds a CMake project, so CMAKE_ROLE should be
PROJECT. Fix this and add a test case.
parent 68e20f67
......@@ -164,7 +164,7 @@ int cmCTestBuildAndTestHandler::RunCMakeAndTest(std::string* outstring)
return 1;
}
cmake cm(cmake::RoleProject, cmState::CTest);
cmake cm(cmake::RoleProject, cmState::Project);
cm.SetHomeDirectory("");
cm.SetHomeOutputDirectory("");
std::string cmakeOutString;
......
cmake_minimum_required(VERSION 3.12)
project(CMakeRoleGlobalPropertyBuildAndTest NONE)
include(CTest)
get_property(role GLOBAL PROPERTY CMAKE_ROLE)
if(NOT role STREQUAL "PROJECT")
message(SEND_ERROR "CMAKE_ROLE property is \"${role}\", should be \"PROJECT\"")
endif()
add_test(NAME RunCMakeVersion COMMAND "${CMAKE_COMMAND}" --version)
cmake_minimum_required(VERSION 3.1)
project(CTestStart@CASE_NAME@ NONE)
cmake_minimum_required(VERSION 3.12)
project(CMakeRoleGlobalProperty@CASE_NAME@ NONE)
include(CTest)
add_test(NAME RunCMakeVersion COMMAND "${CMAKE_COMMAND}" --version)
......@@ -5,3 +5,10 @@ run_cmake(Project)
run_cmake_command(Script "${CMAKE_COMMAND}" -P "${CMAKE_CURRENT_LIST_DIR}/Script.cmake")
run_cmake_command(FindPackage "${CMAKE_COMMAND}" --find-package -DNAME=DummyPackage -DCOMPILER_ID=GNU -DLANGUAGE=CXX -DMODE=EXIST "-DCMAKE_MODULE_PATH=${CMAKE_CURRENT_LIST_DIR}")
run_ctest(CTest)
run_cmake_command(BuildAndTest "${CMAKE_CTEST_COMMAND}"
--build-and-test
"${RunCMake_SOURCE_DIR}/BuildAndTest"
"${RunCMake_BINARY_DIR}/BuildAndTest-build"
--build-project CMakeRoleGlobalPropertyBuildAndTest
--build-generator "${RunCMake_GENERATOR}"
)
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment