From 5207fcf50cf0ab2e9021ef004d8f726bc0dc532c Mon Sep 17 00:00:00 2001 From: Abdessattar Sassi <457645+abdes@users.noreply.github.com> Date: Mon, 21 Oct 2024 22:42:31 +0400 Subject: [PATCH] refactor: update to use latest asap template BREAKING For large scale projects, it is important to properly scope the module's include files. Therefore, now, to include from asap.contract, you should use #include The target name for the `contract` module is now `asap.contract`. The target name for the `contract-ut` module is now `asap.contract-ut`. --- .vscode/launch.json | 2 +- CMakeLists.txt | 22 +-- Folder.DotSettings.user | 2 +- contract-ut/CMakeLists.txt | 172 ++++++++--------- .../{ => asap}/contract/ut/framework.h | 2 +- .../include/{ => asap}/contract/ut/gtest.h | 0 contract-ut/src/contract-ut.cpp | 4 +- contract-ut/test/CMakeLists.txt | 7 +- contract-ut/test/contract_ut_gtest_test.cpp | 4 +- contract-ut/test/main.cpp | 2 +- contract-ut/test/test_helper.cpp | 2 +- contract/CMakeLists.txt | 173 +++++++++--------- .../include/{ => asap}/contract/contract.h | 2 +- contract/src/contract.cpp | 2 +- contract/test/CMakeLists.txt | 14 +- contract/test/contract_handlers_test.cpp | 4 +- contract/test/contracts_audit_test.cpp | 4 +- contract/test/contracts_default_test.cpp | 4 +- contract/test/contracts_off_test.cpp | 4 +- contract/test/test_helper.cpp | 2 +- templates/version.h.in | 31 ++-- third_party/CMakeLists.txt | 3 +- tools/version-info/src/main.cpp.in | 2 +- 23 files changed, 234 insertions(+), 230 deletions(-) rename contract-ut/include/{ => asap}/contract/ut/framework.h (99%) rename contract-ut/include/{ => asap}/contract/ut/gtest.h (100%) rename contract/include/{ => asap}/contract/contract.h (99%) diff --git a/.vscode/launch.json b/.vscode/launch.json index b667f9b..8e3a3c1 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -28,4 +28,4 @@ "console": "externalTerminal" } ] -} \ No newline at end of file +} diff --git a/CMakeLists.txt b/CMakeLists.txt index 7b9b454..1802a9a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -38,7 +38,7 @@ include(GetGitRevisionDescription) get_git_head_revision(GIT_REFSPEC GIT_SHA1) string(SUBSTRING "${GIT_SHA1}" 0 12 GIT_REV) if(NOT GIT_SHA1) - set(GIT_REV "0") + set(GIT_REV "0") endif() # Meta information about the project @@ -53,12 +53,8 @@ set(META_VERSION_MAJOR "1") set(META_VERSION_MINOR "0") set(META_VERSION_PATCH "2") set(META_VERSION_REVISION "${GIT_REV}") -set(META_VERSION - "${META_VERSION_MAJOR}.${META_VERSION_MINOR}.${META_VERSION_PATCH}" -) -set(META_NAME_VERSION - "${META_PROJECT_NAME} v${META_VERSION} (${META_VERSION_REVISION})" -) +set(META_VERSION "${META_VERSION_MAJOR}.${META_VERSION_MINOR}.${META_VERSION_PATCH}") +set(META_NAME_VERSION "${META_PROJECT_NAME} v${META_VERSION} (${META_VERSION_REVISION})") # cmake-format: on string(MAKE_C_IDENTIFIER ${META_PROJECT_NAME} META_PROJECT_ID) @@ -67,10 +63,10 @@ string(TOLOWER ${META_PROJECT_ID} META_PROJECT_ID_LOWER) # Determine if this is built as a subproject or if it is the master project. if(NOT DEFINED ${META_PROJECT_ID}_IS_MASTER_PROJECT) - set(${META_PROJECT_ID}_IS_MASTER_PROJECT OFF) - if(CMAKE_CURRENT_SOURCE_DIR STREQUAL CMAKE_SOURCE_DIR) - set(${META_PROJECT_ID}_IS_MASTER_PROJECT ON) - endif() + set(${META_PROJECT_ID}_IS_MASTER_PROJECT OFF) + if(CMAKE_CURRENT_SOURCE_DIR STREQUAL CMAKE_SOURCE_DIR) + set(${META_PROJECT_ID}_IS_MASTER_PROJECT ON) + endif() endif() # Push the project on the hierarchy stack after we have determined if it is a @@ -277,7 +273,7 @@ endif() # ------------------------------------------------------------------------------ if(APPLE) - set(CMAKE_MACOSX_RPATH ON) + set(CMAKE_MACOSX_RPATH ON) endif() # Set runtime path @@ -287,7 +283,7 @@ set(CMAKE_BUILD_WITH_INSTALL_RPATH FALSE) set(CMAKE_INSTALL_RPATH_USE_LINK_PATH FALSE) if(NOT SYSTEM_DIR_INSTALL) - set(CMAKE_INSTALL_RPATH "$ORIGIN/${ASAP_INSTALL_LIB}") + set(CMAKE_INSTALL_RPATH "$ORIGIN/${ASAP_INSTALL_LIB}") endif() # ------------------------------------------------------------------------------ diff --git a/Folder.DotSettings.user b/Folder.DotSettings.user index ac1763f..61d2e6f 100644 --- a/Folder.DotSettings.user +++ b/Folder.DotSettings.user @@ -1,4 +1,4 @@  <SessionState ContinuousTestingMode="0" IsActive="True" Name="All tests from &lt;asap-contract&gt;" xmlns="urn:schemas-jetbrains-com:jetbrains-ut-session"> <Project Location="D:\dev\projects\asap_repos\asap-contract" Presentation="&lt;asap-contract&gt;" /> -</SessionState> \ No newline at end of file +</SessionState> diff --git a/contract-ut/CMakeLists.txt b/contract-ut/CMakeLists.txt index 8a0ad3e..50a039f 100644 --- a/contract-ut/CMakeLists.txt +++ b/contract-ut/CMakeLists.txt @@ -4,7 +4,7 @@ # SPDX-License-Identifier: BSD-3-Clause # ===-----------------------------------------------------------------------===# -set(my_name "contract-ut") +set(my_name "asap.contract-ut") asap_push_module("${my_name}") # ------------------------------------------------------------------------------ @@ -36,7 +36,7 @@ asap_declare_module( # Main module target # ------------------------------------------------------------------------------ -set(MODULE_TARGET_NAME "asap_contract-ut") +set(MODULE_TARGET_NAME "${my_name}") asap_add_library( ${MODULE_TARGET_NAME} @@ -45,22 +45,23 @@ asap_add_library( WARNING SOURCES # Headers - "include/contract/ut/gtest.h" - "include/contract/ut/framework.h" + "include/asap/contract/ut/gtest.h" + "include/asap/contract/ut/framework.h" # Sources "src/contract-ut.cpp" ) target_include_directories( - ${MODULE_TARGET_NAME} - PUBLIC - $ - $ - $ - PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} + ${MODULE_TARGET_NAME} + PUBLIC + $ + $ + $ + PRIVATE + ${CMAKE_CURRENT_SOURCE_DIR} ) -target_link_libraries(${MODULE_TARGET_NAME} PUBLIC asap::contract) +target_link_libraries(${MODULE_TARGET_NAME} PUBLIC asap.contract) target_compile_features(${MODULE_TARGET_NAME} PUBLIC cxx_std_17) @@ -76,94 +77,97 @@ asap_create_module_config_files() # ------------------------------------------------------------------------------ if(ASAP_BUILD_TESTS) - # Add support for (optional) code quality tools - asap_add_sanitizers(${MODULE_TARGET_NAME}) + # Add support for (optional) code quality tools + asap_add_sanitizers(${MODULE_TARGET_NAME}) - add_subdirectory(test) + add_subdirectory(test) endif() # ------------------------------------------------------------------------------ # API Documentation # ------------------------------------------------------------------------------ -asap_with_doxygen( - MODULE_NAME - ${MODULE_TARGET_NAME} - VERSION - ${META_MODULE_VERSION} - TITLE - "\"Unit testing for contracts\"" - BRIEF - "\"Provides optional helpers to unit test contract checks without death tests.\"" - INPUT_PATH - "${CMAKE_CURRENT_SOURCE_DIR}/src ${CMAKE_CURRENT_SOURCE_DIR}/include" -) +if(ASAP_WITH_DOXYGEN) + asap_with_doxygen( + MODULE_NAME + ${MODULE_TARGET_NAME} + VERSION + ${META_MODULE_VERSION} + TITLE + "\"Unit testing for contracts\"" + BRIEF + "\"Provides optional helpers to unit test contract checks without death tests.\"" + INPUT_PATH + "${CMAKE_CURRENT_SOURCE_DIR}/src ${CMAKE_CURRENT_SOURCE_DIR}/include" + ) +endif() # ============================================================================== # Deployment instructions # ============================================================================== if(${META_PROJECT_ID}_INSTALL) - set(TARGETS_EXPORT_NAME "${MODULE_TARGET_NAME}Targets") - set(runtime "${MODULE_TARGET_NAME}_runtime") - set(dev "${MODULE_TARGET_NAME}_dev") - - # Library - install( - TARGETS ${MODULE_TARGET_NAME} - EXPORT "${TARGETS_EXPORT_NAME}" - COMPONENT dev - RUNTIME - DESTINATION ${ASAP_INSTALL_BIN} - COMPONENT ${runtime} - LIBRARY - DESTINATION ${ASAP_INSTALL_SHARED} - COMPONENT ${runtime} - ARCHIVE - DESTINATION ${ASAP_INSTALL_LIB} - COMPONENT ${dev} - ) - - # Header files + set(TARGETS_EXPORT_NAME "${MODULE_TARGET_NAME}Targets") + set(runtime "${MODULE_TARGET_NAME}_runtime") + set(dev "${MODULE_TARGET_NAME}_dev") + + # Library + install( + TARGETS + ${MODULE_TARGET_NAME} + EXPORT "${TARGETS_EXPORT_NAME}" + COMPONENT + dev + RUNTIME + DESTINATION ${ASAP_INSTALL_BIN} + COMPONENT ${runtime} + LIBRARY + DESTINATION ${ASAP_INSTALL_SHARED} + COMPONENT ${runtime} + ARCHIVE + DESTINATION ${ASAP_INSTALL_LIB} + COMPONENT ${dev} + ) + + # Header files + install( + DIRECTORY + ${CMAKE_CURRENT_SOURCE_DIR}/include/${META_MODULE_NAME} + DESTINATION ${ASAP_INSTALL_INCLUDE} + COMPONENT ${dev} + FILES_MATCHING + PATTERN + "*.h" + ) + + # Generated header files + install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/include/${META_MODULE_NAME} DESTINATION ${ASAP_INSTALL_INCLUDE} COMPONENT ${dev}) + + # Target config + install( + EXPORT ${TARGETS_EXPORT_NAME} + NAMESPACE ${META_PROJECT_NAME}:: + DESTINATION ${ASAP_INSTALL_CMAKE}/${META_MODULE_NAME} + COMPONENT ${dev} + ) + + # Package configuration files + install( + FILES + ${CMAKE_CURRENT_BINARY_DIR}/${MODULE_TARGET_NAME}Config.cmake + ${CMAKE_CURRENT_BINARY_DIR}/${MODULE_TARGET_NAME}ConfigVersion.cmake + DESTINATION ${ASAP_INSTALL_CMAKE}/${META_MODULE_NAME} + ) + + # Docs + if(EXISTS ${SPHINX_BUILD_DIR}/${MODULE_TARGET_NAME}) install( - DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/include/${META_MODULE_NAME} - DESTINATION ${ASAP_INSTALL_INCLUDE} - COMPONENT ${dev} - FILES_MATCHING - PATTERN "*.h" + DIRECTORY + ${SPHINX_BUILD_DIR}/${MODULE_TARGET_NAME} + DESTINATION ${ASAP_INSTALL_DOC} + COMPONENT ${MODULE_TARGET_NAME}_docs ) - - # Generated header files - install( - DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/include/${META_MODULE_NAME} - DESTINATION ${ASAP_INSTALL_INCLUDE} - COMPONENT ${dev} - ) - - # Target config - install( - EXPORT ${TARGETS_EXPORT_NAME} - NAMESPACE ${META_PROJECT_NAME}:: - DESTINATION ${ASAP_INSTALL_CMAKE}/${META_MODULE_NAME} - COMPONENT ${dev} - ) - - # Package configuration files - install( - FILES - ${CMAKE_CURRENT_BINARY_DIR}/${MODULE_TARGET_NAME}Config.cmake - ${CMAKE_CURRENT_BINARY_DIR}/${MODULE_TARGET_NAME}ConfigVersion.cmake - DESTINATION ${ASAP_INSTALL_CMAKE}/${META_MODULE_NAME} - ) - - # Docs - if(EXISTS ${SPHINX_BUILD_DIR}/${MODULE_TARGET_NAME}) - install( - DIRECTORY ${SPHINX_BUILD_DIR}/${MODULE_TARGET_NAME} - DESTINATION ${ASAP_INSTALL_DOC} - COMPONENT ${MODULE_TARGET_NAME}_docs - ) - endif() + endif() endif() asap_pop_module("${my_name}") diff --git a/contract-ut/include/contract/ut/framework.h b/contract-ut/include/asap/contract/ut/framework.h similarity index 99% rename from contract-ut/include/contract/ut/framework.h rename to contract-ut/include/asap/contract/ut/framework.h index 2b39253..8d7716d 100644 --- a/contract-ut/include/contract/ut/framework.h +++ b/contract-ut/include/asap/contract/ut/framework.h @@ -14,7 +14,7 @@ #include -#include +#include namespace asap::contract { diff --git a/contract-ut/include/contract/ut/gtest.h b/contract-ut/include/asap/contract/ut/gtest.h similarity index 100% rename from contract-ut/include/contract/ut/gtest.h rename to contract-ut/include/asap/contract/ut/gtest.h diff --git a/contract-ut/src/contract-ut.cpp b/contract-ut/src/contract-ut.cpp index 8240de2..8229329 100644 --- a/contract-ut/src/contract-ut.cpp +++ b/contract-ut/src/contract-ut.cpp @@ -13,8 +13,8 @@ #include #include -#include -#include +#include +#include namespace asap::contract { diff --git a/contract-ut/test/CMakeLists.txt b/contract-ut/test/CMakeLists.txt index db58095..c08ffaf 100644 --- a/contract-ut/test/CMakeLists.txt +++ b/contract-ut/test/CMakeLists.txt @@ -11,7 +11,7 @@ # If running with google sanitizers, skill all these targets as they are abort # and segmentation fault tests that do not make sense to run under sanitizers if(ASAP_WITH_GOOGLE_ASAN OR ASAP_WITH_GOOGLE_UBSAN OR ASAP_WITH_GOOGLE_TSAN) - return() + return() endif() # ------------------------------------------------------------------------------ @@ -34,8 +34,9 @@ asap_add_test( "contract_ut_gtest_test.cpp" "main.cpp" LINK - asap::contract-ut - asap::common + asap.common + asap.contract + asap.contract-ut gtest gmock COMMENT diff --git a/contract-ut/test/contract_ut_gtest_test.cpp b/contract-ut/test/contract_ut_gtest_test.cpp index 25e5f42..14e0ee3 100644 --- a/contract-ut/test/contract_ut_gtest_test.cpp +++ b/contract-ut/test/contract_ut_gtest_test.cpp @@ -9,8 +9,8 @@ #include #include -#include -#include +#include +#include using asap::contract::testing::TestAssertDefault; using asap::contract::testing::TestEnsureDefault; diff --git a/contract-ut/test/main.cpp b/contract-ut/test/main.cpp index 26b83df..488533a 100644 --- a/contract-ut/test/main.cpp +++ b/contract-ut/test/main.cpp @@ -6,7 +6,7 @@ #include -#include +#include auto main(int argc, char** argv) -> int { diff --git a/contract-ut/test/test_helper.cpp b/contract-ut/test/test_helper.cpp index f1f20ec..f2eca12 100644 --- a/contract-ut/test/test_helper.cpp +++ b/contract-ut/test/test_helper.cpp @@ -6,7 +6,7 @@ #include "test_helper.h" -#include +#include namespace asap::contract::testing { diff --git a/contract/CMakeLists.txt b/contract/CMakeLists.txt index b8c7b5c..682c9f0 100644 --- a/contract/CMakeLists.txt +++ b/contract/CMakeLists.txt @@ -4,7 +4,7 @@ # SPDX-License-Identifier: BSD-3-Clause # ===-----------------------------------------------------------------------===# -set(my_name "contract") +set(my_name "asap.contract") asap_push_module("${my_name}") # ------------------------------------------------------------------------------ @@ -36,7 +36,7 @@ asap_declare_module( # Main module target # ------------------------------------------------------------------------------ -set(MODULE_TARGET_NAME "asap_contract") +set(MODULE_TARGET_NAME "${my_name}") asap_add_library( ${MODULE_TARGET_NAME} @@ -45,25 +45,23 @@ asap_add_library( WARNING SOURCES # Headers - "include/contract/contract.h" + "include/asap/contract/contract.h" # Sources "src/contract.cpp" ) target_include_directories( - ${MODULE_TARGET_NAME} - PUBLIC - $ - $ - $ - PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} + ${MODULE_TARGET_NAME} + PUBLIC + $ + $ + $ + PRIVATE + ${CMAKE_CURRENT_SOURCE_DIR} ) target_compile_features(${MODULE_TARGET_NAME} PUBLIC cxx_std_17) -target_compile_options( - ${MODULE_TARGET_NAME} - PUBLIC $<$:/Zc:preprocessor> -) +target_compile_options(${MODULE_TARGET_NAME} PUBLIC $<$:/Zc:preprocessor>) # common comes directly from asap and is usually kept as is. It is more # convenient to simply use it as asap::common @@ -77,94 +75,97 @@ asap_create_module_config_files() # ------------------------------------------------------------------------------ if(ASAP_BUILD_TESTS) - # Add support for (optional) code quality tools - asap_add_sanitizers(${MODULE_TARGET_NAME}) + # Add support for (optional) code quality tools + asap_add_sanitizers(${MODULE_TARGET_NAME}) - add_subdirectory(test) + add_subdirectory(test) endif() # ------------------------------------------------------------------------------ # API Documentation # ------------------------------------------------------------------------------ -asap_with_doxygen( - MODULE_NAME - ${MODULE_TARGET_NAME} - VERSION - ${META_MODULE_VERSION} - TITLE - "\"Contract Module\"" - BRIEF - "\"Provides an implementation for contract checking in C++.\"" - INPUT_PATH - "${CMAKE_CURRENT_SOURCE_DIR}/src ${CMAKE_CURRENT_SOURCE_DIR}/include" -) +if(ASAP_WITH_DOXYGEN) + asap_with_doxygen( + MODULE_NAME + ${MODULE_TARGET_NAME} + VERSION + ${META_MODULE_VERSION} + TITLE + "\"Contract Module\"" + BRIEF + "\"Provides an implementation for contract checking in C++.\"" + INPUT_PATH + "${CMAKE_CURRENT_SOURCE_DIR}/src ${CMAKE_CURRENT_SOURCE_DIR}/include" + ) +endif() # ============================================================================== # Deployment instructions # ============================================================================== if(${META_PROJECT_ID}_INSTALL) - set(TARGETS_EXPORT_NAME "${MODULE_TARGET_NAME}Targets") - set(runtime "${MODULE_TARGET_NAME}_runtime") - set(dev "${MODULE_TARGET_NAME}_dev") - - # Library + set(TARGETS_EXPORT_NAME "${MODULE_TARGET_NAME}Targets") + set(runtime "${MODULE_TARGET_NAME}_runtime") + set(dev "${MODULE_TARGET_NAME}_dev") + + # Library + install( + TARGETS + ${MODULE_TARGET_NAME} + EXPORT "${TARGETS_EXPORT_NAME}" + COMPONENT + dev + RUNTIME + DESTINATION ${ASAP_INSTALL_BIN} + COMPONENT ${runtime} + LIBRARY + DESTINATION ${ASAP_INSTALL_SHARED} + COMPONENT ${runtime} + ARCHIVE + DESTINATION ${ASAP_INSTALL_LIB} + COMPONENT ${dev} + ) + + # Header files + install( + DIRECTORY + ${CMAKE_CURRENT_SOURCE_DIR}/include/${META_MODULE_NAME} + DESTINATION ${ASAP_INSTALL_INCLUDE} + COMPONENT ${dev} + FILES_MATCHING + PATTERN + "*.h" + ) + + # Generated header files + install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/include/${META_MODULE_NAME} DESTINATION ${ASAP_INSTALL_INCLUDE} COMPONENT ${dev}) + + # Target config + install( + EXPORT ${TARGETS_EXPORT_NAME} + NAMESPACE ${META_PROJECT_NAME}:: + DESTINATION ${ASAP_INSTALL_CMAKE}/${META_MODULE_NAME} + COMPONENT ${dev} + ) + + # Package configuration files + install( + FILES + ${CMAKE_CURRENT_BINARY_DIR}/${MODULE_TARGET_NAME}Config.cmake + ${CMAKE_CURRENT_BINARY_DIR}/${MODULE_TARGET_NAME}ConfigVersion.cmake + DESTINATION ${ASAP_INSTALL_CMAKE}/${META_MODULE_NAME} + ) + + # Docs + if(EXISTS ${SPHINX_BUILD_DIR}/${MODULE_TARGET_NAME}) install( - TARGETS ${MODULE_TARGET_NAME} - EXPORT "${TARGETS_EXPORT_NAME}" - COMPONENT dev - RUNTIME - DESTINATION ${ASAP_INSTALL_BIN} - COMPONENT ${runtime} - LIBRARY - DESTINATION ${ASAP_INSTALL_SHARED} - COMPONENT ${runtime} - ARCHIVE - DESTINATION ${ASAP_INSTALL_LIB} - COMPONENT ${dev} + DIRECTORY + ${SPHINX_BUILD_DIR}/${MODULE_TARGET_NAME} + DESTINATION ${ASAP_INSTALL_DOC} + COMPONENT ${MODULE_TARGET_NAME}_docs ) - - # Header files - install( - DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/include/${META_MODULE_NAME} - DESTINATION ${ASAP_INSTALL_INCLUDE} - COMPONENT ${dev} - FILES_MATCHING - PATTERN "*.h" - ) - - # Generated header files - install( - DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/include/${META_MODULE_NAME} - DESTINATION ${ASAP_INSTALL_INCLUDE} - COMPONENT ${dev} - ) - - # Target config - install( - EXPORT ${TARGETS_EXPORT_NAME} - NAMESPACE ${META_PROJECT_NAME}:: - DESTINATION ${ASAP_INSTALL_CMAKE}/${META_MODULE_NAME} - COMPONENT ${dev} - ) - - # Package configuration files - install( - FILES - ${CMAKE_CURRENT_BINARY_DIR}/${MODULE_TARGET_NAME}Config.cmake - ${CMAKE_CURRENT_BINARY_DIR}/${MODULE_TARGET_NAME}ConfigVersion.cmake - DESTINATION ${ASAP_INSTALL_CMAKE}/${META_MODULE_NAME} - ) - - # Docs - if(EXISTS ${SPHINX_BUILD_DIR}/${MODULE_TARGET_NAME}) - install( - DIRECTORY ${SPHINX_BUILD_DIR}/${MODULE_TARGET_NAME} - DESTINATION ${ASAP_INSTALL_DOC} - COMPONENT ${MODULE_TARGET_NAME}_docs - ) - endif() + endif() endif() asap_pop_module("${my_name}") diff --git a/contract/include/contract/contract.h b/contract/include/asap/contract/contract.h similarity index 99% rename from contract/include/contract/contract.h rename to contract/include/asap/contract/contract.h index fdc95ff..3bed224 100644 --- a/contract/include/contract/contract.h +++ b/contract/include/asap/contract/contract.h @@ -28,7 +28,7 @@ #include #include -#include +#include // ----------------------------------------------------------------------------- // Types used to implement the contract checking macros/apis diff --git a/contract/src/contract.cpp b/contract/src/contract.cpp index 03f1489..2974466 100644 --- a/contract/src/contract.cpp +++ b/contract/src/contract.cpp @@ -15,7 +15,7 @@ #include #include -#include +#include namespace asap::contract { diff --git a/contract/test/CMakeLists.txt b/contract/test/CMakeLists.txt index be670b2..3c13691 100644 --- a/contract/test/CMakeLists.txt +++ b/contract/test/CMakeLists.txt @@ -11,7 +11,7 @@ # If running with google sanitizers, skill all these targets as they are abort # and segmentation fault tests that do not make sense to run under sanitizers if(ASAP_WITH_GOOGLE_ASAN OR ASAP_WITH_GOOGLE_UBSAN OR ASAP_WITH_GOOGLE_TSAN) - return() + return() endif() # ------------------------------------------------------------------------------ @@ -36,8 +36,8 @@ asap_add_test( "test_helper.cpp" "main.cpp" LINK - asap::contract - asap::common + asap.common + asap.contract gtest gmock COMMENT @@ -67,8 +67,8 @@ asap_add_test( "test_helper.cpp" "main.cpp" LINK - asap::contract - asap::common + asap.common + asap.contract gtest gmock COMMENT @@ -98,8 +98,8 @@ asap_add_test( "test_helper.cpp" "main.cpp" LINK - asap::contract - asap::common + asap.common + asap.contract gtest gmock COMMENT diff --git a/contract/test/contract_handlers_test.cpp b/contract/test/contract_handlers_test.cpp index 5a29bab..c4563c3 100644 --- a/contract/test/contract_handlers_test.cpp +++ b/contract/test/contract_handlers_test.cpp @@ -4,11 +4,11 @@ // SPDX-License-Identifier: BSD-3-Clause //===----------------------------------------------------------------------===// -#include "contract/contract.h" - #include #include +#include + using ::testing::IsNull; using ::testing::NotNull; diff --git a/contract/test/contracts_audit_test.cpp b/contract/test/contracts_audit_test.cpp index df40ae0..10b4861 100644 --- a/contract/test/contracts_audit_test.cpp +++ b/contract/test/contracts_audit_test.cpp @@ -8,8 +8,8 @@ #include -#include -#include +#include +#include using asap::contract::testing::TestAssertAudit; using asap::contract::testing::TestAssertDefault; diff --git a/contract/test/contracts_default_test.cpp b/contract/test/contracts_default_test.cpp index ed257ab..cb34c4d 100644 --- a/contract/test/contracts_default_test.cpp +++ b/contract/test/contracts_default_test.cpp @@ -8,8 +8,8 @@ #include -#include -#include +#include +#include using asap::contract::testing::TestAssertAudit; using asap::contract::testing::TestAssertDefault; diff --git a/contract/test/contracts_off_test.cpp b/contract/test/contracts_off_test.cpp index 9df2e50..c38567c 100644 --- a/contract/test/contracts_off_test.cpp +++ b/contract/test/contracts_off_test.cpp @@ -8,8 +8,8 @@ #include -#include -#include +#include +#include using asap::contract::testing::TestAssertAudit; using asap::contract::testing::TestAssertDefault; diff --git a/contract/test/test_helper.cpp b/contract/test/test_helper.cpp index f1f20ec..f2eca12 100644 --- a/contract/test/test_helper.cpp +++ b/contract/test/test_helper.cpp @@ -6,7 +6,7 @@ #include "test_helper.h" -#include +#include namespace asap::contract::testing { diff --git a/templates/version.h.in b/templates/version.h.in index 97ad442..4e9ccca 100644 --- a/templates/version.h.in +++ b/templates/version.h.in @@ -6,23 +6,24 @@ #pragma once -namespace @META_PROJECT_ID_LOWER@ { - namespace info { +namespace asap { + namespace contract { + namespace info { - constexpr auto cProjectName = "@META_PROJECT_NAME@"; - constexpr auto cProjectDescription = "@META_PROJECT_DESCRIPTION@"; + constexpr auto cProjectName = "@META_PROJECT_NAME@"; + constexpr auto cProjectDescription = "@META_PROJECT_DESCRIPTION@"; - constexpr auto cAuthorOrganization = "@META_AUTHOR_ORGANIZATION@"; - constexpr auto cAuthorDomain = "@META_AUTHOR_DOMAIN@"; - constexpr auto cAuthor = "@META_AUTHOR_MAINTAINER@"; + constexpr auto cAuthorOrganization = "@META_AUTHOR_ORGANIZATION@"; + constexpr auto cAuthorDomain = "@META_AUTHOR_DOMAIN@"; + constexpr auto cAuthor = "@META_AUTHOR_MAINTAINER@"; - constexpr auto cVersionMajor = @META_VERSION_MAJOR@; - constexpr auto cVersionMinor = @META_VERSION_MINOR@; - constexpr auto cVersionPatch = @META_VERSION_PATCH@; - constexpr auto cVersionRevision = "@META_VERSION_REVISION@"; + constexpr auto cVersionMajor = @META_VERSION_MAJOR@; + constexpr auto cVersionMinor = @META_VERSION_MINOR@; + constexpr auto cVersionPatch = @META_VERSION_PATCH@; + constexpr auto cVersionRevision = "@META_VERSION_REVISION@"; - constexpr auto cVersion = "@META_VERSION@"; - constexpr auto cNameVersion = "@META_NAME_VERSION@"; - - } // namespace info + constexpr auto cVersion = "@META_VERSION@"; + constexpr auto cNameVersion = "@META_NAME_VERSION@"; + } // namespace info + } // namespace contract } // Namespace @META_PROJECT_ID_LOWER@ diff --git a/third_party/CMakeLists.txt b/third_party/CMakeLists.txt index 4dd2e77..4125e06 100644 --- a/third_party/CMakeLists.txt +++ b/third_party/CMakeLists.txt @@ -38,4 +38,5 @@ asap_add_package( OPTIONS "ASAP_COMMON_INSTALL OFF" "ASAP_BUILD_TESTS OFF" - "ASAP_BUILD_EXAMPLES OFF") + "ASAP_BUILD_EXAMPLES OFF" +) diff --git a/tools/version-info/src/main.cpp.in b/tools/version-info/src/main.cpp.in index bae509c..d1be485 100644 --- a/tools/version-info/src/main.cpp.in +++ b/tools/version-info/src/main.cpp.in @@ -9,7 +9,7 @@ #include <@META_PROJECT_ID_LOWER@/version.h> // clang-format off -using namespace @META_PROJECT_ID_LOWER@::info; +using namespace asap::contract::info; // override the default template // clang-format on auto main(int /*argc*/, char ** /*argv*/) -> int {