ENH: check the return value of the test program to be run
This commit is contained in:
parent
5325be37b6
commit
9fd92a28f7
@ -192,7 +192,8 @@ int main (int argc, char *argv[])
|
|||||||
cmSystemTools::ConvertToWindowsSlashes(fullPath);
|
cmSystemTools::ConvertToWindowsSlashes(fullPath);
|
||||||
#endif
|
#endif
|
||||||
std::cout << "Running test executable: " << fullPath.c_str() << "\n";
|
std::cout << "Running test executable: " << fullPath.c_str() << "\n";
|
||||||
if (!cmSystemTools::RunCommand(fullPath.c_str(), output))
|
int ret = 0;
|
||||||
|
if (!cmSystemTools::RunCommand(fullPath.c_str(), output, ret, true))
|
||||||
{
|
{
|
||||||
std::cerr << "Error: " << fullPath.c_str() << " execution failed\n";
|
std::cerr << "Error: " << fullPath.c_str() << " execution failed\n";
|
||||||
// return to the original directory
|
// return to the original directory
|
||||||
@ -203,5 +204,10 @@ int main (int argc, char *argv[])
|
|||||||
// return to the original directory
|
// return to the original directory
|
||||||
cmSystemTools::ChangeDirectory(cwd.c_str());
|
cmSystemTools::ChangeDirectory(cwd.c_str());
|
||||||
cmMakefileGenerator::UnRegisterGenerators();
|
cmMakefileGenerator::UnRegisterGenerators();
|
||||||
return 0;
|
if(ret)
|
||||||
|
{
|
||||||
|
cmSystemTools::Error("test executable ", fullPath.c_str(),
|
||||||
|
"returned a non-zero value");
|
||||||
|
}
|
||||||
|
return ret;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user