Skip to content

Commit e530e4a

Browse files
committed
Tidy up unit test code
Tidy up unit test code to have cleaner string in windows failed command test, and useful #if for non-working code.
1 parent f7e4440 commit e530e4a

File tree

1 file changed

+11
-7
lines changed

1 file changed

+11
-7
lines changed

unit/util/piped_process.cpp

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ TEST_CASE(
3939
{
4040
std::vector<std::string> commands;
4141
#ifdef _WIN32
42-
const std::string expected_error("'abcde' is not recogni");
42+
const std::string expected_error("'abcde' is not recognized");
4343
commands.push_back("cmd /c abcde");
4444
#else
4545
const std::string expected_error("Launching abcde failed");
@@ -90,13 +90,17 @@ TEST_CASE(
9090
end_time - start_time);
9191
size_t calc = time_span.count();
9292
#else
93-
// Currently not working under Linxu/MacOS?!
94-
// commands.push_back("sleep 6");
95-
// time_t calc = time(NULL);
96-
// piped_processt process(commands);
97-
// process.~piped_processt();
98-
// calc = time(NULL) - calc;
93+
// Currently not working under Linux/MacOS?!
94+
// Likely due to issue in handling signals from child process
95+
# if 0
96+
commands.push_back("sleep 6");
97+
time_t calc = time(NULL);
98+
piped_processt process(commands);
99+
process.~piped_processt();
100+
calc = time(NULL) - calc;
101+
# else
99102
size_t calc = 0;
103+
# endif
100104
#endif
101105
// Command should take >5 seconds, check we called destructor and
102106
// moved on in less than 2 seconds.

0 commit comments

Comments
 (0)