Fix checking return code of build_game function in testharness
Reporter: WanderingNullPtr | Status: closed | Last Modified: April 15, 2022, 07:49:21 pmbuild_game
returns with the following codes:
0
ifexecvp
successfully launchesemake
.- A value
>0
ifemake
launches but exits with non zero return code. -1
ifexecvp
fails to launchemake
.
These return codes are checked by launch_and_attach
and run_to_completion
here:
if (int retcode = build_game(game, tc, out)) {
if (retcode != -1) {
std::cerr << "Failed to run emake." << std::endl;
} else {
std::cerr << "emake returned " << retcode << "; abort" << std::endl;
}
return nullptr;
}
When build_game
fails to launch emake
then retcode
holds -1
which gets compared with -1
using !=
evaluating to false
hence Failed to run emake
never gets into cerr. Replacing !=
with ==
ensures correct behavior.
codecov[bot]
Codecov Report
Merging #2294 (06e2b31) into master (6aa9187) will not change coverage.
The diff coverage isn/a
.
@@ Coverage Diff @@
## master #2294 +/- ##
=======================================
Coverage 35.27% 35.27%
=======================================
Files 213 213
Lines 20474 20474
=======================================
Hits 7223 7223
Misses 13251 13251
Continue to review full report at Codecov.
Legend - Click here to learn more
Δ = absolute <relative> (impact)
,ø = not affected
,? = missing data
Powered by Codecov. Last update 6aa9187...06e2b31. Read the comment docs.
Leave a commentView this issue on GitHub
Please sign in to post comments, or you can view this issue on GitHub.