mirror of
https://git.libssh.org/projects/libssh.git
synced 2025-08-17 14:21:05 +03:00
Factorize all the main functions in unit tests
This commit is contained in:
@@ -119,7 +119,7 @@ START_TEST (torture_algorithms_zlib)
|
||||
}
|
||||
END_TEST
|
||||
|
||||
static Suite *torture_make_suite(void) {
|
||||
Suite *torture_make_suite(void) {
|
||||
Suite *s = suite_create("libssh_algorithms");
|
||||
|
||||
torture_create_case_fixture(s, "torture_algorithms_aes128-cbc",
|
||||
@@ -142,26 +142,3 @@ static Suite *torture_make_suite(void) {
|
||||
torture_algorithms_zlib, setup, teardown);
|
||||
return s;
|
||||
}
|
||||
|
||||
int main(int argc, char **argv) {
|
||||
Suite *s = NULL;
|
||||
SRunner *sr = NULL;
|
||||
struct argument_s arguments;
|
||||
int nf;
|
||||
|
||||
ZERO_STRUCT(arguments);
|
||||
|
||||
torture_cmdline_parse(argc, argv, &arguments);
|
||||
|
||||
s = torture_make_suite();
|
||||
|
||||
sr = srunner_create(s);
|
||||
if (arguments.nofork) {
|
||||
srunner_set_fork_status(sr, CK_NOFORK);
|
||||
}
|
||||
srunner_run_all(sr, CK_VERBOSE);
|
||||
nf = srunner_ntests_failed(sr);
|
||||
srunner_free(sr);
|
||||
|
||||
return (nf == 0) ? EXIT_SUCCESS : EXIT_FAILURE;
|
||||
}
|
||||
|
Reference in New Issue
Block a user