Skip to content

Commit a9135c5

Browse files
committed
Use return value of system
1 parent bfbf1f4 commit a9135c5

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

test/generate_examples/main.cpp

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -374,18 +374,22 @@ int main() {
374374
cmd += " && ";
375375
cmd += exe_str;
376376
cout << cmd << endl;
377-
system(cmd.c_str());
377+
int r = system(cmd.c_str());
378+
if (r != 0) {
379+
std::cerr << "Could not execute " << cmd << std::endl;
380+
}
378381

379382
// Move the figures to the documentation directory
380383
fs::path figure_origin_svg = p.parent_path() / "example.svg";
381384
if (fs::exists(figure_origin_svg)) {
382385
if (!fs::exists(figure_destination_svg.parent_path())) {
383-
fs::create_directories(figure_destination_svg.parent_path());
386+
fs::create_directories(
387+
figure_destination_svg.parent_path());
384388
}
385389
fs::rename(figure_origin_svg, figure_destination_svg);
386390
} else {
387-
cout << "Could not find " << figure_origin_svg.filename() << " for "
388-
<< executable.filename() << endl;
391+
cout << "Could not find " << figure_origin_svg.filename()
392+
<< " for " << executable.filename() << endl;
389393
}
390394
}
391395

0 commit comments

Comments
 (0)