summaryrefslogtreecommitdiffstats
path: root/Source/cmaketest.cxx
diff options
context:
space:
mode:
authorBill Hoffman <bill.hoffman@kitware.com>2002-01-21 15:38:42 (GMT)
committerBill Hoffman <bill.hoffman@kitware.com>2002-01-21 15:38:42 (GMT)
commit9fd92a28f7009eec00d6934892d0db8a39678d89 (patch)
treeea338ba8fe6935a56b32a80e9f0041dbc9725004 /Source/cmaketest.cxx
parent5325be37b6ffd57ce3ce3aeca64b759ce032cc82 (diff)
downloadCMake-9fd92a28f7009eec00d6934892d0db8a39678d89.zip
CMake-9fd92a28f7009eec00d6934892d0db8a39678d89.tar.gz
CMake-9fd92a28f7009eec00d6934892d0db8a39678d89.tar.bz2
ENH: check the return value of the test program to be run
Diffstat (limited to 'Source/cmaketest.cxx')
-rw-r--r--Source/cmaketest.cxx10
1 files changed, 8 insertions, 2 deletions
diff --git a/Source/cmaketest.cxx b/Source/cmaketest.cxx
index ced4912..eec5346 100644
--- a/Source/cmaketest.cxx
+++ b/Source/cmaketest.cxx
@@ -192,7 +192,8 @@ int main (int argc, char *argv[])
cmSystemTools::ConvertToWindowsSlashes(fullPath);
#endif
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";
// return to the original directory
@@ -203,5 +204,10 @@ int main (int argc, char *argv[])
// return to the original directory
cmSystemTools::ChangeDirectory(cwd.c_str());
cmMakefileGenerator::UnRegisterGenerators();
- return 0;
+ if(ret)
+ {
+ cmSystemTools::Error("test executable ", fullPath.c_str(),
+ "returned a non-zero value");
+ }
+ return ret;
}