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_nano_test.c
23 Abstract: This tests the whole rmr nanomsg 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 This test only needs to drive the soruce in nanomsg/src. The
32 common library functions are driven by the nng tests.
34 Author: E. Scott Daniels
35 Date: 18 January 2018 (IMO HRTL)
56 #include <sys/epoll.h>
58 #include <semaphore.h>
62 #include <nanomsg/nn.h>
65 #include "test_nng_em.c" // nng/nn emulation (before including things under test)
68 #include "rmr.h" // things the users see
69 #include "rmr_symtab.h"
70 #include "rmr_agnostic.h" // transport agnostic header
71 #include "rmr_private.h" // transport specific
76 #include "rtable_static.c"
78 static void gen_rt( uta_ctx_t* ctx ); // defined in sr_static_test, but used by a few others (eliminate order requirement below)
80 // specific test tools in this directory
81 #include "test_support.c" // things like fail_if()
83 #include "mbuf_api_static_test.c"
85 #include "sr_nano_static_test.c"
86 #include "rmr_nng_api_static_test.c" // this can be used for both nng and nano
87 #include "rt_nano_static_test.c" // this can be used for both
91 Drive each of the separate tests and report.
96 fprintf( stderr, "<INFO> starting RMr Nanomsg based API tests\n" );
97 errors += rmr_api_test();
98 fprintf( stderr, "<INFO> error count: %d\n", errors );
100 fprintf( stderr, "<INFO> starting mbuf related tests\n" );
101 errors += mbuf_api_test( );
102 fprintf( stderr, "<INFO> error count: %d\n", errors );
104 fprintf( stderr, "<INFO> starting send/receive tests\n" );
105 errors += sr_nano_test(); // test the send/receive static functions
106 fprintf( stderr, "<INFO> error count: %d\n", errors );
108 fprintf( stderr, "<INFO> starting rt_static tests\n" );
109 errors += rt_test(); // route table things specific to nano
110 fprintf( stderr, "<INFO> error count: %d\n", errors );
113 fprintf( stderr, "<PASS> all tests were OK\n" );
115 fprintf( stderr, "<FAIL> %d modules reported errors\n", errors );