c16ad35b1dcaaccbe8b2ed937a024d0a06b1dade
[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_nonceg_tests());
32
33 SRunner *sr = srunner_create(s);
34
35 srunner_run_all(sr, CK_NORMAL);
36 number_failed = srunner_ntests_failed(sr);
37
38 tkm_deinit();
39 srunner_free(sr);
40
41 return (number_failed == 0) ? EXIT_SUCCESS : EXIT_FAILURE;
42 }