Skip to content

Commit

Permalink
[runner][error] Avoid nm error message on non-lib files
Browse files Browse the repository at this point in the history
Re-fixes #251, this time by capturing the stderr from `nm` instead of
replacing it.
  • Loading branch information
thoni56 committed Jun 29, 2022
1 parent bf89ff6 commit 4fdc207
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion tools/discoverer.c
Original file line number Diff line number Diff line change
Expand Up @@ -60,13 +60,14 @@ CgreenVector *discover_tests_in(const char *filename, bool verbose) {
close_file(library);

char nm_command[1000];
sprintf(nm_command, "/usr/bin/nm '%s'", filename);
sprintf(nm_command, "/usr/bin/nm '%s' 2>&1", filename);
FILE *nm_output_pipe = open_process(nm_command, "r");
if (nm_output_pipe == NULL)
return NULL;

CgreenVector *tests = create_cgreen_vector((GenericDestructor)&destroy_test_item);
add_all_tests_from(nm_output_pipe, tests, verbose);
close_process(nm_output_pipe);

return tests;
}

0 comments on commit 4fdc207

Please sign in to comment.