File tree Expand file tree Collapse file tree 1 file changed +9
-7
lines changed
Expand file tree Collapse file tree 1 file changed +9
-7
lines changed Original file line number Diff line number Diff line change @@ -37,12 +37,6 @@ bool checkMessage(const std::runtime_error& ex)
3737 return true ;
3838}
3939
40- bool checkMessageFalse (const std::runtime_error& ex)
41- {
42- BOOST_CHECK_EQUAL (ex.what (), std::string (" RunCommandParseJSON error: process(false) returned 1: \n " ));
43- return true ;
44- }
45-
4640bool checkMessageStdErr (const std::runtime_error& ex)
4741{
4842 const std::string what (ex.what ());
@@ -73,7 +67,15 @@ BOOST_AUTO_TEST_CASE(run_command)
7367 }
7468 {
7569 // Return non-zero exit code, no output to stderr
76- BOOST_CHECK_EXCEPTION (RunCommandParseJSON (" false" ), std::runtime_error, checkMessageFalse);
70+ #ifdef WIN32
71+ const std::string command{" cmd.exe /c call" };
72+ #else
73+ const std::string command{" false" };
74+ #endif
75+ BOOST_CHECK_EXCEPTION (RunCommandParseJSON (command), std::runtime_error, [&](const std::runtime_error& e) {
76+ BOOST_CHECK (std::string (e.what ()).find (strprintf (" RunCommandParseJSON error: process(%s) returned 1: \n " , command)) != std::string::npos);
77+ return true ;
78+ });
7779 }
7880 {
7981 // Return non-zero exit code, with error message for stderr
You can’t perform that action at this time.
0 commit comments