blob: 9ccc68dbe6cd76feaa15d7eb4085b6058b8fd9e0 [file] [log] [blame]
Ashwin Sridharanfd9cc7a2019-04-03 16:47:02 -04001// : vi ts=4 sw=4 noet :
2/*
3==================================================================================
E. Scott Daniels8790bf02019-04-23 12:59:28 +00004 Copyright (c) 2019 Nokia
5 Copyright (c) 2018-2019 AT&T Intellectual Property.
Ashwin Sridharanfd9cc7a2019-04-03 16:47:02 -04006
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
10
E. Scott Daniels8790bf02019-04-23 12:59:28 +000011 http://www.apache.org/licenses/LICENSE-2.0
Ashwin Sridharanfd9cc7a2019-04-03 16:47:02 -040012
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==================================================================================
19*/
20
21
22/*
E. Scott Danielsfc5c77b2020-02-21 13:24:29 -050023 Mnemonic: tools_test.c
Ashwin Sridharanfd9cc7a2019-04-03 16:47:02 -040024 Abstract: Unit tests for the RMr tools module.
25 Author: E. Scott Daniels
26 Date: 21 January 2019
27*/
28
29
30#include <stdio.h>
31#include <stdlib.h>
32#include <netdb.h>
33#include <errno.h>
34#include <string.h>
35#include <errno.h>
36#include <pthread.h>
37#include <ctype.h>
E. Scott Daniels412d53d2019-05-20 20:00:52 +000038#include <pthread.h>
39#include <semaphore.h>
Ashwin Sridharanfd9cc7a2019-04-03 16:47:02 -040040
E. Scott Daniels412d53d2019-05-20 20:00:52 +000041#include "rmr.h"
E. Scott Daniels0d4def62020-01-28 16:50:27 -050042#include "rmr_logging.h"
E. Scott Daniels412d53d2019-05-20 20:00:52 +000043#include "rmr_agnostic.h"
E. Scott Danielsfc5c77b2020-02-21 13:24:29 -050044
45#define NO_EMULATION
Ashwin Sridharanfd9cc7a2019-04-03 16:47:02 -040046#include "test_support.c" // our private library of test tools
47
E. Scott Daniels316614a2020-08-04 13:48:47 -040048#include "logging.c" // tools references logging, so pull in too
E. Scott Daniels412d53d2019-05-20 20:00:52 +000049#include "tools_static.c"
Ashwin Sridharanfd9cc7a2019-04-03 16:47:02 -040050
E. Scott Daniels68d09fa2019-06-03 19:45:12 +000051#include "tools_static_test.c"
E. Scott Daniels8c6756d2021-04-19 15:13:51 -040052#include "wrapper_static_test.c"
Ashwin Sridharanfd9cc7a2019-04-03 16:47:02 -040053
54int main( ) {
E. Scott Daniels77526eb2020-09-17 16:39:31 -040055 int errors = 0;
56
E. Scott Daniels8c6756d2021-04-19 15:13:51 -040057 fprintf( stderr, "<INFO> starting tools_test\n" );
E. Scott Daniels77526eb2020-09-17 16:39:31 -040058 errors += tools_test() > 0;
59
E. Scott Daniels8c6756d2021-04-19 15:13:51 -040060 fprintf( stderr, "<INFO> testing wrapper\n" );
61 errors += wrapper_test();
62
E. Scott Daniels77526eb2020-09-17 16:39:31 -040063 test_summary( errors, "tool tests" );
64 if( errors == 0 ) {
65 fprintf( stderr, "<PASS> all tool tests were OK\n\n" );
66 } else {
67 fprintf( stderr, "<FAIL> %d errors in tool code\n\n", errors );
68 }
69
70 return !!errors;
Ashwin Sridharanfd9cc7a2019-04-03 16:47:02 -040071}
E. Scott Daniels68d09fa2019-06-03 19:45:12 +000072