3 ==================================================================================
4 Copyright (c) 2020 Nokia
5 Copyright (c) 2020 AT&T Intellectual Property.
7 Licensed under the Apache License, Version 2.0 (the "License");
8 you may not use this file except in compliance with the License.
9 You may obtain a copy of the License at
11 http://www.apache.org/licenses/LICENSE-2.0
13 Unless required by applicable law or agreed to in writing, software
14 distributed under the License is distributed on an "AS IS" BASIS,
15 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 See the License for the specific language governing permissions and
17 limitations under the License.
18 ==================================================================================
22 Mmemonic: rmr_si_test.c
23 Abstract: This tests the whole RMR SI95 implementation. This driver
24 includes all of the module specific unit test static files
25 (e.g. wormhole_static_test.c) and drives the tests contained
26 there. The individual modules allow them to be driven by
27 a standalone driver, and to be maintained separately. We must
28 test by inclusion because of the static nature of the internal
29 functions of the library.
31 Author: E. Scott Daniels
32 Date: 18 January 2018 (IMO HRTL)
53 #include <sys/epoll.h>
55 #include <semaphore.h>
58 #define PARANOID_CHECKS 1 // must have parinoid testing on to not fail on nil pointer tests
60 // specific test tools in this directory
62 #include "test_support.c" // things like fail_if()
63 #include "test_msg_support.c"
64 #include "test_gen_rt.c"
67 #include "rmr.h" // things the users see
68 #include "rmr_symtab.h"
69 #include "rmr_logging.h"
70 #include "rmr_agnostic.h" // transport agnostic header
77 #include "test_ctx_support.c" // dummy context support
80 static void gen_rt( uta_ctx_t* ctx ); // defined in sr_si_static_test, but used by a few others (eliminate order requirement below)
83 #include "tools_static_test.c" // local test functions pulled directly because of static nature of things
84 #include "symtab_static_test.c"
85 #include "ring_static_test.c"
86 #include "rt_static_test.c"
87 #include "wormhole_static_test.c"
88 #include "mbuf_api_static_test.c"
89 #include "sr_si_static_test.c"
90 #include "lg_buf_static_test.c"
91 // do NOT include the receive test static must be stand alone
93 #include "rmr_si_api_static_test.c"
97 Drive each of the separate tests and report.
102 rmr_set_vlevel( 5 ); // enable all debugging
104 fprintf( stderr, "\n<INFO> starting lg buffer tests (%d)\n", errors );
105 errors += rmr_lgbuf_test();
106 fprintf( stderr, "<INFO> error count: %d\n", errors );
108 fprintf( stderr, "\n<INFO> starting ring tests (%d)\n", errors );
109 errors += ring_test();
110 fprintf( stderr, "<INFO> error count: %d\n", errors );
112 fprintf( stderr, "\n<INFO> starting symtab tests\n" );
113 errors += symtab_test( );
114 fprintf( stderr, "<INFO> error count: %d\n", errors );
116 fprintf( stderr, "\n<INFO> starting rtable tests\n" );
117 errors += rt_test(); // route table tests
118 fprintf( stderr, "<INFO> error count: %d\n", errors );
120 fprintf( stderr, "\n<INFO> starting wormhole tests\n" );
121 errors += worm_test(); // test wormhole funcitons
122 fprintf( stderr, "<INFO> error count: %d\n", errors );
124 fprintf( stderr, "\n<INFO> starting tool tests\n" );
125 errors += tools_test();
126 fprintf( stderr, "<INFO> error count: %d\n", errors );
128 fprintf( stderr, "\n<INFO> starting mbuf api tests\n" );
129 errors += mbuf_api_test( );
130 fprintf( stderr, "<INFO> error count: %d\n", errors );
132 fprintf( stderr, "\n<INFO> starting send/receive tests\n" );
133 errors += sr_si_test(); // test the send/receive static functions
134 fprintf( stderr, "<INFO> error count: %d\n", errors );
137 fprintf( stderr, "\n<INFO> starting RMr API tests\n" );
138 errors += rmr_api_test();
140 /// ---- all ok above here
142 fprintf( stderr, "\n<INFO> run RMr API tests with src name only env var set\n" );
143 setenv( "RMR_SRC_NAMEONLY", "1", 1 );
144 errors += rmr_api_test();
145 fprintf( stderr, "<INFO> error count: %d\n", errors );
148 test_summary( errors, "rmr_si tests" );
150 fprintf( stderr, "<PASS> all rmr si tests were OK\n\n" );
152 fprintf( stderr, "<FAIL> %d rmr si test modules reported errors\n\n", errors );