Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Shane Lontis <shane.lontis@oracle.com>
(Merged from https://github.com/openssl/openssl/pull/21621)
(cherry picked from commit
badf3c162d2b67635beee3fc948db32f13d274af)
int setup_tests(void)
{
ADD_TEST(my_test); /* Add each test separately */
- return 1; /* Indicate success */
+ return 1; /* Indicates success. Return 0 */
+ /* to produce an error with a */
+ /* usage message and -1 for */
+ /* failure to set up with no */
+ /* usage message. */
}
You should use the `TEST_xxx` macros provided by `testutil.h` to test all failure
int main(int argc, char *argv[])
{
int ret = EXIT_FAILURE;
+ int setup_res;
test_open_streams();
if (!setup_test_framework(argc, argv))
goto end;
- if (setup_tests()) {
+ if ((setup_res = setup_tests()) > 0) {
ret = run_tests(argv[0]);
cleanup_tests();
opt_check_usage();
- } else {
+ } else if (setup_res == 0) {
opt_help(test_get_options());
}
end: