Merge topic 'ctest_update_status_only'
653529ce CTest: Allow / to be in the build name, and be consistent with the build name 39b5df2f ctest_update: Add CTEST_UPDATE_VERSION_ONLY option to only note the version
This commit is contained in:
commit
e7dda7b9b7
@ -362,6 +362,7 @@ Variables for CTest
|
|||||||
/variable/CTEST_TRIGGER_SITE
|
/variable/CTEST_TRIGGER_SITE
|
||||||
/variable/CTEST_UPDATE_COMMAND
|
/variable/CTEST_UPDATE_COMMAND
|
||||||
/variable/CTEST_UPDATE_OPTIONS
|
/variable/CTEST_UPDATE_OPTIONS
|
||||||
|
/variable/CTEST_UPDATE_VERSION_ONLY
|
||||||
/variable/CTEST_USE_LAUNCHERS
|
/variable/CTEST_USE_LAUNCHERS
|
||||||
|
|
||||||
Variables for CPack
|
Variables for CPack
|
||||||
|
@ -668,6 +668,15 @@ Configuration settings to specify the version control tool include:
|
|||||||
* :module:`CTest` module variable: ``UPDATE_TYPE`` if set,
|
* :module:`CTest` module variable: ``UPDATE_TYPE`` if set,
|
||||||
else ``CTEST_UPDATE_TYPE``
|
else ``CTEST_UPDATE_TYPE``
|
||||||
|
|
||||||
|
``UpdateVersionOnly``
|
||||||
|
Specify that you want the version control update command to only
|
||||||
|
discover the current version that is checked out, and not to update
|
||||||
|
to a different version.
|
||||||
|
|
||||||
|
* `CTest Script`_ variable: :variable:`CTEST_UPDATE_VERSION_ONLY`
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Additional configuration settings include:
|
Additional configuration settings include:
|
||||||
|
|
||||||
``NightlyStartTime``
|
``NightlyStartTime``
|
||||||
|
5
Help/variable/CTEST_UPDATE_VERSION_ONLY.rst
Normal file
5
Help/variable/CTEST_UPDATE_VERSION_ONLY.rst
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
CTEST_UPDATE_VERSION_ONLY
|
||||||
|
-------------------------
|
||||||
|
|
||||||
|
Specify the CTest ``UpdateVersionOnly`` setting
|
||||||
|
in a :manual:`ctest(1)` dashboard client script.
|
@ -37,6 +37,9 @@ ConfigureCommand: "@CMAKE_COMMAND@" "@PROJECT_SOURCE_DIR@"
|
|||||||
MakeCommand: @MAKECOMMAND@
|
MakeCommand: @MAKECOMMAND@
|
||||||
DefaultCTestConfigurationType: @DEFAULT_CTEST_CONFIGURATION_TYPE@
|
DefaultCTestConfigurationType: @DEFAULT_CTEST_CONFIGURATION_TYPE@
|
||||||
|
|
||||||
|
# version control
|
||||||
|
UpdateVersionOnly: @CTEST_UPDATE_VERSION_ONLY@
|
||||||
|
|
||||||
# CVS options
|
# CVS options
|
||||||
# Default is "-d -P -A"
|
# Default is "-d -P -A"
|
||||||
CVSCommand: @CVSCOMMAND@
|
CVSCommand: @CVSCOMMAND@
|
||||||
|
@ -1479,8 +1479,10 @@ int cmCTestSubmitHandler::ProcessHandler()
|
|||||||
//----------------------------------------------------------------------------
|
//----------------------------------------------------------------------------
|
||||||
std::string cmCTestSubmitHandler::GetSubmitResultsPrefix()
|
std::string cmCTestSubmitHandler::GetSubmitResultsPrefix()
|
||||||
{
|
{
|
||||||
|
std::string buildname = cmCTest::SafeBuildIdField(
|
||||||
|
this->CTest->GetCTestConfiguration("BuildName"));
|
||||||
std::string name = this->CTest->GetCTestConfiguration("Site") +
|
std::string name = this->CTest->GetCTestConfiguration("Site") +
|
||||||
"___" + this->CTest->GetCTestConfiguration("BuildName") +
|
"___" + buildname +
|
||||||
"___" + this->CTest->GetCurrentTag() + "-" +
|
"___" + this->CTest->GetCurrentTag() + "-" +
|
||||||
this->CTest->GetTestModelString() + "___XML___";
|
this->CTest->GetTestModelString() + "___XML___";
|
||||||
return name;
|
return name;
|
||||||
|
@ -55,6 +55,8 @@ cmCTestGenericHandler* cmCTestUpdateCommand::InitializeHandler()
|
|||||||
"GITUpdateOptions", "CTEST_GIT_UPDATE_OPTIONS");
|
"GITUpdateOptions", "CTEST_GIT_UPDATE_OPTIONS");
|
||||||
this->CTest->SetCTestConfigurationFromCMakeVariable(this->Makefile,
|
this->CTest->SetCTestConfigurationFromCMakeVariable(this->Makefile,
|
||||||
"GITUpdateCustom", "CTEST_GIT_UPDATE_CUSTOM");
|
"GITUpdateCustom", "CTEST_GIT_UPDATE_CUSTOM");
|
||||||
|
this->CTest->SetCTestConfigurationFromCMakeVariable(this->Makefile,
|
||||||
|
"UpdateVersionOnly", "CTEST_UPDATE_VERSION_ONLY");
|
||||||
this->CTest->SetCTestConfigurationFromCMakeVariable(this->Makefile,
|
this->CTest->SetCTestConfigurationFromCMakeVariable(this->Makefile,
|
||||||
"HGCommand", "CTEST_HG_COMMAND");
|
"HGCommand", "CTEST_HG_COMMAND");
|
||||||
this->CTest->SetCTestConfigurationFromCMakeVariable(this->Makefile,
|
this->CTest->SetCTestConfigurationFromCMakeVariable(this->Makefile,
|
||||||
|
@ -258,12 +258,13 @@ int cmCTestUpdateHandler::ProcessHandler()
|
|||||||
double elapsed_time_start = cmSystemTools::GetTime();
|
double elapsed_time_start = cmSystemTools::GetTime();
|
||||||
|
|
||||||
bool updated = vc->Update();
|
bool updated = vc->Update();
|
||||||
|
std::string buildname = cmCTest::SafeBuildIdField(
|
||||||
|
this->CTest->GetCTestConfiguration("BuildName"));
|
||||||
os << "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n"
|
os << "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n"
|
||||||
<< "<Update mode=\"Client\" Generator=\"ctest-"
|
<< "<Update mode=\"Client\" Generator=\"ctest-"
|
||||||
<< cmVersion::GetCMakeVersion() << "\">\n"
|
<< cmVersion::GetCMakeVersion() << "\">\n"
|
||||||
<< "\t<Site>" << this->CTest->GetCTestConfiguration("Site") << "</Site>\n"
|
<< "\t<Site>" << this->CTest->GetCTestConfiguration("Site") << "</Site>\n"
|
||||||
<< "\t<BuildName>" << this->CTest->GetCTestConfiguration("BuildName")
|
<< "\t<BuildName>" << buildname
|
||||||
<< "</BuildName>\n"
|
<< "</BuildName>\n"
|
||||||
<< "\t<BuildStamp>" << this->CTest->GetCurrentTag() << "-"
|
<< "\t<BuildStamp>" << this->CTest->GetCurrentTag() << "-"
|
||||||
<< this->CTest->GetTestModelString() << "</BuildStamp>" << std::endl;
|
<< this->CTest->GetTestModelString() << "</BuildStamp>" << std::endl;
|
||||||
|
@ -44,14 +44,15 @@ int cmCTestUploadHandler::ProcessHandler()
|
|||||||
"Cannot open Upload.xml file" << std::endl);
|
"Cannot open Upload.xml file" << std::endl);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
std::string buildname = cmCTest::SafeBuildIdField(
|
||||||
|
this->CTest->GetCTestConfiguration("BuildName"));
|
||||||
cmCTest::SetOfStrings::const_iterator it;
|
cmCTest::SetOfStrings::const_iterator it;
|
||||||
ofs << "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n"
|
ofs << "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n"
|
||||||
<< "<?xml-stylesheet type=\"text/xsl\" "
|
<< "<?xml-stylesheet type=\"text/xsl\" "
|
||||||
"href=\"Dart/Source/Server/XSL/Build.xsl "
|
"href=\"Dart/Source/Server/XSL/Build.xsl "
|
||||||
"<file:///Dart/Source/Server/XSL/Build.xsl> \"?>\n"
|
"<file:///Dart/Source/Server/XSL/Build.xsl> \"?>\n"
|
||||||
<< "<Site BuildName=\""
|
<< "<Site BuildName=\""
|
||||||
<< this->CTest->GetCTestConfiguration("BuildName")
|
<< buildname
|
||||||
<< "\" BuildStamp=\""
|
<< "\" BuildStamp=\""
|
||||||
<< this->CTest->GetCurrentTag() << "-"
|
<< this->CTest->GetCurrentTag() << "-"
|
||||||
<< this->CTest->GetTestModelString() << "\" Name=\""
|
<< this->CTest->GetTestModelString() << "\" Name=\""
|
||||||
|
@ -166,10 +166,17 @@ void cmCTestVC::CleanupImpl()
|
|||||||
//----------------------------------------------------------------------------
|
//----------------------------------------------------------------------------
|
||||||
bool cmCTestVC::Update()
|
bool cmCTestVC::Update()
|
||||||
{
|
{
|
||||||
this->NoteOldRevision();
|
bool result = true;
|
||||||
this->Log << "--- Begin Update ---\n";
|
// if update version only is on then do not actually update,
|
||||||
bool result = this->UpdateImpl();
|
// just note the current version and finish
|
||||||
this->Log << "--- End Update ---\n";
|
if(!cmSystemTools::IsOn(
|
||||||
|
this->CTest->GetCTestConfiguration("UpdateVersionOnly").c_str()))
|
||||||
|
{
|
||||||
|
this->NoteOldRevision();
|
||||||
|
this->Log << "--- Begin Update ---\n";
|
||||||
|
result = this->UpdateImpl();
|
||||||
|
this->Log << "--- End Update ---\n";
|
||||||
|
}
|
||||||
this->NoteNewRevision();
|
this->NoteNewRevision();
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
@ -488,9 +488,11 @@ int cmCTest::Initialize(const char* binary_dir, cmCTestStartCommand* command)
|
|||||||
{
|
{
|
||||||
cmCTestLog(this, DEBUG, "Here: " << __LINE__ << std::endl);
|
cmCTestLog(this, DEBUG, "Here: " << __LINE__ << std::endl);
|
||||||
cmCTestLog(this, OUTPUT,
|
cmCTestLog(this, OUTPUT,
|
||||||
" Site: " << this->GetCTestConfiguration("Site") << std::endl
|
" Site: " << this->GetCTestConfiguration("Site") << std::endl
|
||||||
<< " Build name: " << this->GetCTestConfiguration("BuildName")
|
<< " Build name: "
|
||||||
<< std::endl);
|
<< cmCTest::SafeBuildIdField(
|
||||||
|
this->GetCTestConfiguration("BuildName"))
|
||||||
|
<< std::endl);
|
||||||
cmCTestLog(this, DEBUG, "Produce XML is on" << std::endl);
|
cmCTestLog(this, DEBUG, "Produce XML is on" << std::endl);
|
||||||
if ( this->TestModel == cmCTest::NIGHTLY &&
|
if ( this->TestModel == cmCTest::NIGHTLY &&
|
||||||
this->GetCTestConfiguration("NightlyStartTime").empty() )
|
this->GetCTestConfiguration("NightlyStartTime").empty() )
|
||||||
@ -1441,7 +1443,7 @@ std::string cmCTest::SafeBuildIdField(const std::string& value)
|
|||||||
// Disallow non-filename and non-space whitespace characters.
|
// Disallow non-filename and non-space whitespace characters.
|
||||||
// If they occur, replace them with ""
|
// If they occur, replace them with ""
|
||||||
//
|
//
|
||||||
const char *disallowed = "\\/:*?\"<>|\n\r\t\f\v";
|
const char *disallowed = "\\:*?\"<>|\n\r\t\f\v";
|
||||||
|
|
||||||
if (safevalue.find_first_of(disallowed) != value.npos)
|
if (safevalue.find_first_of(disallowed) != value.npos)
|
||||||
{
|
{
|
||||||
@ -1582,12 +1584,14 @@ void cmCTest::EndXML(std::ostream& ostr)
|
|||||||
int cmCTest::GenerateCTestNotesOutput(std::ostream& os,
|
int cmCTest::GenerateCTestNotesOutput(std::ostream& os,
|
||||||
const cmCTest::VectorOfStrings& files)
|
const cmCTest::VectorOfStrings& files)
|
||||||
{
|
{
|
||||||
|
std::string buildname = cmCTest::SafeBuildIdField(
|
||||||
|
this->GetCTestConfiguration("BuildName"));
|
||||||
cmCTest::VectorOfStrings::const_iterator it;
|
cmCTest::VectorOfStrings::const_iterator it;
|
||||||
os << "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n"
|
os << "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n"
|
||||||
<< "<?xml-stylesheet type=\"text/xsl\" "
|
<< "<?xml-stylesheet type=\"text/xsl\" "
|
||||||
"href=\"Dart/Source/Server/XSL/Build.xsl "
|
"href=\"Dart/Source/Server/XSL/Build.xsl "
|
||||||
"<file:///Dart/Source/Server/XSL/Build.xsl> \"?>\n"
|
"<file:///Dart/Source/Server/XSL/Build.xsl> \"?>\n"
|
||||||
<< "<Site BuildName=\"" << this->GetCTestConfiguration("BuildName")
|
<< "<Site BuildName=\"" << buildname
|
||||||
<< "\" BuildStamp=\""
|
<< "\" BuildStamp=\""
|
||||||
<< this->CurrentTag << "-" << this->GetTestModelString() << "\" Name=\""
|
<< this->CurrentTag << "-" << this->GetTestModelString() << "\" Name=\""
|
||||||
<< this->GetCTestConfiguration("Site") << "\" Generator=\"ctest"
|
<< this->GetCTestConfiguration("Site") << "\" Generator=\"ctest"
|
||||||
|
@ -218,6 +218,36 @@ function(run_dashboard_command_line bin_dir)
|
|||||||
)
|
)
|
||||||
endfunction()
|
endfunction()
|
||||||
|
|
||||||
|
#-----------------------------------------------------------------------------
|
||||||
|
# Function to find the Update.xml file and make sure
|
||||||
|
# it only has the Revision in it and no updates
|
||||||
|
function(check_no_update bin_dir)
|
||||||
|
set(PATTERN ${TOP}/${bin_dir}/Testing/*/Update.xml)
|
||||||
|
file(GLOB UPDATE_XML_FILE RELATIVE ${TOP} ${PATTERN})
|
||||||
|
string(REGEX REPLACE "//Update.xml$" "/Update.xml"
|
||||||
|
UPDATE_XML_FILE "${UPDATE_XML_FILE}")
|
||||||
|
message(" found ${UPDATE_XML_FILE}")
|
||||||
|
set(rev_regex "Revision|PriorRevision")
|
||||||
|
file(STRINGS ${TOP}/${UPDATE_XML_FILE} UPDATE_XML_REVISIONS
|
||||||
|
REGEX "^\t<(${rev_regex})>[^<\n]+</(${rev_regex})>$"
|
||||||
|
)
|
||||||
|
set(found_revisons FALSE)
|
||||||
|
foreach(r IN LISTS UPDATE_XML_REVISIONS)
|
||||||
|
if("${r}" MATCHES "PriorRevision")
|
||||||
|
message(FATAL_ERROR "Found PriorRevision in no update test")
|
||||||
|
endif()
|
||||||
|
if("${r}" MATCHES "<Revision>")
|
||||||
|
set(found_revisons TRUE)
|
||||||
|
endif()
|
||||||
|
endforeach()
|
||||||
|
if(found_revisons)
|
||||||
|
message(" found <Revision> in no update test")
|
||||||
|
else()
|
||||||
|
message(FATAL_ERROR " missing <Revision> in no update test")
|
||||||
|
endif()
|
||||||
|
endfunction()
|
||||||
|
|
||||||
|
|
||||||
#-----------------------------------------------------------------------------
|
#-----------------------------------------------------------------------------
|
||||||
# Function to run the dashboard through a script
|
# Function to run the dashboard through a script
|
||||||
function(run_dashboard_script bin_dir)
|
function(run_dashboard_script bin_dir)
|
||||||
@ -228,13 +258,17 @@ function(run_dashboard_script bin_dir)
|
|||||||
|
|
||||||
# Verify the updates reported by CTest.
|
# Verify the updates reported by CTest.
|
||||||
list(APPEND UPDATE_MAYBE Updated{subdir} Updated{CTestConfig.cmake})
|
list(APPEND UPDATE_MAYBE Updated{subdir} Updated{CTestConfig.cmake})
|
||||||
check_updates(${bin_dir}
|
if(NO_UPDATE)
|
||||||
Updated{foo.txt}
|
check_no_update(${bin_dir})
|
||||||
Updated{bar.txt}
|
else()
|
||||||
Updated{zot.txt}
|
check_updates(${bin_dir}
|
||||||
Updated{subdir/foo.txt}
|
Updated{foo.txt}
|
||||||
Updated{subdir/bar.txt}
|
Updated{bar.txt}
|
||||||
)
|
Updated{zot.txt}
|
||||||
|
Updated{subdir/foo.txt}
|
||||||
|
Updated{subdir/bar.txt}
|
||||||
|
)
|
||||||
|
endif()
|
||||||
endfunction()
|
endfunction()
|
||||||
|
|
||||||
#-----------------------------------------------------------------------------
|
#-----------------------------------------------------------------------------
|
||||||
|
@ -317,3 +317,20 @@ set(CTEST_GIT_UPDATE_CUSTOM \${CTEST_GIT_COMMAND} pull origin master)
|
|||||||
|
|
||||||
# Run the dashboard script with CTest.
|
# Run the dashboard script with CTest.
|
||||||
run_dashboard_script(dash-binary-custom)
|
run_dashboard_script(dash-binary-custom)
|
||||||
|
|
||||||
|
|
||||||
|
rewind_source(dash-source)
|
||||||
|
|
||||||
|
#-----------------------------------------------------------------------------
|
||||||
|
# Test no update with a dashboard script.
|
||||||
|
message("Running CTest Dashboard Script (No update)...")
|
||||||
|
|
||||||
|
create_dashboard_script(dash-binary-no-update
|
||||||
|
"# git command configuration
|
||||||
|
set(CTEST_GIT_COMMAND \"${GIT}\")
|
||||||
|
set(CTEST_UPDATE_VERSION_ONLY TRUE)
|
||||||
|
")
|
||||||
|
|
||||||
|
# Run the dashboard script with CTest.
|
||||||
|
set(NO_UPDATE 1)
|
||||||
|
run_dashboard_script(dash-binary-no-update)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user