Implement TKM kernel SA database (SAD)
[strongswan.git] / src / charon-tkm / tests / test_runner.c
1 /*
2 * Copyright (C) 2012 Reto Buerki
3 * Copyright (C) 2012 Adrian-Ken Rueegsegger
4 * Hochschule fuer Technik Rapperswil
5 *
6 * This program is free software; you can redistribute it and/or modify it
7 * under the terms of the GNU General Public License as published by the
8 * Free Software Foundation; either version 2 of the License, or (at your
9 * option) any later version. See <http://www.fsf.org/copyleft/gpl.txt>.
10 *
11 * This program is distributed in the hope that it will be useful, but
12 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
13 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14 * for more details.
15 */
16
17 #include "tkm.h"
18 #include "test_runner.h"
19
20 int main(void)
21 {
22 if (!tkm_init())
23 {
24 fprintf(stderr, "Could not connect to TKM, aborting tests\n");
25 return EXIT_FAILURE;
26 }
27
28 int number_failed;
29 Suite *s = suite_create("TKM tests");
30 suite_add_tcase(s, make_id_manager_tests());
31 suite_add_tcase(s, make_chunk_map_tests());
32 suite_add_tcase(s, make_utility_tests());
33 suite_add_tcase(s, make_nonceg_tests());
34 suite_add_tcase(s, make_diffie_hellman_tests());
35 suite_add_tcase(s, make_keymat_tests());
36 suite_add_tcase(s, make_kernel_sad_tests());
37
38 SRunner *sr = srunner_create(s);
39
40 srunner_run_all(sr, CK_NORMAL);
41 number_failed = srunner_ntests_failed(sr);
42
43 tkm_deinit();
44 srunner_free(sr);
45
46 return (number_failed == 0) ? EXIT_SUCCESS : EXIT_FAILURE;
47 }