1
0
mirror of https://git.libssh.org/projects/libssh.git synced 2025-07-29 13:01:13 +03:00

Factorize all the main functions in unit tests

This commit is contained in:
Aris Adamantiadis
2010-05-18 22:25:06 +02:00
parent 89993dd757
commit f95157297e
10 changed files with 36 additions and 191 deletions

View File

@ -13,7 +13,7 @@ START_TEST (torture_ssh_init)
}
END_TEST
static Suite *torture_make_suite(void) {
Suite *torture_make_suite(void) {
Suite *s = suite_create("libssh_init");
torture_create_case(s, "torture_ssh_init", torture_ssh_init);
@ -21,26 +21,5 @@ static Suite *torture_make_suite(void) {
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;
}