Skip to content
Snippets Groups Projects
Commit 6730676a authored by Wuttke, Joachim's avatar Wuttke, Joachim
Browse files

rely on CTest to print exception message

parent a119c041
No related branches found
No related tags found
No related merge requests found
......@@ -28,7 +28,7 @@ namespace
{
//! Runs a python command, prints messages, returns true unless the system call failed.
bool runPython(const std::string& py_command)
void runPython(const std::string& py_command)
{
#ifndef _WIN32
std::string sys_command = std::string("PYTHONPATH=") + BABuild::buildLibDir() + " "
......@@ -42,10 +42,10 @@ bool runPython(const std::string& py_command)
std::cout << sys_command << std::endl /*sic*/; // flush output before calling std::system
int ret = std::system(sys_command.c_str());
if (ret != 0) {
std::cerr << "Command returned non-zero value " << ret << "\n";
return false;
std::stringstream msg;
msg << "Command returned non-zero value " << ret;
throw std::runtime_error(msg.str());
}
return true;
}
} // namespace
......@@ -68,8 +68,7 @@ bool PyStandardTest::runTest()
pythonFile.close();
// Run Python script
if (!runPython(pyscript_filename + " " + output_path))
return false;
runPython(pyscript_filename + " " + output_path);
// Run direct simulation
std::cout << "Running simulation and comparing with result from Py script\n";
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment