X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=fhi_lib%2Ftest%2Fcommon%2Fxranlib_unit_test_main.cc;h=8cab03d756d50482a8c5e99099650ea4c43377cc;hb=HEAD;hp=90ec5d3fd04bfea63bc8d728453556a855a5ca38;hpb=2fbf70096f64af622da983e88c5a64e90ad9bdbd;p=o-du%2Fphy.git diff --git a/fhi_lib/test/common/xranlib_unit_test_main.cc b/fhi_lib/test/common/xranlib_unit_test_main.cc index 90ec5d3..8cab03d 100644 --- a/fhi_lib/test/common/xranlib_unit_test_main.cc +++ b/fhi_lib/test/common/xranlib_unit_test_main.cc @@ -1,21 +1,8 @@ -/****************************************************************************** -* -* Copyright (c) 2019 Intel. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -* -*******************************************************************************/ - +/******************************************************************************* + * + * + * + *******************************************************************************/ #include #include #include @@ -40,12 +27,42 @@ static int parse_input_parameter(std::string executable, std::string option) } } -//xranLibWraper xranlib; xranLibWraper *xranlib; +void +ut_version_print(void) +{ + char sysversion[100]; + char *compilation_date = (char *)__DATE__; + char *compilation_time = (char *)__TIME__; + char compiler[100]; + + //snprintf(sysversion, 99, "Version: %s", VERSIONX); + +#if defined(__clang__) + snprintf(compiler, 99, "family clang: %s", __clang_version__); +#elif defined(__ICC) || defined(__INTEL_COMPILER) + snprintf(compiler, 99, "family icc: version %d", __INTEL_COMPILER); +#elif defined(__INTEL_LLVM_COMPILER) + snprintf(compiler, 99, "family icx: version %d", __INTEL_LLVM_COMPILER); +#elif defined(__GNUC__) || defined(__GNUG__) + snprintf(compiler, 99, "family gcc: version %d.%d.%d", __GNUC__, __GNUC_MINOR__,__GNUC_PATCHLEVEL__); +#endif + + printf("\n\n"); + printf("===========================================================================================================\n"); + printf("UNITTESTS VERSION\n"); + printf("===========================================================================================================\n"); + + //printf("%s\n", sysversion); + printf("build-date: %s\n", compilation_date); + printf("build-time: %s\n", compilation_time); + printf("build-with: %s\n", compiler); +} + int main(int argc, char** argv) { int all_test_ret = 0; - + ut_version_print(); /* Enable xml output by default */ ::testing::GTEST_FLAG(output) = "xml:test_results.xml"; @@ -110,7 +127,7 @@ int main(int argc, char** argv) { if(xranlib != nullptr) { delete xranlib; - xranlib == nullptr; + xranlib = nullptr; } return all_test_ret;