diff options
author | Zack Galbreath <zack.galbreath@kitware.com> | 2015-02-18 14:15:29 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2015-02-23 15:02:00 (GMT) |
commit | ff1ddd2a73dd04e3015c2bc4ffe345f8c6ca02ee (patch) | |
tree | e17d8bfee7775b8b52b87b345b2d02897a1b38ae | |
parent | 0b87b2a33902ac000a0073a1def887599c69809d (diff) | |
download | CMake-ff1ddd2a73dd04e3015c2bc4ffe345f8c6ca02ee.zip CMake-ff1ddd2a73dd04e3015c2bc4ffe345f8c6ca02ee.tar.gz CMake-ff1ddd2a73dd04e3015c2bc4ffe345f8c6ca02ee.tar.bz2 |
ctest_upload: Add QUIET option
-rw-r--r-- | Help/command/ctest_upload.rst | 5 | ||||
-rw-r--r-- | Source/CTest/cmCTestUploadCommand.cxx | 7 | ||||
-rw-r--r-- | Source/CTest/cmCTestUploadHandler.cxx | 4 | ||||
-rw-r--r-- | Tests/RunCMake/CMakeLists.txt | 1 | ||||
-rw-r--r-- | Tests/RunCMake/ctest_upload/CMakeLists.txt.in | 4 | ||||
-rw-r--r-- | Tests/RunCMake/ctest_upload/CTestConfig.cmake.in | 1 | ||||
-rw-r--r-- | Tests/RunCMake/ctest_upload/RunCMakeTest.cmake | 10 | ||||
-rw-r--r-- | Tests/RunCMake/ctest_upload/UploadQuiet-stdout.txt | 1 | ||||
-rw-r--r-- | Tests/RunCMake/ctest_upload/test.cmake.in | 14 |
9 files changed, 44 insertions, 3 deletions
diff --git a/Help/command/ctest_upload.rst b/Help/command/ctest_upload.rst index 9156af5..fcd9fe4 100644 --- a/Help/command/ctest_upload.rst +++ b/Help/command/ctest_upload.rst @@ -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. diff --git a/Source/CTest/cmCTestUploadCommand.cxx b/Source/CTest/cmCTestUploadCommand.cxx index 5613751..f5000dd 100644 --- a/Source/CTest/cmCTestUploadCommand.cxx +++ b/Source/CTest/cmCTestUploadCommand.cxx @@ -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; } diff --git a/Source/CTest/cmCTestUploadHandler.cxx b/Source/CTest/cmCTestUploadHandler.cxx index e33c387..579190a 100644 --- a/Source/CTest/cmCTestUploadHandler.cxx +++ b/Source/CTest/cmCTestUploadHandler.cxx @@ -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); diff --git a/Tests/RunCMake/CMakeLists.txt b/Tests/RunCMake/CMakeLists.txt index 83a88ad..f654dbc 100644 --- a/Tests/RunCMake/CMakeLists.txt +++ b/Tests/RunCMake/CMakeLists.txt @@ -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) diff --git a/Tests/RunCMake/ctest_upload/CMakeLists.txt.in b/Tests/RunCMake/ctest_upload/CMakeLists.txt.in new file mode 100644 index 0000000..1fab71b --- /dev/null +++ b/Tests/RunCMake/ctest_upload/CMakeLists.txt.in @@ -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) diff --git a/Tests/RunCMake/ctest_upload/CTestConfig.cmake.in b/Tests/RunCMake/ctest_upload/CTestConfig.cmake.in new file mode 100644 index 0000000..52665a8 --- /dev/null +++ b/Tests/RunCMake/ctest_upload/CTestConfig.cmake.in @@ -0,0 +1 @@ +set(CTEST_PROJECT_NAME "CTestUpload@CASE_NAME@") diff --git a/Tests/RunCMake/ctest_upload/RunCMakeTest.cmake b/Tests/RunCMake/ctest_upload/RunCMakeTest.cmake new file mode 100644 index 0000000..b33d278 --- /dev/null +++ b/Tests/RunCMake/ctest_upload/RunCMakeTest.cmake @@ -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) diff --git a/Tests/RunCMake/ctest_upload/UploadQuiet-stdout.txt b/Tests/RunCMake/ctest_upload/UploadQuiet-stdout.txt new file mode 100644 index 0000000..20e13b8 --- /dev/null +++ b/Tests/RunCMake/ctest_upload/UploadQuiet-stdout.txt @@ -0,0 +1 @@ +Use Experimental tag: [0-9-]+$ diff --git a/Tests/RunCMake/ctest_upload/test.cmake.in b/Tests/RunCMake/ctest_upload/test.cmake.in new file mode 100644 index 0000000..f13bdd1 --- /dev/null +++ b/Tests/RunCMake/ctest_upload/test.cmake.in @@ -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}) |