BUG: Additional fix necessary for issue #8481 so that Xcode builds do not write files into the source tree. Also add a test that runs last to check for local modifications in CMake_SOURCE_DIR based on whether 'cvs -q -n up -dP' output is empty. Test fails on dashboard runs when there are local modifications. Test passes on non-dashboard runs with local modifications so that CMake developers may have mods when running the test locally.

This commit is contained in:
David Cole 2009-07-24 15:58:23 -04:00
parent 71c0e1417b
commit 5bea9620dc
4 changed files with 94 additions and 6 deletions

View File

@ -2714,11 +2714,17 @@ void cmGlobalXCodeGenerator
buildSettings->AddAttribute("MACOSX_DEPLOYMENT_TARGET", buildSettings->AddAttribute("MACOSX_DEPLOYMENT_TARGET",
this->CreateString(deploymentTarget)); this->CreateString(deploymentTarget));
} }
std::string symroot = root->GetMakefile()->GetCurrentOutputDirectory();
symroot += "/build";
buildSettings->AddAttribute("SYMROOT", this->CreateString(symroot.c_str()));
for( std::vector<cmXCodeObject*>::iterator i = configs.begin(); for( std::vector<cmXCodeObject*>::iterator i = configs.begin();
i != configs.end(); ++i) i != configs.end(); ++i)
{ {
(*i)->AddAttribute("buildSettings", buildSettings); (*i)->AddAttribute("buildSettings", buildSettings);
} }
this->RootObject->AddAttribute("buildConfigurationList", this->RootObject->AddAttribute("buildConfigurationList",
this->CreateObjectReference(configlist)); this->CreateObjectReference(configlist));

View File

@ -37,6 +37,21 @@ IF(BUILD_TESTING)
MARK_AS_ADVANCED(CTEST_TEST_CTEST) MARK_AS_ADVANCED(CTEST_TEST_CTEST)
ENDIF (CMAKE_RUN_LONG_TESTS) ENDIF (CMAKE_RUN_LONG_TESTS)
# Should tests that use CVS be run?
#
find_package(CVS)
set(do_cvs_tests 0)
if(CVS_EXECUTABLE)
set(do_cvs_tests 1)
endif()
if(do_cvs_tests AND NOT UNIX)
if("${CVS_EXECUTABLE}" MATCHES "cygwin")
set(do_cvs_tests 0)
endif()
endif()
# Should CPack tests be run? By default, yes, but... # Should CPack tests be run? By default, yes, but...
# #
# Disable packaging test on Apple 10.3 and below. PackageMaker starts # Disable packaging test on Apple 10.3 and below. PackageMaker starts
@ -947,9 +962,9 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=CVS -P ${CMake_SOURCE_DIR}/Utilities/Rel
MARK_AS_ADVANCED(BZR_EXECUTABLE) MARK_AS_ADVANCED(BZR_EXECUTABLE)
SET(CTEST_TEST_UPDATE_BZR 0) SET(CTEST_TEST_UPDATE_BZR 0)
IF(BZR_EXECUTABLE) IF(BZR_EXECUTABLE)
IF(NOT "${CVS_EXECUTABLE}" MATCHES "cygwin" OR UNIX) IF(NOT "${BZR_EXECUTABLE}" MATCHES "cygwin" OR UNIX)
SET(CTEST_TEST_UPDATE_BZR 1) SET(CTEST_TEST_UPDATE_BZR 1)
ENDIF(NOT "${CVS_EXECUTABLE}" MATCHES "cygwin" OR UNIX) ENDIF(NOT "${BZR_EXECUTABLE}" MATCHES "cygwin" OR UNIX)
ENDIF(BZR_EXECUTABLE) ENDIF(BZR_EXECUTABLE)
IF(CTEST_TEST_UPDATE_BZR) IF(CTEST_TEST_UPDATE_BZR)
# Check if xmloutput plugin is there # Check if xmloutput plugin is there
@ -979,9 +994,9 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=CVS -P ${CMake_SOURCE_DIR}/Utilities/Rel
MARK_AS_ADVANCED(GIT_EXECUTABLE) MARK_AS_ADVANCED(GIT_EXECUTABLE)
SET(CTEST_TEST_UPDATE_GIT 0) SET(CTEST_TEST_UPDATE_GIT 0)
IF(GIT_EXECUTABLE) IF(GIT_EXECUTABLE)
IF(NOT "${CVS_EXECUTABLE}" MATCHES "cygwin" OR UNIX) IF(NOT "${GIT_EXECUTABLE}" MATCHES "cygwin" OR UNIX)
SET(CTEST_TEST_UPDATE_GIT 1) SET(CTEST_TEST_UPDATE_GIT 1)
ENDIF(NOT "${CVS_EXECUTABLE}" MATCHES "cygwin" OR UNIX) ENDIF(NOT "${GIT_EXECUTABLE}" MATCHES "cygwin" OR UNIX)
ENDIF(GIT_EXECUTABLE) ENDIF(GIT_EXECUTABLE)
IF(CTEST_TEST_UPDATE_GIT) IF(CTEST_TEST_UPDATE_GIT)
SET(CTestUpdateGIT_DIR "CTest UpdateGIT") SET(CTestUpdateGIT_DIR "CTest UpdateGIT")
@ -998,9 +1013,9 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=CVS -P ${CMake_SOURCE_DIR}/Utilities/Rel
MARK_AS_ADVANCED(HG_EXECUTABLE) MARK_AS_ADVANCED(HG_EXECUTABLE)
SET(CTEST_TEST_UPDATE_HG 0) SET(CTEST_TEST_UPDATE_HG 0)
IF(HG_EXECUTABLE) IF(HG_EXECUTABLE)
IF(NOT "${CVS_EXECUTABLE}" MATCHES "cygwin" OR UNIX) IF(NOT "${HG_EXECUTABLE}" MATCHES "cygwin" OR UNIX)
SET(CTEST_TEST_UPDATE_HG 1) SET(CTEST_TEST_UPDATE_HG 1)
ENDIF(NOT "${CVS_EXECUTABLE}" MATCHES "cygwin" OR UNIX) ENDIF(NOT "${HG_EXECUTABLE}" MATCHES "cygwin" OR UNIX)
ENDIF(HG_EXECUTABLE) ENDIF(HG_EXECUTABLE)
IF(CTEST_TEST_UPDATE_HG) IF(CTEST_TEST_UPDATE_HG)
SET(CTestUpdateHG_DIR "CTest UpdateHG") SET(CTestUpdateHG_DIR "CTest UpdateHG")
@ -1236,3 +1251,9 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=CVS -P ${CMake_SOURCE_DIR}/Utilities/Rel
ENDIF(BUILD_TESTING) ENDIF(BUILD_TESTING)
SUBDIRS(CMakeTests) SUBDIRS(CMakeTests)
if(BUILD_TESTING)
if(do_cvs_tests)
add_test(IsSourceTreeUnmodified ${CMAKE_CMAKE_COMMAND} -P "IsSourceTreeUnmodified.cmake")
endif(do_cvs_tests)
endif(BUILD_TESTING)

