blob: 99187c528b16c914e46ffdef704b160d5b435773 [file] [log] [blame]
sjanad63f8342020-03-24 10:12:41 -04001/*
2==================================================================================
3
sjana23dad812020-05-08 14:13:38 -04004 Copyright (c) 2019-2020 AT&T Intellectual Property.
sjanad63f8342020-03-24 10:12:41 -04005
6 Licensed under the Apache License, Version 2.0 (the "License");
7 you may not use this file except in compliance with the License.
8 You may obtain a copy of the License at
9
10 http://www.apache.org/licenses/LICENSE-2.0
11
12 Unless required by applicable law or agreed to in writing, software
13 distributed under the License is distributed on an "AS IS" BASIS,
14 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 See the License for the specific language governing permissions and
16 limitations under the License.
17==================================================================================
18/*
19 * hw_unit_tests.cc
20 *
21 * Created on: Mar, 2020
22 * Author: Shraboni Jana
23 */
24
25#include<iostream>
sjana65ac2f82020-03-31 12:20:25 -040026#include<stdlib.h>
sjanad63f8342020-03-24 10:12:41 -040027#include<gtest/gtest.h>
28
sjana65ac2f82020-03-31 12:20:25 -040029#include "test_db.h"
sjana23dad812020-05-08 14:13:38 -040030#include "test_rmr.h"
sjana65ac2f82020-03-31 12:20:25 -040031#include "test_hc.h"
sjana23dad812020-05-08 14:13:38 -040032#include "test_subs.h"
33#include "test_e2sm.h"
sjanad63f8342020-03-24 10:12:41 -040034
35using namespace std;
36
sjana65ac2f82020-03-31 12:20:25 -040037
sjanad63f8342020-03-24 10:12:41 -040038int main(int argc, char* argv[])
39{
sjana23dad812020-05-08 14:13:38 -040040 char *aux;
41 aux=getenv("RMR_SEED_RT");
42 if (aux==NULL || *aux == '\0'){
43
44 char rmr_seed[80]="RMR_SEED_RT=../init/routes.txt";
45 putenv(rmr_seed);
46 }
47 //get configuration
48 XappSettings config;
49 //change the priority depending upon application requirement
50 config.loadDefaultSettings();
51 config.loadEnvVarSettings();
52
53 //initialize rmr
54 std::unique_ptr<XappRmr> rmr = std::make_unique<XappRmr>("38000");
55 rmr->xapp_rmr_init(true);
56
57 //create a dummy xapp
58 std::unique_ptr<Xapp> dm_xapp = std::make_unique<Xapp>(std::ref(config),std::ref(*rmr));
59 dm_xapp->Run();
sjanad63f8342020-03-24 10:12:41 -040060
61 testing::InitGoogleTest(&argc, argv);
sjana23dad812020-05-08 14:13:38 -040062 int res = RUN_ALL_TESTS();
63
64
65
66 return res;
sjanad63f8342020-03-24 10:12:41 -040067}