diff options
author | Bill Hoffman <bill.hoffman@kitware.com> | 2006-04-29 11:49:22 -0400 |
---|---|---|
committer | Bill Hoffman <bill.hoffman@kitware.com> | 2006-04-29 11:49:22 -0400 |
commit | dbcf3c792cbf9eb739a5d8fdfc97382937eb2352 (patch) | |
tree | 99acdb02024c3f651da4a8950360f549a927f6b1 | |
parent | e841dde6c3a9229d53c8d2fdf00ce5073cadf016 (diff) | |
download | cmake-dbcf3c792cbf9eb739a5d8fdfc97382937eb2352.tar.gz |
ENH: merge in changes from main tree and change version to 2.4.1-beta
-rw-r--r-- | CMakeLists.txt | 6 | ||||
-rw-r--r-- | CTestConfig.cmake | 24 | ||||
-rw-r--r-- | ChangeLog.manual | 2 | ||||
-rw-r--r-- | Modules/CTest.cmake | 23 | ||||
-rw-r--r-- | Modules/FindQt4.cmake | 14 | ||||
-rw-r--r-- | Modules/NSIS.template.in | 200 | ||||
-rw-r--r-- | Source/CTest/cmCTestBuildHandler.cxx | 21 | ||||
-rw-r--r-- | Source/CTest/cmCTestGenericHandler.cxx | 28 | ||||
-rw-r--r-- | Source/CTest/cmCTestGenericHandler.h | 3 | ||||
-rw-r--r-- | Source/CTest/cmCTestStartCommand.cxx | 32 | ||||
-rw-r--r-- | Source/CTest/cmCTestStartCommand.h | 5 | ||||
-rw-r--r-- | Source/CTest/cmCTestSubmitHandler.cxx | 6 | ||||
-rw-r--r-- | Source/cmCTest.cxx | 55 | ||||
-rw-r--r-- | Source/cmCTest.h | 5 | ||||
-rw-r--r-- | Source/cmMakefile.cxx | 4 | ||||
-rw-r--r-- | Source/cmVersion.cxx | 4 | ||||
-rw-r--r-- | Source/ctest.cxx | 5 | ||||
-rw-r--r-- | Source/kwsys/DynamicLoader.cxx | 10 | ||||
-rw-r--r-- | Source/kwsys/SystemTools.cxx | 17 | ||||
-rw-r--r-- | Templates/CTestScript.cmake.in | 33 |
20 files changed, 362 insertions, 135 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index fdb955aed3..fdc12d14d9 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -5,7 +5,7 @@ MARK_AS_ADVANCED(CMAKE_BACKWARDS_COMPATIBILITY) # The CMake version number. SET(CMake_VERSION_MAJOR 2) SET(CMake_VERSION_MINOR 4) -SET(CMake_VERSION_PATCH 0) +SET(CMake_VERSION_PATCH 1) SET(CMake_VERSION "${CMake_VERSION_MAJOR}.${CMake_VERSION_MINOR}") SET(CMake_VERSION_FULL "${CMake_VERSION}.${CMake_VERSION_PATCH}") @@ -268,3 +268,7 @@ IF(EXISTS "${CMAKE_ROOT}/Modules/CPack.cmake") INCLUDE(CPack) ENDIF(EXISTS "${CMAKE_ROOT}/Modules/CPack.cmake") +CONFIGURE_FILE("${CMAKE_CURRENT_SOURCE_DIR}/Templates/CTestScript.cmake.in" + "${CMAKE_CURRENT_BINARY_DIR}/CTestScript.cmake" + @ONLY IMMEDIATE) + diff --git a/CTestConfig.cmake b/CTestConfig.cmake index 06226a7382..2e43722c4b 100644 --- a/CTestConfig.cmake +++ b/CTestConfig.cmake @@ -1,7 +1,23 @@ SET (CTEST_PROJECT_NAME "CMake") SET (CTEST_NIGHTLY_START_TIME "21:00:00 EDT") -SET (CTEST_DROP_METHOD "http") -SET (CTEST_DROP_SITE "public.kitware.com") -SET (CTEST_DROP_LOCATION "/cgi-bin/HTTPUploadDartFile.cgi") -SET (CTEST_TRIGGER_SITE "http://${CTEST_DROP_SITE}/cgi-bin/Submit-CMake-TestingResults.cgi") + +MACRO(SET_IF_NOT_SET var val) + IF(NOT DEFINED "${var}") + SET("${var}" "${val}") + ENDIF(NOT DEFINED "${var}") +ENDMACRO(SET_IF_NOT_SET) + +SET_IF_NOT_SET(CTEST_DROP_METHOD "http") +IF(CTEST_DROP_METHOD STREQUAL "http") + SET (CTEST_DROP_SITE "public.kitware.com") + SET (CTEST_DROP_LOCATION "/cgi-bin/HTTPUploadDartFile.cgi") + SET (CTEST_TRIGGER_SITE "http://${CTEST_DROP_SITE}/cgi-bin/Submit-CMake-TestingResults.cgi") +ENDIF(CTEST_DROP_METHOD STREQUAL "http") + +IF(CTEST_DROP_METHOD STREQUAL "xmlrpc") + SET (CTEST_DROP_SITE "http://www.na-mic.org:8081") + SET (CTEST_DROP_LOCATION "CMake") + SET (CTEST_TRIGGER_SITE "not used") + SET (COMPRESS_SUBMISSION ON) +ENDIF(CTEST_DROP_METHOD STREQUAL "xmlrpc") diff --git a/ChangeLog.manual b/ChangeLog.manual index 9ed3b24441..986cdddf6c 100644 --- a/ChangeLog.manual +++ b/ChangeLog.manual @@ -1,5 +1,7 @@ Changes in CMake 2.4.1 +* Several ctest and cpack bug fixes + * Many updates and fixes for FindQt4.cmake * Fix CMAKE_REQUIRED_FLAGS in CheckCXXSourceCompiles.cmake diff --git a/Modules/CTest.cmake b/Modules/CTest.cmake index 76f256877d..7b737fa8dd 100644 --- a/Modules/CTest.cmake +++ b/Modules/CTest.cmake @@ -18,19 +18,26 @@ IF(BUILD_TESTING) ENDIF("${val}" MATCHES "^$") ENDMACRO(SET_IF_SET) + MACRO(SET_IF_SET_AND_NOT_SET var val) + IF("${val}" MATCHES "^$") + ELSE("${val}" MATCHES "^$") + SET_IF_NOT_SET("${var}" "${val}") + ENDIF("${val}" MATCHES "^$") + ENDMACRO(SET_IF_SET_AND_NOT_SET) + # Make sure testing is enabled ENABLE_TESTING() IF(EXISTS "${PROJECT_SOURCE_DIR}/CTestConfig.cmake") INCLUDE("${PROJECT_SOURCE_DIR}/CTestConfig.cmake") - SET_IF_SET(NIGHTLY_START_TIME "${CTEST_NIGHTLY_START_TIME}") - SET_IF_SET(DROP_METHOD "${CTEST_DROP_METHOD}") - SET_IF_SET(DROP_SITE "${CTEST_DROP_SITE}") - SET_IF_SET(DROP_SITE_USER "${CTEST_DROP_SITE_USER}") - SET_IF_SET(DROP_SITE_PASSWORD "${CTEST_DROP_SITE_PASWORD}") - SET_IF_SET(DROP_SITE_MODE "${CTEST_DROP_SITE_MODE}") - SET_IF_SET(DROP_LOCATION "${CTEST_DROP_LOCATION}") - SET_IF_SET(TRIGGER_SITE "${CTEST_TRIGGER_SITE}") + SET_IF_SET_AND_NOT_SET(NIGHTLY_START_TIME "${CTEST_NIGHTLY_START_TIME}") + SET_IF_SET_AND_NOT_SET(DROP_METHOD "${CTEST_DROP_METHOD}") + SET_IF_SET_AND_NOT_SET(DROP_SITE "${CTEST_DROP_SITE}") + SET_IF_SET_AND_NOT_SET(DROP_SITE_USER "${CTEST_DROP_SITE_USER}") + SET_IF_SET_AND_NOT_SET(DROP_SITE_PASSWORD "${CTEST_DROP_SITE_PASWORD}") + SET_IF_SET_AND_NOT_SET(DROP_SITE_MODE "${CTEST_DROP_SITE_MODE}") + SET_IF_SET_AND_NOT_SET(DROP_LOCATION "${CTEST_DROP_LOCATION}") + SET_IF_SET_AND_NOT_SET(TRIGGER_SITE "${CTEST_TRIGGER_SITE}") ENDIF(EXISTS "${PROJECT_SOURCE_DIR}/CTestConfig.cmake") # the project can have a DartConfig.cmake file diff --git a/Modules/FindQt4.cmake b/Modules/FindQt4.cmake index 1bab0084f3..7959bb3808 100644 --- a/Modules/FindQt4.cmake +++ b/Modules/FindQt4.cmake @@ -161,6 +161,7 @@ # QT_QT_LIBRARY Qt-Library is now split INCLUDE(CheckSymbolExists) +INCLUDE(AddFileDependencies) SET(QT_USE_FILE ${CMAKE_ROOT}/Modules/UseQt4.cmake) @@ -771,17 +772,6 @@ IF (QT4_QMAKE_FOUND) ENDMACRO (QT4_ADD_RESOURCES) - MACRO(_QT4_ADD_FILE_DEPENDENCIES _file) - GET_SOURCE_FILE_PROPERTY(_deps ${_file} OBJECT_DEPENDS) - IF (_deps) - SET(_deps ${_deps} ${ARGN}) - ELSE (_deps) - SET(_deps ${ARGN}) - ENDIF (_deps) - SET_SOURCE_FILES_PROPERTIES(${_file} PROPERTIES OBJECT_DEPENDS "${_deps}") - ENDMACRO(_QT4_ADD_FILE_DEPENDENCIES) - - MACRO(QT4_AUTOMOC) QT4_GET_MOC_INC_DIRS(_moc_INCS) @@ -819,7 +809,7 @@ IF (QT4_QMAKE_FOUND) DEPENDS ${_header} ) - _QT4_ADD_FILE_DEPENDENCIES(${_abs_FILE} ${_moc}) + ADD_FILE_DEPENDENCIES(${_abs_FILE} ${_moc}) ENDFOREACH (_current_MOC_INC) ENDIF(_match) ENDIF ( NOT _skip AND EXISTS ${_abs_FILE} ) diff --git a/Modules/NSIS.template.in b/Modules/NSIS.template.in index e93a144fbb..7d0e68ad52 100644 --- a/Modules/NSIS.template.in +++ b/Modules/NSIS.template.in @@ -82,41 +82,48 @@ FunctionEnd !include "WinMessages.NSH" !verbose 4 +;---------------------------------------- +; based upon a script of "Written by KiCHiK 2003-01-18 05:57:02" +;---------------------------------------- +!verbose 3 +!include "WinMessages.NSH" +!verbose 4 +;==================================================== +; get_NT_environment +; Returns: the selected environment +; Output : head of the stack +;==================================================== +!macro select_NT_profile UN +Function ${UN}select_NT_profile + MessageBox MB_YESNO|MB_ICONQUESTION "Change the environment for all users? $\n\ +$\n\ +Saying no here will change the envrironment for the current user only. $\n\ +$\n\ +(Administrator permissions required for all users)" \ + IDNO environment_single + DetailPrint "Selected environment for all users" + Push "all" + Return + environment_single: + DetailPrint "Selected environment for current user only." + Push "current" + Return +FunctionEnd +!macroend +!insertmacro select_NT_profile "" +!insertmacro select_NT_profile "un." +;---------------------------------------------------- +!define NT_current_env 'HKCU "Environment"' +!define NT_all_env 'HKLM "SYSTEM\CurrentControlSet\Control\Session Manager\Environment"' +;==================================================== ; AddToPath - Adds the given dir to the search path. ; Input - head of the stack ; Note - Win9x systems requires reboot - +;==================================================== Function AddToPath Exch $0 Push $1 Push $2 - Push $3 - - # don't add if the path doesn't exist - IfFileExists "$0\*.*" "" AddToPath_done - - ReadEnvStr $1 PATH - Push "$1;" - Push "$0;" - Call StrStr - Pop $2 - StrCmp $2 "" "" AddToPath_done - Push "$1;" - Push "$0\;" - Call StrStr - Pop $2 - StrCmp $2 "" "" AddToPath_done - GetFullPathName /SHORT $3 $0 - Push "$1;" - Push "$3;" - Call StrStr - Pop $2 - StrCmp $2 "" "" AddToPath_done - Push "$1;" - Push "$3\;" - Call StrStr - Pop $2 - StrCmp $2 "" "" AddToPath_done Call IsNT Pop $1 @@ -124,47 +131,71 @@ Function AddToPath ; Not on NT StrCpy $1 $WINDIR 2 FileOpen $1 "$1\autoexec.bat" a - FileSeek $1 -1 END - FileReadByte $1 $2 - IntCmp $2 26 0 +2 +2 # DOS EOF - FileSeek $1 -1 END # write over EOF - FileWrite $1 "$\r$\nSET PATH=%PATH%;$3$\r$\n" + FileSeek $1 0 END + GetFullPathName /SHORT $0 $0 + FileWrite $1 "$\r$\n\ +$\r$\n\ +SET PATH=%PATH%;$0$\r$\n\ +$\r$\n\ +" FileClose $1 - SetRebootFlag true Goto AddToPath_done AddToPath_NT: - MessageBox MB_OK 'Add to path "$0"' - ReadRegStr $1 SHCTX "Environment" "PATH" - StrCpy $2 $1 1 -1 # copy last char - StrCmp $2 ";" 0 +2 # if last char == ; - StrCpy $1 $1 -1 # remove last char + Push $4 + Call select_NT_profile + Pop $4 + + AddToPath_NT_selection_done: + StrCmp $4 "current" read_path_NT_current + ReadRegStr $1 ${NT_all_env} "PATH" + Goto read_path_NT_resume + read_path_NT_current: + ReadRegStr $1 ${NT_current_env} "PATH" + read_path_NT_resume: StrCmp $1 "" AddToPath_NTdoIt - StrCpy $0 "$1;$0" + StrCpy $2 "$0;$1" + Goto AddToPath_NTdoIt AddToPath_NTdoIt: - WriteRegExpandStr SHCTX "Environment" "PATH" $0 + StrCmp $4 "current" write_path_NT_current + ClearErrors + WriteRegExpandStr ${NT_all_env} "PATH" $2 + IfErrors 0 write_path_NT_resume + MessageBox MB_YESNO|MB_ICONQUESTION "The path could not be set for all users$\n\ +$\n\ +Should I try for the current user?" \ + IDNO write_path_NT_failed + ; change selection + StrCpy $4 "current" + Goto AddToPath_NT_selection_done + write_path_NT_current: + ClearErrors + WriteRegExpandStr ${NT_current_env} "PATH" $2 + IfErrors 0 write_path_NT_resume + MessageBox MB_OK|MB_ICONINFORMATION "The path could not be set for the current user." + Goto write_path_NT_failed + write_path_NT_resume: SendMessage ${HWND_BROADCAST} ${WM_WININICHANGE} 0 "STR:Environment" /TIMEOUT=5000 + DetailPrint "added path for user ($4), $0" + write_path_NT_failed: + Pop $4 AddToPath_done: - Pop $3 Pop $2 Pop $1 Pop $0 FunctionEnd +;==================================================== ; RemoveFromPath - Remove a given dir from the path ; Input: head of the stack - +;==================================================== Function un.RemoveFromPath Exch $0 Push $1 Push $2 Push $3 Push $4 - Push $5 - Push $6 - - IntFmt $6 "%c" 26 # DOS EOF Call un.IsNT Pop $1 @@ -176,22 +207,20 @@ Function un.RemoveFromPath FileOpen $2 $4 w GetFullPathName /SHORT $0 $0 StrCpy $0 "SET PATH=%PATH%;$0" + SetRebootFlag true Goto unRemoveFromPath_dosLoop unRemoveFromPath_dosLoop: FileRead $1 $3 - StrCpy $5 $3 1 -1 # read last char - StrCmp $5 $6 0 +2 # if DOS EOF - StrCpy $3 $3 -1 # remove DOS EOF so we can compare - StrCmp $3 "$0$\r$\n" unRemoveFromPath_dosLoopRemoveLine - StrCmp $3 "$0$\n" unRemoveFromPath_dosLoopRemoveLine - StrCmp $3 "$0" unRemoveFromPath_dosLoopRemoveLine + StrCmp $3 "$0$$\r$\n\ +$\r$\n\ +" unRemoveFromPath_dosLoop + StrCmp $3 "$0$\r$\n\ +" unRemoveFromPath_dosLoop + StrCmp $3 "$0" unRemoveFromPath_dosLoop StrCmp $3 "" unRemoveFromPath_dosLoopEnd FileWrite $2 $3 Goto unRemoveFromPath_dosLoop - unRemoveFromPath_dosLoopRemoveLine: - SetRebootFlag true - Goto unRemoveFromPath_dosLoop unRemoveFromPath_dosLoopEnd: FileClose $2 @@ -203,46 +232,57 @@ Function un.RemoveFromPath Goto unRemoveFromPath_done unRemoveFromPath_NT: - MessageBox MB_OK 'Remove from path "$0"' - ReadRegStr $1 SHCTX "Environment" "PATH" - StrCpy $5 $1 1 -1 # copy last char - StrCmp $5 ";" +2 # if last char != ; - StrCpy $1 "$1;" # append ; + StrLen $2 $0 + Call un.select_NT_profile + Pop $4 + + StrCmp $4 "current" un_read_path_NT_current + ReadRegStr $1 ${NT_all_env} "PATH" + Goto un_read_path_NT_resume + un_read_path_NT_current: + ReadRegStr $1 ${NT_current_env} "PATH" + un_read_path_NT_resume: + Push $1 - Push "$0;" - Call un.StrStr ; Find `$0;` in $1 - Pop $2 ; pos of our dir - StrCmp $2 "" unRemoveFromPath_done + Push $0 + Call un.StrStr ; Find $0 in $1 + Pop $0 ; pos of our dir + IntCmp $0 -1 unRemoveFromPath_done ; else, it is in path - # $0 - path to add - # $1 - path var - StrLen $3 "$0;" - StrLen $4 $2 - StrCpy $5 $1 -$4 # $5 is now the part before the path to remove - StrCpy $6 $2 "" $3 # $6 is now the part after the path to remove - StrCpy $3 $5$6 + StrCpy $3 $1 $0 ; $3 now has the part of the path before our dir + IntOp $2 $2 + $0 ; $2 now contains the pos after our dir in the path (';') + IntOp $2 $2 + 1 ; $2 now containts the pos after our dir and the semicolon. + StrLen $0 $1 + StrCpy $1 $1 $0 $2 + StrCpy $3 "$3$1" - StrCpy $5 $3 1 -1 # copy last char - StrCmp $5 ";" 0 +2 # if last char == ; - StrCpy $3 $3 -1 # remove last char - - WriteRegExpandStr SHCTX "Environment" "PATH" $3 + StrCmp $4 "current" un_write_path_NT_current + WriteRegExpandStr ${NT_all_env} "PATH" $3 + Goto un_write_path_NT_resume + un_write_path_NT_current: + WriteRegExpandStr ${NT_current_env} "PATH" $3 + un_write_path_NT_resume: SendMessage ${HWND_BROADCAST} ${WM_WININICHANGE} 0 "STR:Environment" /TIMEOUT=5000 - unRemoveFromPath_done: - Pop $6 - Pop $5 Pop $4 Pop $3 Pop $2 Pop $1 Pop $0 FunctionEnd +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; Uninstall sutff +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ########################################### # Utility Functions # ########################################### +;==================================================== +; IsNT - Returns 1 if the current system is NT, 0 +; otherwise. +; Output: head of the stack +;==================================================== ; IsNT ; no input ; output, top of the stack = 1 if NT or 0 if not diff --git a/Source/CTest/cmCTestBuildHandler.cxx b/Source/CTest/cmCTestBuildHandler.cxx index abd8dddb5f..3e1dff9a54 100644 --- a/Source/CTest/cmCTestBuildHandler.cxx +++ b/Source/CTest/cmCTestBuildHandler.cxx @@ -534,6 +534,8 @@ void cmCTestBuildHandler::GenerateDartBuildOutput( break; } } + if ( !cm->SourceFile.empty() && cm->LineNumber >= 0 ) + { if ( cm->SourceFile.size() > 0 ) { os << "\t\t<SourceFile>" << cm->SourceFile << "</SourceFile>" @@ -549,6 +551,7 @@ void cmCTestBuildHandler::GenerateDartBuildOutput( os << "\t\t<SourceLineNumber>" << cm->LineNumber << "</SourceLineNumber>" << std::endl; } + } os << "\t\t<PreContext>" << this->CTest->MakeXMLSafe(cm->PreContext) << "</PreContext>\n" << "\t\t<PostContext>" << this->CTest->MakeXMLSafe(cm->PostContext); @@ -891,6 +894,7 @@ int cmCTestBuildHandler::ProcessSingleLine(const char* data) if ( !this->ErrorQuotaReached ) { // Errors + int wrxCnt = 0; for ( it = this->ErrorMatchRegex.begin(); it != this->ErrorMatchRegex.end(); ++ it ) @@ -898,11 +902,15 @@ int cmCTestBuildHandler::ProcessSingleLine(const char* data) if ( it->find(data) ) { errorLine = 1; - cmCTestLog(this->CTest, DEBUG, " Error Line: " << data << std::endl); + cmCTestLog(this->CTest, DEBUG, " Error Line: " << data + << " (matches: " << this->CustomWarningMatches[wrxCnt] << ")" + << std::endl); break; } + wrxCnt ++; } // Error exceptions + wrxCnt = 0; for ( it = this->ErrorExceptionRegex.begin(); it != this->ErrorExceptionRegex.end(); ++ it ) @@ -911,14 +919,17 @@ int cmCTestBuildHandler::ProcessSingleLine(const char* data) { errorLine = 0; cmCTestLog(this->CTest, DEBUG, " Not an error Line: " << data + << " (matches: " << this->CustomErrorExceptions[wrxCnt] << ")" << std::endl); break; } + wrxCnt ++; } } if ( !this->WarningQuotaReached ) { // Warnings + int wrxCnt = 0; for ( it = this->WarningMatchRegex.begin(); it != this->WarningMatchRegex.end(); ++ it ) @@ -927,11 +938,15 @@ int cmCTestBuildHandler::ProcessSingleLine(const char* data) { warningLine = 1; cmCTestLog(this->CTest, DEBUG, - " Warning Line: " << data << std::endl); + " Warning Line: " << data + << " (matches: " << this->CustomWarningMatches[wrxCnt] << ")" + << std::endl); break; } + wrxCnt ++; } + wrxCnt = 0; // Warning exceptions for ( it = this->WarningExceptionRegex.begin(); it != this->WarningExceptionRegex.end(); @@ -941,9 +956,11 @@ int cmCTestBuildHandler::ProcessSingleLine(const char* data) { warningLine = 0; cmCTestLog(this->CTest, DEBUG, " Not a warning Line: " << data + << " (matches: " << this->CustomWarningExceptions[wrxCnt] << ")" << std::endl); break; } + wrxCnt ++; } } if ( errorLine ) diff --git a/Source/CTest/cmCTestGenericHandler.cxx b/Source/CTest/cmCTestGenericHandler.cxx index 4c398422d0..563c7b60ea 100644 --- a/Source/CTest/cmCTestGenericHandler.cxx +++ b/Source/CTest/cmCTestGenericHandler.cxx @@ -54,9 +54,37 @@ void cmCTestGenericHandler::SetOption(const char* op, const char* value) } //---------------------------------------------------------------------- +void cmCTestGenericHandler::SetPersistentOption(const char* op, const char* value) +{ + if ( !op ) + { + return; + } + if ( !value ) + { + cmCTestGenericHandler::t_StringToString::iterator remit + = this->PersistentOptions.find(op); + if ( remit != this->PersistentOptions.end() ) + { + this->PersistentOptions.erase(remit); + } + return; + } + + this->PersistentOptions[op] = value; +} + +//---------------------------------------------------------------------- void cmCTestGenericHandler::Initialize() { this->Options.clear(); + t_StringToString::iterator it; + for ( it = this->PersistentOptions.begin(); + it != this->PersistentOptions.end(); + ++ it ) + { + this->Options[it->first.c_str()] = it->second.c_str(); + } } //---------------------------------------------------------------------- diff --git a/Source/CTest/cmCTestGenericHandler.h b/Source/CTest/cmCTestGenericHandler.h index 9efa1135a1..2b84ded3a4 100644 --- a/Source/CTest/cmCTestGenericHandler.h +++ b/Source/CTest/cmCTestGenericHandler.h @@ -75,6 +75,8 @@ public: typedef std::map<cmStdString,cmStdString> t_StringToString; + + void SetPersistentOption(const char* op, const char* value); void SetOption(const char* op, const char* value); const char* GetOption(const char* op); @@ -93,6 +95,7 @@ protected: bool HandlerVerbose; cmCTest *CTest; t_StringToString Options; + t_StringToString PersistentOptions; cmCTestCommand* Command; int SubmitIndex; diff --git a/Source/CTest/cmCTestStartCommand.cxx b/Source/CTest/cmCTestStartCommand.cxx index 515cf7574d..aa77c7548c 100644 --- a/Source/CTest/cmCTestStartCommand.cxx +++ b/Source/CTest/cmCTestStartCommand.cxx @@ -29,22 +29,32 @@ bool cmCTestStartCommand::InitialPass( return false; } - const char* smodel = args[0].c_str(); + size_t cnt = 0; + const char* smodel = args[cnt].c_str(); const char* src_dir = 0; const char* bld_dir = 0; - if ( args.size() >= 2 ) + cnt++; + + this->CTest->SetSpecificTrack(0); + if ( cnt < args.size() -1 ) { - src_dir = args[1].c_str(); - if ( args.size() == 3 ) + if ( args[cnt] == "TRACK" ) { - bld_dir = args[2].c_str(); + cnt ++; + this->CTest->SetSpecificTrack(args[cnt].c_str()); + cnt ++; } } - if ( args.size() > 3 ) + + if ( cnt < args.size() ) { - this->SetError("called with incorrect number of arguments"); - return false; + src_dir = args[cnt].c_str(); + cnt ++; + if ( cnt < args.size() ) + { + bld_dir = args[cnt].c_str(); + } } if ( !src_dir ) { @@ -74,6 +84,12 @@ bool cmCTestStartCommand::InitialPass( << smodel << std::endl << " Source directory: " << src_dir << std::endl << " Build directory: " << bld_dir << std::endl); + const char* track = this->CTest->GetSpecificTrack(); + if ( track ) + { + cmCTestLog(this->CTest, HANDLER_OUTPUT, + " Track: " << track << std::endl); + } this->Makefile->AddDefinition("CTEST_RUN_CURRENT_SCRIPT", "OFF"); this->CTest->SetSuppressUpdatingCTestConfiguration(true); diff --git a/Source/CTest/cmCTestStartCommand.h b/Source/CTest/cmCTestStartCommand.h index f651bc8720..3962d039e9 100644 --- a/Source/CTest/cmCTestStartCommand.h +++ b/Source/CTest/cmCTestStartCommand.h @@ -66,11 +66,12 @@ public: virtual const char* GetFullDocumentation() { return - " CTEST_START(Model [source [binary]])\n" + " CTEST_START(Model [TRACK <track>] [source [binary]])\n" "Starts the testing for a given model. The command should be called " "after the binary directory is initialized. If the 'source' and " "'binary' directory are not specified, it reads the " - "CTEST_SOURCE_DIRECTORY and CTEST_BINARY_DIRECTORY."; + "CTEST_SOURCE_DIRECTORY and CTEST_BINARY_DIRECTORY. If the track is " + "specified, the submissions will go to the specified track."; } cmTypeMacro(cmCTestStartCommand, cmCTestCommand); diff --git a/Source/CTest/cmCTestSubmitHandler.cxx b/Source/CTest/cmCTestSubmitHandler.cxx index 8d5effae75..b20388c1cb 100644 --- a/Source/CTest/cmCTestSubmitHandler.cxx +++ b/Source/CTest/cmCTestSubmitHandler.cxx @@ -874,6 +874,12 @@ int cmCTestSubmitHandler::ProcessHandler() cmCTestLog(this->CTest, HANDLER_OUTPUT, "Submit files (using " << this->CTest->GetCTestConfiguration("DropMethod") << ")" << std::endl); + const char* specificTrack = this->CTest->GetSpecificTrack(); + if ( specificTrack ) + { + cmCTestLog(this->CTest, HANDLER_OUTPUT, " Send to track: " + << specificTrack << std::endl); + } this->SetLogFile(&ofs); if ( this->CTest->GetCTestConfiguration("DropMethod") == "" || this->CTest->GetCTestConfiguration("DropMethod") == "ftp" ) diff --git a/Source/cmCTest.cxx b/Source/cmCTest.cxx index 839ccedff7..cfba26bbd8 100644 --- a/Source/cmCTest.cxx +++ b/Source/cmCTest.cxx @@ -784,7 +784,7 @@ int cmCTest::ProcessTests() if ( this->Tests[UPDATE_TEST] || this->Tests[ALL_TEST] ) { cmCTestGenericHandler* uphandler = this->GetHandler("update"); - uphandler->SetOption("SourceDirectory", + uphandler->SetPersistentOption("SourceDirectory", this->GetCTestConfiguration("SourceDirectory").c_str()); update_count = uphandler->ProcessHandler(); if ( update_count < 0 ) @@ -887,6 +887,10 @@ int cmCTest::ProcessTests() //---------------------------------------------------------------------- std::string cmCTest::GetTestModelString() { + if ( !this->SpecificTrack.empty() ) + { + return this->SpecificTrack; + } switch ( this->TestModel ) { case cmCTest::NIGHTLY: @@ -1337,6 +1341,11 @@ int cmCTest::Run(std::vector<std::string>const& args, std::string* output) this->Debug = true; this->ShowLineNumbers = true; } + if(this->CheckArgument(arg, "--track") && i < args.size() - 1) + { + i++; + this->SpecificTrack = args[i]; + } if(this->CheckArgument(arg, "--show-line-numbers")) { this->ShowLineNumbers = true; @@ -1690,22 +1699,22 @@ int cmCTest::Run(std::vector<std::string>const& args, std::string* output) i < args.size() - 1) { i++; - this->GetHandler("test")->SetOption("TestsToRunInformation", + this->GetHandler("test")->SetPersistentOption("TestsToRunInformation", args[i].c_str()); - this->GetHandler("memcheck")->SetOption("TestsToRunInformation", + this->GetHandler("memcheck")->SetPersistentOption("TestsToRunInformation", args[i].c_str()); } if(this->CheckArgument(arg, "-U", "--union")) { - this->GetHandler("test")->SetOption("UseUnion", "true"); - this->GetHandler("memcheck")->SetOption("UseUnion", "true"); + this->GetHandler("test")->SetPersistentOption("UseUnion", "true"); + this->GetHandler("memcheck")->SetPersistentOption("UseUnion", "true"); } if(this->CheckArgument(arg, "-R", "--tests-regex") && i < args.size() - 1) { i++; - this->GetHandler("test")->SetOption("IncludeRegularExpression", + this->GetHandler("test")->SetPersistentOption("IncludeRegularExpression", args[i].c_str()); - this->GetHandler("memcheck")->SetOption("IncludeRegularExpression", + this->GetHandler("memcheck")->SetPersistentOption("IncludeRegularExpression", args[i].c_str()); } @@ -1713,9 +1722,9 @@ int cmCTest::Run(std::vector<std::string>const& args, std::string* output) i < args.size() - 1) { i++; - this->GetHandler("test")->SetOption("ExcludeRegularExpression", + this->GetHandler("test")->SetPersistentOption("ExcludeRegularExpression", args[i].c_str()); - this->GetHandler("memcheck")->SetOption("ExcludeRegularExpression", + this->GetHandler("memcheck")->SetPersistentOption("ExcludeRegularExpression", args[i].c_str()); } @@ -1930,6 +1939,9 @@ int cmCTest::ReadCustomConfigurationFileTree(const char* dir, cmMakefile* mf, { cmCTestLog(this, DEBUG, "* Read custom CTest configuration file: " << fname.c_str() << std::endl); + bool erroroc = cmSystemTools::GetErrorOccuredFlag(); + cmSystemTools::ResetErrorOccuredFlag(); + if ( !mf->ReadListFile(0, fname.c_str()) || cmSystemTools::GetErrorOccuredFlag() ) { @@ -1938,6 +1950,10 @@ int cmCTest::ReadCustomConfigurationFileTree(const char* dir, cmMakefile* mf, << fname.c_str() << std::endl); } found = true; + if ( erroroc ) + { + cmSystemTools::SetErrorOccured(); + } } if ( !fast ) @@ -2151,6 +2167,27 @@ bool cmCTest::GetProduceXML() } //---------------------------------------------------------------------- +const char* cmCTest::GetSpecificTrack() +{ + if ( this->SpecificTrack.empty() ) + { + return 0; + } + return this->SpecificTrack.c_str(); +} + +//---------------------------------------------------------------------- +void cmCTest::SetSpecificTrack(const char* track) +{ + if ( !track ) + { + this->SpecificTrack = ""; + return; + } + this->SpecificTrack = track; +} + +//---------------------------------------------------------------------- void cmCTest::AddSubmitFile(const char* name) { this->SubmitFiles.insert(name); diff --git a/Source/cmCTest.h b/Source/cmCTest.h index b73f8cea2e..14bdfcc1a6 100644 --- a/Source/cmCTest.h +++ b/Source/cmCTest.h @@ -297,6 +297,10 @@ public: std::vector<cmStdString> &GetInitialCommandLineArguments() { return this->InitialCommandLineArguments; }; + //! Set the track to submit to + void SetSpecificTrack(const char* track); + const char* GetSpecificTrack(); + private: std::string ConfigType; bool Verbose; @@ -342,6 +346,7 @@ private: bool TomorrowTag; int TestModel; + std::string SpecificTrack; double TimeOut; diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx index 5140b74d60..2742206a27 100644 --- a/Source/cmMakefile.cxx +++ b/Source/cmMakefile.cxx @@ -91,8 +91,8 @@ const char* cmMakefile::GetReleaseVersion() #if CMake_VERSION_MINOR & 1 return "development"; #else -# if CMake_VERSION_PATCH == 0 - return "beta"; +# if CMake_VERSION_PATCH == 1 + return "1-beta"; # else return "patch " CMAKE_TO_STRING(CMake_VERSION_PATCH); # endif diff --git a/Source/cmVersion.cxx b/Source/cmVersion.cxx index 8d35b75b05..bc0421b611 100644 --- a/Source/cmVersion.cxx +++ b/Source/cmVersion.cxx @@ -56,8 +56,8 @@ std::string cmVersion::GetReleaseVersion() } return res; #else -# if CMake_VERSION_PATCH == 0 - return "beta"; +# if CMake_VERSION_PATCH == 1 + return "1-beta"; # else return "patch " CMAKE_TO_STRING(CMake_VERSION_PATCH); # endif diff --git a/Source/ctest.cxx b/Source/ctest.cxx index ce6235d995..d55597fea7 100644 --- a/Source/ctest.cxx +++ b/Source/ctest.cxx @@ -97,6 +97,11 @@ static const cmDocumentationEntry cmDocumentationOptions[] = "This option tells ctest to act as a Dart client " "and perform some action such as start, build, test etc. " "Combining -M and -T is similar to -D"}, + {"--track <track>", "Specify the track to submit dashboard to", + "Submit dashboard to specified track instead of default one. By " + "default, the dashboard is submitted to Nightly, Experimental, or " + "Continuous track, but by specifying this option, the track can be " + "arbitrary."}, {"-S <script>, --script <script>", "Execute a dashboard for a " "configuration", "This option tells ctest to load in a configuration script which sets " diff --git a/Source/kwsys/DynamicLoader.cxx b/Source/kwsys/DynamicLoader.cxx index 486d5b3c9c..a044dff54c 100644 --- a/Source/kwsys/DynamicLoader.cxx +++ b/Source/kwsys/DynamicLoader.cxx @@ -359,10 +359,14 @@ int DynamicLoader::CloseLibrary(DynamicLoader::LibraryHandle lib) DynamicLoader::SymbolPointer DynamicLoader::GetSymbolAddress( DynamicLoader::LibraryHandle lib, const char* sym) { - void* result = dlsym(lib, sym); - // Hack to cast pointer-to-data to pointer-to-function. - return *reinterpret_cast<DynamicLoader::SymbolPointer*>(&result); + union + { + void* pvoid; + DynamicLoader::SymbolPointer psym; + } result; + result.pvoid = dlsym(lib, sym); + return result.psym; } //---------------------------------------------------------------------------- diff --git a/Source/kwsys/SystemTools.cxx b/Source/kwsys/SystemTools.cxx index e70d3fc58b..89ccd6d7be 100644 --- a/Source/kwsys/SystemTools.cxx +++ b/Source/kwsys/SystemTools.cxx @@ -118,7 +118,13 @@ inline int Rmdir(const char* dir) } inline const char* Getcwd(char* buf, unsigned int len) { - return _getcwd(buf, len); + const char* ret = _getcwd(buf, len); + if(!ret) + { + fprintf(stderr, "No current working directory.\n"); + abort(); + } + return ret; } inline int Chdir(const char* dir) { @@ -152,8 +158,15 @@ inline int Rmdir(const char* dir) } inline const char* Getcwd(char* buf, unsigned int len) { - return getcwd(buf, len); + const char* ret = getcwd(buf, len); + if(!ret) + { + fprintf(stderr, "No current working directory\n"); + abort(); + } + return ret; } + inline int Chdir(const char* dir) { return chdir(dir); diff --git a/Templates/CTestScript.cmake.in b/Templates/CTestScript.cmake.in new file mode 100644 index 0000000000..63bd26f475 --- /dev/null +++ b/Templates/CTestScript.cmake.in @@ -0,0 +1,33 @@ +CMAKE_MINIMUM_REQUIRED(VERSION 2.4) + +# This is a template for the CTest script for this system + +SET(CTEST_SITE "@SITE@") +SET(CTEST_BUILD_NAME "@BUILDNAME@") + +# --- +SET(CTEST_SOURCE_DIRECTORY "@CMAKE_SOURCE_DIR@") +SET(CTEST_BINARY_DIRECTORY "@CMAKE_BINARY_DIR@") +SET(CTEST_UPDATE_COMMAND "@UPDATE_COMMAND@") +SET(CTEST_UPDATE_OPTIONS "@UPDATE_OPTIONS@") +SET(CTEST_CMAKE_GENERATOR "@CMAKE_GENERATOR@") +SET(CTEST_BUILD_CONFIGURATION "Release") +#SET(CTEST_MEMORYCHECK_COMMAND "@MEMORYCHECK_COMMAND@") +#SET(CTEST_MEMORYCHECK_SUPPRESSIONS_FILE "@MEMORYCHECK_SUPPRESSIONS_FILE@") +#SET(CTEST_MEMORYCHECK_COMMAND_OPTIONS "@MEMORYCHECK_COMMAND_OPTIONS@") +#SET(CTEST_COVERAGE_COMMAND "@COVERAGE_COMMAND@") +SET(CTEST_NOTES_FILES "${CTEST_SCRIPT_DIRECTORY}/${CTEST_SCRIPT_NAME}") + +#CTEST_EMPTY_BINARY_DIRECTORY(${CTEST_BINARY_DIRECTORY}) + +SET(CTEST_DROP_METHOD "@DROP_METHOD@") + +CTEST_START(Experimental TRACK Weekly) +CTEST_UPDATE(SOURCE "${CTEST_SOURCE_DIRECTORY}") +CTEST_CONFIGURE(BUILD "${CTEST_BINARY_DIRECTORY}") +CTEST_READ_CUSTOM_FILES("${CTEST_BINARY_DIRECTORY}") +CTEST_BUILD(BUILD "${CTEST_BINARY_DIRECTORY}") +CTEST_TEST(BUILD "${CTEST_BINARY_DIRECTORY}") +#CTEST_MEMCHECK(BUILD "${CTEST_BINARY_DIRECTORY}") +#CTEST_COVERAGE(BUILD "${CTEST_BINARY_DIRECTORY}") +CTEST_SUBMIT() |