ctest_upload: Add QUIET option

This commit is contained in:
Zack Galbreath 2015-02-18 09:15:29 -05:00 committed by Brad King
parent 0b87b2a339
commit ff1ddd2a73
9 changed files with 44 additions and 3 deletions

View File

@ -5,7 +5,10 @@ Upload files to a dashboard server.
::
ctest_upload(FILES ...)
ctest_upload(FILES ... [QUIET])
Pass a list of files to be sent along with the build results to the
dashboard server.
The QUIET option suppresses any CTest-specific non-error output
that would have been printed to the console otherwise.

View File

@ -26,6 +26,7 @@ cmCTestGenericHandler* cmCTestUploadCommand::InitializeHandler()
}
static_cast<cmCTestUploadHandler*>(handler)->SetFiles(this->Files);
handler->SetQuiet(this->Quiet);
return handler;
}
@ -38,6 +39,12 @@ bool cmCTestUploadCommand::CheckArgumentKeyword(std::string const& arg)
this->ArgumentDoing = ArgumentDoingFiles;
return true;
}
if(arg == "QUIET")
{
this->ArgumentDoing = ArgumentDoingNone;
this->Quiet = true;
return true;
}
return false;
}

View File

@ -64,8 +64,8 @@ int cmCTestUploadHandler::ProcessHandler()
for ( it = this->Files.begin(); it != this->Files.end(); it ++ )
{
cmCTestLog(this->CTest, OUTPUT,
"\tUpload file: " << *it << std::endl);
cmCTestOptionalLog(this->CTest, OUTPUT,
"\tUpload file: " << *it << std::endl, this->Quiet);
ofs << "<File filename=\"" << cmXMLSafe(*it) << "\">\n"
<< "<Content encoding=\"base64\">\n";
ofs << this->CTest->Base64EncodeFile(*it);

View File

@ -137,6 +137,7 @@ endif()
add_RunCMake_test(ctest_start)
add_RunCMake_test(ctest_submit)
add_RunCMake_test(ctest_test)
add_RunCMake_test(ctest_upload)
add_RunCMake_test(file)
add_RunCMake_test(find_library)
add_RunCMake_test(find_package)

View File

@ -0,0 +1,4 @@
cmake_minimum_required(VERSION 3.1)
project(CTestUpload@CASE_NAME@ NONE)
include(CTest)
add_test(NAME RunCMakeVersion COMMAND "${CMAKE_COMMAND}" --version)

View File

@ -0,0 +1 @@
set(CTEST_PROJECT_NAME "CTestUpload@CASE_NAME@")

View File

@ -0,0 +1,10 @@
include(RunCTest)
set(CASE_CTEST_UPLOAD_ARGS "")
function(run_ctest_upload CASE_NAME)
set(CASE_CTEST_UPLOAD_ARGS "${ARGN}")
run_ctest(${CASE_NAME})
endfunction()
run_ctest_upload(UploadQuiet QUIET)

View File

@ -0,0 +1 @@
Use Experimental tag: [0-9-]+$

View File

@ -0,0 +1,14 @@
cmake_minimum_required(VERSION 3.1)
set(CTEST_SITE "test-site")
set(CTEST_BUILD_NAME "test-build-name")
set(CTEST_SOURCE_DIRECTORY "@RunCMake_BINARY_DIR@/@CASE_NAME@")
set(CTEST_BINARY_DIRECTORY "@RunCMake_BINARY_DIR@/@CASE_NAME@-build")
set(CTEST_CMAKE_GENERATOR "@RunCMake_GENERATOR@")
set(CTEST_CMAKE_GENERATOR_PLATFORM "@RunCMake_GENERATOR_PLATFORM@")
set(CTEST_CMAKE_GENERATOR_TOOLSET "@RunCMake_GENERATOR_TOOLSET@")
set(CTEST_BUILD_CONFIGURATION "$ENV{CMAKE_CONFIG_TYPE}")
set(ctest_upload_args "@CASE_CTEST_UPLOAD_ARGS@")
ctest_start(Experimental)
ctest_upload(FILES "${CTEST_SOURCE_DIRECTORY}/CMakeLists.txt" ${ctest_upload_args})