Skip to content

Commit

Permalink
cheribsdtest_run_test: consolidate return path
Browse files Browse the repository at this point in the history
Both fail and pass paths share common exit code so merge it into a
single copy with one more label.
  • Loading branch information
brooksdavis committed Aug 17, 2023
1 parent 68c01ad commit 82e70e9
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions bin/cheribsdtest/cheribsdtest.c
Original file line number Diff line number Diff line change
Expand Up @@ -559,13 +559,7 @@ cheribsdtest_run_test(const struct cheri_test *ctp)
xo_emit("{d:status/%s}: {d:name/%s}\n", "PASS", ctp->ct_name);
tests_passed++;
}
close(pipefd_stdin[1]);
close(pipefd_stdout[0]);
xo_close_instance("testcase");
xo_flush();
if (sleep_after_test)
sleep(1);
return;
goto do_return;

fail:
/*
Expand Down Expand Up @@ -600,6 +594,8 @@ cheribsdtest_run_test(const struct cheri_test *ctp)
tests_xfailed++;
sl_add(cheri_xfailed_tests, failure_message);
}

do_return:
xo_close_instance("testcase");
xo_flush();
close(pipefd_stdin[1]);
Expand Down

0 comments on commit 82e70e9

Please sign in to comment.