Create the AHCI branch for Aman's work
[reactos.git] / sdk / lib / drivers / lwip / test / unit / lwip_unittests.c
1 #include "lwip_check.h"
2
3 #include "udp/test_udp.h"
4 #include "tcp/test_tcp.h"
5 #include "tcp/test_tcp_oos.h"
6 #include "core/test_mem.h"
7 #include "core/test_pbuf.h"
8 #include "etharp/test_etharp.h"
9 #include "dhcp/test_dhcp.h"
10
11 #include "lwip/init.h"
12
13
14 int main()
15 {
16 int number_failed;
17 SRunner *sr;
18 size_t i;
19 suite_getter_fn* suites[] = {
20 udp_suite,
21 tcp_suite,
22 tcp_oos_suite,
23 mem_suite,
24 pbuf_suite,
25 etharp_suite,
26 dhcp_suite
27 };
28 size_t num = sizeof(suites)/sizeof(void*);
29 LWIP_ASSERT("No suites defined", num > 0);
30
31 lwip_init();
32
33 sr = srunner_create((suites[0])());
34 for(i = 1; i < num; i++) {
35 srunner_add_suite(sr, ((suite_getter_fn*)suites[i])());
36 }
37
38 #ifdef LWIP_UNITTESTS_NOFORK
39 srunner_set_fork_status(sr, CK_NOFORK);
40 #endif
41 #ifdef LWIP_UNITTESTS_FORK
42 srunner_set_fork_status(sr, CK_FORK);
43 #endif
44
45 srunner_run_all(sr, CK_NORMAL);
46 number_failed = srunner_ntests_failed(sr);
47 srunner_free(sr);
48 return (number_failed == 0) ? EXIT_SUCCESS : EXIT_FAILURE;
49 }