mirror of
https://git.libssh.org/projects/libssh.git
synced 2025-05-30 05:24:50 +03:00
tests: Only run ssh_bind test if we build with server support
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
This commit is contained in:
parent
a89a67e008
commit
c480ac8522
@ -200,6 +200,7 @@ static void torture_options_proxycommand(void **state) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
#ifdef WITH_SERVER
|
||||||
/* sshbind options */
|
/* sshbind options */
|
||||||
static int sshbind_setup(void **state)
|
static int sshbind_setup(void **state)
|
||||||
{
|
{
|
||||||
@ -213,6 +214,7 @@ static int sshbind_teardown(void **state)
|
|||||||
ssh_bind_free(*state);
|
ssh_bind_free(*state);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
#endif /* WITH_SERVER */
|
||||||
|
|
||||||
static void torture_bind_options_import_key(void **state)
|
static void torture_bind_options_import_key(void **state)
|
||||||
{
|
{
|
||||||
@ -261,14 +263,18 @@ int torture_run_tests(void) {
|
|||||||
cmocka_unit_test_setup_teardown(torture_options_proxycommand, setup, teardown),
|
cmocka_unit_test_setup_teardown(torture_options_proxycommand, setup, teardown),
|
||||||
};
|
};
|
||||||
|
|
||||||
|
#ifdef WITH_SERVER
|
||||||
struct CMUnitTest sshbind_tests[] = {
|
struct CMUnitTest sshbind_tests[] = {
|
||||||
cmocka_unit_test_setup_teardown(torture_bind_options_import_key, sshbind_setup, sshbind_teardown),
|
cmocka_unit_test_setup_teardown(torture_bind_options_import_key, sshbind_setup, sshbind_teardown),
|
||||||
};
|
};
|
||||||
|
#endif /* WITH_SERVER */
|
||||||
|
|
||||||
ssh_init();
|
ssh_init();
|
||||||
torture_filter_tests(tests);
|
torture_filter_tests(tests);
|
||||||
rc = cmocka_run_group_tests(tests, NULL, NULL);
|
rc = cmocka_run_group_tests(tests, NULL, NULL);
|
||||||
|
#ifdef WITH_SERVER
|
||||||
rc += cmocka_run_group_tests(sshbind_tests, NULL, NULL);
|
rc += cmocka_run_group_tests(sshbind_tests, NULL, NULL);
|
||||||
|
#endif /* WITH_SERVER */
|
||||||
ssh_finalize();
|
ssh_finalize();
|
||||||
return rc;
|
return rc;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user