Merge topic 'ctest-build-and-test'

2a5ecbdf1a ctest: Restore cleanup of load_command plugins
8e4fdafd0a cmCTestBuildAndTest: Improve RunCMake method return type

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Merge-request: !9916
This commit is contained in:
Brad King
2024-10-19 18:44:16 +00:00
committed by Kitware Robot
3 changed files with 12 additions and 7 deletions

View File

@@ -33,7 +33,7 @@ cmCTestBuildAndTest::cmCTestBuildAndTest(cmCTest* ctest)
{
}
int cmCTestBuildAndTest::RunCMake(cmake* cm)
bool cmCTestBuildAndTest::RunCMake(cmake* cm)
{
std::vector<std::string> args;
args.push_back(cmSystemTools::GetCMakeCommand());
@@ -69,18 +69,18 @@ int cmCTestBuildAndTest::RunCMake(cmake* cm)
if (cm->Run(args) != 0) {
std::cout << "======== End CMake output ======\n";
std::cout << "Error: cmake execution failed\n";
return 1;
return false;
}
// do another config?
if (this->BuildTwoConfig) {
if (cm->Run(args) != 0) {
std::cout << "======== End CMake output ======\n";
std::cout << "Error: cmake execution failed\n";
return 1;
return false;
}
}
std::cout << "======== End CMake output ======\n";
return 0;
return true;
}
bool cmCTestBuildAndTest::RunTest(std::vector<std::string> const& argv,
@@ -230,7 +230,7 @@ int cmCTestBuildAndTest::Run()
cm.LoadCache(this->BinaryDir);
} else {
// do the cmake step, no timeout here since it is not a sub process
if (this->RunCMake(&cm)) {
if (!this->RunCMake(&cm)) {
return 1;
}
}

View File

@@ -29,7 +29,7 @@ public:
private:
cmCTest* CTest;
int RunCMake(cmake* cm);
bool RunCMake(cmake* cm);
bool RunTest(std::vector<std::string> const& args, int* retVal,
cmDuration timeout);

View File

@@ -54,6 +54,7 @@
#include "cmCTestUpdateHandler.h"
#include "cmCTestUploadHandler.h"
#include "cmCommandLineArgument.h"
#include "cmDynamicLoader.h"
#include "cmExecutionStatus.h"
#include "cmGeneratedFileStream.h"
#include "cmGlobalGenerator.h"
@@ -3004,7 +3005,11 @@ int cmCTest::ExecuteTests()
int cmCTest::RunCMakeAndTest()
{
return this->Impl->BuildAndTest.Run();
int retv = this->Impl->BuildAndTest.Run();
#ifndef CMAKE_BOOTSTRAP
cmDynamicLoader::FlushCache();
#endif
return retv;
}
void cmCTest::SetNotesFiles(const std::string& notes)