diff --git a/CMakeLists.txt b/CMakeLists.txt index 60e03e706..26b00f485 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -22,6 +22,11 @@ project(Thunder DESCRIPTION "Thunder framework" HOMEPAGE_URL "https://rdkcentral.github.io/Thunder/") +set(VERSION ${${PROJECT_NAME}_VERSION}) +set(VERSION_MAJOR ${${PROJECT_NAME}_VERSION_MAJOR}) +set(VERSION_MINOR ${${PROJECT_NAME}_VERSION_MINOR}) +set(VERSION_PATCH ${${PROJECT_NAME}_VERSION_PATCH}) + string(TIMESTAMP BUILD_TIMESTAMP UTC) message(STATUS "Setting up ${PROJECT_NAME} v${Thunder_VERSION}") diff --git a/Source/Thunder/CMakeLists.txt b/Source/Thunder/CMakeLists.txt index f993a1b06..e0be6eb13 100644 --- a/Source/Thunder/CMakeLists.txt +++ b/Source/Thunder/CMakeLists.txt @@ -40,9 +40,6 @@ target_compile_definitions(${TARGET} target_compile_options (${TARGET} PRIVATE -Wno-psabi) -configure_file("${CMAKE_CURRENT_SOURCE_DIR}/Version.h.in" "${CMAKE_CURRENT_BINARY_DIR}/generated/version/version.h" @ONLY) -message(STATUS "Generated ${CMAKE_CURRENT_BINARY_DIR}/generated/version/version.h") - if (TREE_REFERENCE) target_compile_definitions(${TARGET} PRIVATE @@ -98,7 +95,7 @@ set_target_properties(${TARGET} PROPERTIES CXX_STANDARD 11 CXX_STANDARD_REQUIRED YES FRAMEWORK FALSE - VERSION ${Thunder_VERSION} + VERSION ${VERSION} ) install( diff --git a/Source/Thunder/Module.h b/Source/Thunder/Module.h index 7f397cab5..f95bf5b3c 100644 --- a/Source/Thunder/Module.h +++ b/Source/Thunder/Module.h @@ -37,7 +37,5 @@ #define TREE_REFERENCE engineering_build_for_debug_purpose_only #endif -#include - #undef EXTERNAL #define EXTERNAL diff --git a/Source/Thunder/PluginHost.cpp b/Source/Thunder/PluginHost.cpp index 76e4666f8..0ddb48b89 100644 --- a/Source/Thunder/PluginHost.cpp +++ b/Source/Thunder/PluginHost.cpp @@ -651,7 +651,7 @@ POP_WARNING() SYSLOG(Logging::Startup, (_T("Process Id: %d"), Core::ProcessInfo().Id())); SYSLOG(Logging::Startup, (_T("Tree ref: " _T(EXPAND_AND_QUOTE(TREE_REFERENCE))))); SYSLOG(Logging::Startup, (_T("Build ref: " _T(EXPAND_AND_QUOTE(BUILD_REFERENCE))))); - SYSLOG(Logging::Startup, (_T("Version: %d:%d:%d"), PluginHost::Major, PluginHost::Minor, PluginHost::Minor)); + SYSLOG(Logging::Startup, (_T("Version: %d:%d:%d"), Versioning::Major, Versioning::Minor, Versioning::Minor)); if (_config->MessagingCategoriesFile() == false) { SYSLOG(Logging::Startup, (_T("Messages [INT]: %s"), options.configFile)); } diff --git a/Source/Thunder/PluginServer.h b/Source/Thunder/PluginServer.h index 3f57027a3..6f92ea2d4 100644 --- a/Source/Thunder/PluginServer.h +++ b/Source/Thunder/PluginServer.h @@ -4415,9 +4415,9 @@ namespace PluginHost { } inline void Metadata(PluginHost::Metadata::Version& data) const { - data.Major = PluginHost::Major; - data.Minor = PluginHost::Minor; - data.Patch = PluginHost::Patch; + data.Major = Versioning::Major; + data.Minor = Versioning::Minor; + data.Patch = Versioning::Patch; data.Hash = string(Core::System::ModuleBuildRef()); } inline void Metadata(Core::JSON::ArrayType& data) const diff --git a/Source/Thunder/SystemInfo.cpp b/Source/Thunder/SystemInfo.cpp index 3541436d8..6a56272f9 100644 --- a/Source/Thunder/SystemInfo.cpp +++ b/Source/Thunder/SystemInfo.cpp @@ -271,7 +271,7 @@ POP_WARNING() string SystemInfo::Version() const /* override */ { - return (Core::Format(_T("%d.%d.%d"), PluginHost::Major, PluginHost::Minor, PluginHost::Patch)); + return (Core::Format(_T("%d.%d.%d"), Versioning::Major, Versioning::Minor, Versioning::Patch)); } } //namspace Plugin diff --git a/Source/Thunder/Version.h.in b/Source/Thunder/Version.h.in deleted file mode 100644 index a5ad9d527..000000000 --- a/Source/Thunder/Version.h.in +++ /dev/null @@ -1,14 +0,0 @@ -/*** - * DO NOT EDIT, THIS FILE IS GENERATED @ @BUILD_TIMESTAMP@ - */ - -#pragma once - -namespace Thunder -{ - namespace PluginHost { - static constexpr uint8_t Major = @Thunder_VERSION_MAJOR@; - static constexpr uint8_t Minor = @Thunder_VERSION_MINOR@; - static constexpr uint8_t Patch = @Thunder_VERSION_PATCH@; - } -} diff --git a/Source/ThunderPlugin/CMakeLists.txt b/Source/ThunderPlugin/CMakeLists.txt index 1b3dbc86b..269d4086d 100644 --- a/Source/ThunderPlugin/CMakeLists.txt +++ b/Source/ThunderPlugin/CMakeLists.txt @@ -63,12 +63,12 @@ set_target_properties(${TARGET} PROPERTIES CXX_STANDARD 11 CXX_STANDARD_REQUIRED YES FRAMEWORK FALSE - SOVERSION ${Thunder_VERSION_MAJOR} + SOVERSION ${VERSION_MAJOR} ) if(HUMAN_VERSIONED_BINARIES) set_target_properties(${TARGET} PROPERTIES - VERSION ${Thunder_VERSION} + VERSION ${VERSION} ) endif() diff --git a/Source/com/CMakeLists.txt b/Source/com/CMakeLists.txt index fd3cacf1b..7a12f2b73 100644 --- a/Source/com/CMakeLists.txt +++ b/Source/com/CMakeLists.txt @@ -86,12 +86,12 @@ set_target_properties(${TARGET} PROPERTIES CXX_STANDARD_REQUIRED YES FRAMEWORK FALSE PUBLIC_HEADER "${PUBLIC_HEADERS}" # specify the public headers - SOVERSION ${Thunder_VERSION_MAJOR} + SOVERSION ${VERSION_MAJOR} ) if(HUMAN_VERSIONED_BINARIES) set_target_properties(${TARGET} PROPERTIES - VERSION ${Thunder_VERSION} + VERSION ${VERSION} ) endif() diff --git a/Source/core/CMakeLists.txt b/Source/core/CMakeLists.txt index 08985df25..f31b83c0d 100644 --- a/Source/core/CMakeLists.txt +++ b/Source/core/CMakeLists.txt @@ -27,7 +27,7 @@ message(STATUS "Generated ${CMAKE_CURRENT_BINARY_DIR}/generated/core/Version.h") add_library(${TARGET} Module.cpp - DoorBell.cpp + DoorBell.cpp CyclicBuffer.cpp DataElement.cpp DataElementFile.cpp @@ -230,12 +230,12 @@ set_target_properties(${TARGET} PROPERTIES CXX_STANDARD_REQUIRED YES FRAMEWORK FALSE PUBLIC_HEADER "${PUBLIC_HEADERS}" # specify the public headers - SOVERSION ${Thunder_VERSION_MAJOR} + SOVERSION ${VERSION_MAJOR} ) if(HUMAN_VERSIONED_BINARIES) set_target_properties(${TARGET} PROPERTIES - VERSION ${Thunder_VERSION} + VERSION ${VERSION} ) endif() diff --git a/Source/core/MessageException.cpp b/Source/core/MessageException.cpp index c776cf59a..1be7b1420 100644 --- a/Source/core/MessageException.cpp +++ b/Source/core/MessageException.cpp @@ -36,11 +36,11 @@ PUSH_WARNING(DISABLE_WARNING_DEPRECATED_USE) } POP_WARNING() - MessageException::~MessageException() noexcept(true) + MessageException::~MessageException() throw() { } - const TCHAR* MessageException::Message() const noexcept(true) + const TCHAR* MessageException::Message() const throw() { return m_Message.c_str(); } diff --git a/Source/core/MessageException.h b/Source/core/MessageException.h index 023adc368..ca5ff0997 100644 --- a/Source/core/MessageException.h +++ b/Source/core/MessageException.h @@ -29,15 +29,15 @@ namespace Thunder { namespace Core { - class EXTERNAL MessageException : public std::exception { + class MessageException : public std::exception { private: MessageException(); public: - MessageException(const string& message, bool inclSysMsg = false) noexcept(true); + MessageException(const string& message, bool inclSysMsg = false) throw(); ~MessageException() throw(); - const TCHAR* Message() const noexcept(true); + const TCHAR* Message() const throw(); private: string m_Message; // Exception message diff --git a/Source/core/Version.h.in b/Source/core/Version.h.in index f81def4d3..8543abb5c 100644 --- a/Source/core/Version.h.in +++ b/Source/core/Version.h.in @@ -4,4 +4,15 @@ #pragma once -#define THUNDER_VERSION @Thunder_VERSION_MAJOR@ +#include + +#define THUNDER_VERSION @VERSION_MAJOR@ + +namespace Thunder +{ + namespace Versioning { + static constexpr uint8_t Major = @VERSION_MAJOR@; + static constexpr uint8_t Minor = @VERSION_MINOR@; + static constexpr uint8_t Patch = @VERSION_PATCH@; + } +} diff --git a/Source/cryptalgo/CMakeLists.txt b/Source/cryptalgo/CMakeLists.txt index c636d3ff4..eb42f04f6 100644 --- a/Source/cryptalgo/CMakeLists.txt +++ b/Source/cryptalgo/CMakeLists.txt @@ -68,12 +68,12 @@ set_target_properties(${TARGET} PROPERTIES CXX_STANDARD_REQUIRED YES FRAMEWORK FALSE PUBLIC_HEADER "${PUBLIC_HEADERS}" # specify the public headers - SOVERSION ${Thunder_VERSION_MAJOR} + SOVERSION ${VERSION_MAJOR} ) if(HUMAN_VERSIONED_BINARIES) set_target_properties(${TARGET} PROPERTIES - VERSION ${Thunder_VERSION} + VERSION ${VERSION} ) endif() diff --git a/Source/extensions/hibernate/CMakeLists.txt b/Source/extensions/hibernate/CMakeLists.txt index 000380f39..1b9d441d2 100644 --- a/Source/extensions/hibernate/CMakeLists.txt +++ b/Source/extensions/hibernate/CMakeLists.txt @@ -38,12 +38,12 @@ set(PUBLIC_HEADERS set_target_properties(${TARGET} PROPERTIES FRAMEWORK FALSE PUBLIC_HEADER "${PUBLIC_HEADERS}" - SOVERSION ${Thunder_VERSION_MAJOR} + SOVERSION ${VERSION_MAJOR} ) if(HUMAN_VERSIONED_BINARIES) set_target_properties(${TARGET} PROPERTIES - VERSION ${Thunder_VERSION} + VERSION ${VERSION} ) endif() @@ -70,4 +70,4 @@ InstallCMakeConfig( InstallPackageConfig( TARGETS ${TARGET} - DESCRIPTION "Enable ease of development for Hibernate support." ) \ No newline at end of file + DESCRIPTION "Enable ease of development for Hibernate support." ) diff --git a/Source/extensions/processcontainers/CMakeLists.txt b/Source/extensions/processcontainers/CMakeLists.txt index 513b4bb66..3dda39751 100644 --- a/Source/extensions/processcontainers/CMakeLists.txt +++ b/Source/extensions/processcontainers/CMakeLists.txt @@ -76,12 +76,12 @@ set_target_properties(${TARGET} PROPERTIES CXX_STANDARD_REQUIRED YES FRAMEWORK FALSE PUBLIC_HEADER "${PUBLIC_HEADERS}" - SOVERSION ${Thunder_VERSION_MAJOR} + SOVERSION ${VERSION_MAJOR} ) if(HUMAN_VERSIONED_BINARIES) set_target_properties(${TARGET} PROPERTIES - VERSION ${Thunder_VERSION} + VERSION ${VERSION} ) endif() diff --git a/Source/extensions/warningreporting/CMakeLists.txt b/Source/extensions/warningreporting/CMakeLists.txt index fd2900c9d..4e751ac72 100644 --- a/Source/extensions/warningreporting/CMakeLists.txt +++ b/Source/extensions/warningreporting/CMakeLists.txt @@ -44,12 +44,12 @@ set_target_properties(${TARGET} PROPERTIES CXX_STANDARD_REQUIRED YES FRAMEWORK FALSE PUBLIC_HEADER "${PUBLIC_HEADERS}" # specify the public headers - SOVERSION ${Thunder_VERSION_MAJOR} + SOVERSION ${VERSION_MAJOR} ) if(HUMAN_VERSIONED_BINARIES) set_target_properties(${TARGET} PROPERTIES - VERSION ${Thunder_VERSION} + VERSION ${VERSION} ) endif() diff --git a/Source/messaging/CMakeLists.txt b/Source/messaging/CMakeLists.txt index bfc53b3d2..d8125bc44 100644 --- a/Source/messaging/CMakeLists.txt +++ b/Source/messaging/CMakeLists.txt @@ -59,12 +59,12 @@ set_target_properties(${TARGET} PROPERTIES CXX_STANDARD_REQUIRED YES FRAMEWORK FALSE PUBLIC_HEADER "${PUBLIC_HEADERS}" # specify the public headers - SOVERSION ${Thunder_VERSION_MAJOR} + SOVERSION ${VERSION_MAJOR} ) if(HUMAN_VERSIONED_BINARIES) set_target_properties(${TARGET} PROPERTIES - VERSION ${Thunder_VERSION} + VERSION ${VERSION} ) endif() diff --git a/Source/plugins/CMakeLists.txt b/Source/plugins/CMakeLists.txt index 767c4cbcc..01e5721df 100644 --- a/Source/plugins/CMakeLists.txt +++ b/Source/plugins/CMakeLists.txt @@ -125,12 +125,12 @@ set_target_properties(${TARGET} PROPERTIES CXX_STANDARD_REQUIRED YES FRAMEWORK FALSE PUBLIC_HEADER "${PUBLIC_HEADERS}" # specify the public headers - SOVERSION ${Thunder_VERSION_MAJOR} + SOVERSION ${VERSION_MAJOR} ) if(HUMAN_VERSIONED_BINARIES) set_target_properties(${TARGET} PROPERTIES - VERSION ${Thunder_VERSION} + VERSION ${VERSION} ) endif() @@ -138,12 +138,12 @@ set_target_properties(${TARGET_PROXYSTUBS} PROPERTIES CXX_STANDARD 11 CXX_STANDARD_REQUIRED YES FRAMEWORK FALSE - SOVERSION ${Thunder_VERSION_MAJOR} + SOVERSION ${VERSION_MAJOR} ) if(HUMAN_VERSIONED_BINARIES) set_target_properties(${TARGET} PROPERTIES - VERSION ${Thunder_VERSION} + VERSION ${VERSION} ) endif() diff --git a/Source/tracing/tracing.h b/Source/tracing/tracing.h deleted file mode 100644 index b73494e94..000000000 --- a/Source/tracing/tracing.h +++ /dev/null @@ -1,20 +0,0 @@ -/* - * If not stated otherwise in this file or this component's LICENSE file the - * following copyright and licenses apply: - * - * Copyright 2020 Metrological - * - * 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 \ No newline at end of file diff --git a/Source/websocket/CMakeLists.txt b/Source/websocket/CMakeLists.txt index 694d37a8e..2f39a23b1 100644 --- a/Source/websocket/CMakeLists.txt +++ b/Source/websocket/CMakeLists.txt @@ -58,12 +58,12 @@ set_target_properties(${TARGET} PROPERTIES CXX_STANDARD_REQUIRED YES FRAMEWORK FALSE PUBLIC_HEADER "${PUBLIC_HEADERS}" # specify the public headers - SOVERSION ${Thunder_VERSION_MAJOR} + SOVERSION ${VERSION_MAJOR} ) if(HUMAN_VERSIONED_BINARIES) set_target_properties(${TARGET} PROPERTIES - VERSION ${Thunder_VERSION} + VERSION ${VERSION} ) endif() diff --git a/Tests/unit/core/CMakeLists.txt b/Tests/unit/core/CMakeLists.txt index 34e548504..eafc39959 100644 --- a/Tests/unit/core/CMakeLists.txt +++ b/Tests/unit/core/CMakeLists.txt @@ -42,7 +42,7 @@ add_executable(${TEST_RUNNER_NAME} test_lockablecontainer.cpp test_measurementtype.cpp test_memberavailability.cpp - test_messageException.cpp + #test_messageException.cpp test_networkinfo.cpp test_nodeid.cpp test_numbertype.cpp diff --git a/Tests/unit/core/test_messageException.cpp b/Tests/unit/core/test_messageException.cpp index 377d17d2f..df07f1439 100644 --- a/Tests/unit/core/test_messageException.cpp +++ b/Tests/unit/core/test_messageException.cpp @@ -27,17 +27,22 @@ using namespace Thunder::Core; TEST(test_messageException, simple_messageException) { - const std::string msg = "Testing the message exception."; - - // No 'error' concatenated - MessageException exception(msg, false); - - EXPECT_STREQ(exception.Message(), msg.c_str()); - - // 'error' concatenated - MessageException exception1(msg, true); - - const string result = msg + ": No such file or directory"; - - EXPECT_STREQ(exception1.Message(), result.c_str()); + std::string msg = "Testing the message exception."; + MessageException exception(msg.c_str(),false); + EXPECT_STREQ(exception.Message(),msg.c_str()); + + MessageException exception1(msg.c_str(),true); + char buffer[50]; + string status = ": File exists"; + snprintf(buffer, msg.size()+status.size()+1, "%s%s",msg.c_str(),status.c_str()); +#ifdef BUILD_ARM + if (strcmp(exception1.Message(), buffer) != 0) { +#else + if (strcmp(exception1.Message(), buffer) != 0) { +#endif + memset(buffer, 0, sizeof buffer); + status = ": No such file or directory"; + snprintf(buffer, msg.size()+status.size()+1, "%s%s",msg.c_str(),status.c_str()); + } + EXPECT_STREQ(exception1.Message(),buffer); }