sjana | d63f834 | 2020-03-24 10:12:41 -0400 | [diff] [blame] | 1 | /* |
| 2 | ================================================================================== |
| 3 | |
sjana | 23dad81 | 2020-05-08 14:13:38 -0400 | [diff] [blame] | 4 | Copyright (c) 2019-2020 AT&T Intellectual Property. |
sjana | d63f834 | 2020-03-24 10:12:41 -0400 | [diff] [blame] | 5 | |
| 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> |
sjana | 65ac2f8 | 2020-03-31 12:20:25 -0400 | [diff] [blame] | 26 | #include<stdlib.h> |
sjana | d63f834 | 2020-03-24 10:12:41 -0400 | [diff] [blame] | 27 | #include<gtest/gtest.h> |
| 28 | |
sjana | 65ac2f8 | 2020-03-31 12:20:25 -0400 | [diff] [blame] | 29 | #include "test_db.h" |
sjana | 23dad81 | 2020-05-08 14:13:38 -0400 | [diff] [blame] | 30 | #include "test_rmr.h" |
sjana | 65ac2f8 | 2020-03-31 12:20:25 -0400 | [diff] [blame] | 31 | #include "test_hc.h" |
sjana | 23dad81 | 2020-05-08 14:13:38 -0400 | [diff] [blame] | 32 | #include "test_subs.h" |
| 33 | #include "test_e2sm.h" |
sjana | d63f834 | 2020-03-24 10:12:41 -0400 | [diff] [blame] | 34 | |
| 35 | using namespace std; |
| 36 | |
sjana | 65ac2f8 | 2020-03-31 12:20:25 -0400 | [diff] [blame] | 37 | |
sjana | d63f834 | 2020-03-24 10:12:41 -0400 | [diff] [blame] | 38 | int main(int argc, char* argv[]) |
| 39 | { |
sjana | 23dad81 | 2020-05-08 14:13:38 -0400 | [diff] [blame] | 40 | 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(); |
sjana | d63f834 | 2020-03-24 10:12:41 -0400 | [diff] [blame] | 60 | |
| 61 | testing::InitGoogleTest(&argc, argv); |
sjana | 23dad81 | 2020-05-08 14:13:38 -0400 | [diff] [blame] | 62 | int res = RUN_ALL_TESTS(); |
| 63 | |
| 64 | |
| 65 | |
| 66 | return res; |
sjana | d63f834 | 2020-03-24 10:12:41 -0400 | [diff] [blame] | 67 | } |