View File

@ -25,3 +25,15 @@ SET(GetPrerequisites_PreArgs
"-DCTEST_CONFIGURATION_TYPE:STRING=\\\${CTEST_CONFIGURATION_TYPE}" "-DCTEST_CONFIGURATION_TYPE:STRING=\\\${CTEST_CONFIGURATION_TYPE}"
) )
AddCMakeTest(GetPrerequisites "${GetPrerequisites_PreArgs}") AddCMakeTest(GetPrerequisites "${GetPrerequisites_PreArgs}")
# Run CheckSourceTree as the very last test in the CMake/CTest/CPack test
# suite. It detects if any changes have been made to the CMake source tree
# by any previous configure, build or test steps.
#
if(do_cvs_tests)
set(CheckSourceTree_PreArgs
"-DCMake_SOURCE_DIR:PATH=${CMake_SOURCE_DIR}"
"-DCVS_EXECUTABLE:STRING=${CVS_EXECUTABLE}"
)
AddCMakeTest(CheckSourceTree "${CheckSourceTree_PreArgs}")
endif()

View File

@ -0,0 +1,49 @@
# Check the CMake source tree and report anything suspicious...
#
message(STATUS
"=============================================================================")
message(STATUS "CTEST_FULL_OUTPUT (Avoid ctest truncation of output)")
message(STATUS "")
message(STATUS "CMake_SOURCE_DIR='${CMake_SOURCE_DIR}'")
message(STATUS "CVS_EXECUTABLE='${CVS_EXECUTABLE}'")
message(STATUS "ENV{DASHBOARD_TEST_FROM_CTEST}='$ENV{DASHBOARD_TEST_FROM_CTEST}'")
message(STATUS "")
# Check with "cvs -q -n up -dP" if there are any local modifications to the
# CMake source tree:
#
message(STATUS
"=============================================================================")
execute_process(COMMAND ${CVS_EXECUTABLE} -q -n up -dP
WORKING_DIRECTORY ${CMake_SOURCE_DIR}
OUTPUT_VARIABLE ov
ERROR_VARIABLE ev
RESULT_VARIABLE rv)
set(modifications 0)
if(NOT ov STREQUAL "")
set(modifications 1)
endif()
message(STATUS "Results of running '${CVS_EXECUTABLE} -q -n up -dP'")
message(STATUS "rv='${rv}'")
message(STATUS "ov='${ov}'")
message(STATUS "ev='${ev}'")
message(STATUS "modifications='${modifications}'")
# Decide if the test passes or fails:
#
if("$ENV{DASHBOARD_TEST_FROM_CTEST}" STREQUAL "")
message(STATUS "non-dashboard interactive test run")
# developers are allowed to have local modifications... :-)
else()
message(STATUS "dashboard test run")
if(modifications)
message(FATAL_ERROR "test fails: source tree modifications")
endif()
endif()
message(STATUS "test passes")