3 ==================================================================================
4 Copyright (c) 2019 Nokia
5 Copyright (c) 2018-2019 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_nng_test.c
23 Abstract: This tests the whole rmr nng 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>
58 #include <nng/protocol/pubsub0/pub.h>
59 #include <nng/protocol/pubsub0/sub.h>
60 #include <nng/protocol/pipeline0/push.h>
61 #include <nng/protocol/pipeline0/pull.h>
64 #include "test_nng_em.c" // nng/nn emulation (before including things under test)
67 #include "../src/common/include/rmr.h" // things the users see
68 #include "../src/common/include/rmr_symtab.h"
69 #include "../src/common/include/rmr_agnostic.h" // transport agnostic header
70 #include "../src/nng/include/rmr_nng_private.h" // transport specific
72 #include "../src/common/src/symtab.c"
73 #include "../src/nng/src/rmr_nng.c"
75 static void gen_rt( uta_ctx_t* ctx ); // defined in sr_nng_static_test, but used by a few others (eliminate order requirement below)
77 // specific test tools in this directory
78 #include "test_support.c" // things like fail_if()
80 #include "tools_static_test.c" // local test functions pulled directly because of static nature of things
81 #include "symtab_static_test.c"
82 #include "ring_static_test.c"
83 #include "rt_static_test.c"
84 #include "sr_nng_static_test.c"
85 #include "wormhole_static_test.c"
86 #include "rmr_nng_api_static_test.c"
90 Drive each of the separate tests and report.
95 fprintf( stderr, "<INFO> starting tool tests\n" );
96 errors += tools_test();
97 fprintf( stderr, "<INFO> error count: %d\n", errors );
99 fprintf( stderr, "<INFO> starting ring tests (%d)\n", errors );
100 errors += ring_test();
101 fprintf( stderr, "<INFO> error count: %d\n", errors );
103 fprintf( stderr, "<INFO> starting symtab tests\n" );
104 errors += symtab_test( );
105 fprintf( stderr, "<INFO> error count: %d\n", errors );
107 fprintf( stderr, "<INFO> starting rtable tests\n" );
108 errors += rt_test(); // route table tests
109 fprintf( stderr, "<INFO> error count: %d\n", errors );
111 fprintf( stderr, "<INFO> starting RMr API tests\n" );
112 errors += rmr_api_test();
113 fprintf( stderr, "<INFO> error count: %d\n", errors );
115 fprintf( stderr, "<INFO> starting wormhole tests\n" );
116 errors += worm_test(); // test wormhole funcitons
117 fprintf( stderr, "<INFO> error count: %d\n", errors );
119 fprintf( stderr, "<INFO> starting send/receive tests\n" );
120 errors += sr_nng_test(); // test the send/receive static functions
121 fprintf( stderr, "<INFO> error count: %d\n", errors );
124 fprintf( stderr, "<PASS> all tests were OK\n" );
126 fprintf( stderr, "<FAIL> %d modules reported errors\n", errors );