diff options
author | Andy Cedilnik <andy.cedilnik@kitware.com> | 2005-05-31 21:32:40 (GMT) |
---|---|---|
committer | Andy Cedilnik <andy.cedilnik@kitware.com> | 2005-05-31 21:32:40 (GMT) |
commit | f6e5a878fc8de3ac3ef38b144a0a649a9f227682 (patch) | |
tree | ea4927fdd1c147884fc63e19fc417d325f933411 /Source/CTest/cmCTestBuildHandler.cxx | |
parent | f963c406ab2877bb53b66ad60d701b5d7b46f406 (diff) | |
download | CMake-f6e5a878fc8de3ac3ef38b144a0a649a9f227682.zip CMake-f6e5a878fc8de3ac3ef38b144a0a649a9f227682.tar.gz CMake-f6e5a878fc8de3ac3ef38b144a0a649a9f227682.tar.bz2 |
ENH: Add support for writing output file. While doing that, redesign the way ctest does output. There may still be problems with commands failing, but that should be fixed by applying the similar concept to whole CMake
Diffstat (limited to 'Source/CTest/cmCTestBuildHandler.cxx')
-rw-r--r-- | Source/CTest/cmCTestBuildHandler.cxx | 30 |
1 files changed, 14 insertions, 16 deletions
diff --git a/Source/CTest/cmCTestBuildHandler.cxx b/Source/CTest/cmCTestBuildHandler.cxx index 5fe8e44..520cd92 100644 --- a/Source/CTest/cmCTestBuildHandler.cxx +++ b/Source/CTest/cmCTestBuildHandler.cxx @@ -171,8 +171,8 @@ cmCTestBuildHandler::cmCTestBuildHandler() } else { - std::cout << "Problem Compiling regular expression: " - << cmCTestWarningErrorFileLine[cc].m_RegularExpressionString << std::endl; + cmCTestLog(m_CTest, ERROR, "Problem Compiling regular expression: " + << cmCTestWarningErrorFileLine[cc].m_RegularExpressionString << std::endl); } } } @@ -196,17 +196,17 @@ void cmCTestBuildHandler::PopulateCustomVectors(cmMakefile *mf) //functions and commented... int cmCTestBuildHandler::ProcessHandler() { - std::cout << "Build project" << std::endl; + cmCTestLog(m_CTest, HANDLER_OUTPUT, "Build project" << std::endl); const std::string &makeCommand = m_CTest->GetCTestConfiguration("MakeCommand"); if ( makeCommand.size() == 0 ) { - std::cerr << "Cannot find MakeCommand key in the DartConfiguration.tcl" << std::endl; + cmCTestLog(m_CTest, ERROR, "Cannot find MakeCommand key in the DartConfiguration.tcl" << std::endl); return -1; } const std::string &buildDirectory = m_CTest->GetCTestConfiguration("BuildDirectory"); if ( buildDirectory.size() == 0 ) { - std::cerr << "Cannot find BuildDirectory key in the DartConfiguration.tcl" << std::endl; + cmCTestLog(m_CTest, ERROR, "Cannot find BuildDirectory key in the DartConfiguration.tcl" << std::endl); return -1; } @@ -214,7 +214,7 @@ int cmCTestBuildHandler::ProcessHandler() double elapsed_time_start = cmSystemTools::GetTime(); if ( !m_CTest->OpenOutputFile("Temporary", "LastBuild.log", ofs) ) { - std::cerr << "Cannot create LastBuild.log file" << std::endl; + cmCTestLog(m_CTest, ERROR, "Cannot create LastBuild.log file" << std::endl); } m_StartBuild = m_CTest->CurrentTime(); @@ -224,18 +224,17 @@ int cmCTestBuildHandler::ProcessHandler() if ( !m_CTest->GetShowOnly() ) { res = m_CTest->RunMakeCommand(makeCommand.c_str(), &output, - &retVal, buildDirectory.c_str(), - m_Verbose, 0, ofs); + &retVal, buildDirectory.c_str(), 0, ofs); } else { - std::cout << "Build with command: " << makeCommand << std::endl; + cmCTestLog(m_CTest, DEBUG, "Build with command: " << makeCommand << std::endl); } m_EndBuild = m_CTest->CurrentTime(); double elapsed_build_time = cmSystemTools::GetTime() - elapsed_time_start; if (res != cmsysProcess_State_Exited || retVal ) { - std::cerr << "Error(s) when building project" << std::endl; + cmCTestLog(m_CTest, ERROR, "Error(s) when building project" << std::endl); } std::vector<cmStdString>::size_type cc; @@ -382,13 +381,13 @@ int cmCTestBuildHandler::ProcessHandler() bool found = false; if ( markedLines[kk] == 1 ) { - //std::cout << "Error: " << lines[kk] << std::endl; + cmCTestLog(m_CTest, DEBUG, "Error: " << lines[kk] << std::endl); errorwarning.m_Error = true; found = true; } else if ( markedLines[kk] > 1 ) { - //std::cout << "Warning: " << lines[kk] << std::endl; + cmCTestLog(m_CTest, DEBUG, "Warning: " << lines[kk] << std::endl); errorwarning.m_Error = false; found = true; } @@ -433,13 +432,12 @@ int cmCTestBuildHandler::ProcessHandler() } } - std::cout << " " << errors << " Compiler errors" << std::endl; - std::cout << " " << warnings << " Compiler warnings" << std::endl; - + cmCTestLog(m_CTest, HANDLER_OUTPUT, " " << errors << " Compiler errors" << std::endl); + cmCTestLog(m_CTest, HANDLER_OUTPUT, " " << warnings << " Compiler warnings" << std::endl); cmGeneratedFileStream xofs; if( !m_CTest->OpenOutputFile(m_CTest->GetCurrentTag(), "Build.xml", xofs, true) ) { - std::cerr << "Cannot create build XML file" << std::endl; + cmCTestLog(m_CTest, ERROR, "Cannot create build XML file" << std::endl); return -1; } this->GenerateDartBuildOutput(xofs, errorsWarnings, elapsed_build_time); |