From e4c8ba0d8bad06975f3be91fc3ce06132cafad78 Mon Sep 17 00:00:00 2001 From: eyck Date: Thu, 4 Jun 2020 09:46:46 +0200 Subject: [PATCH] add ctest test --- .cproject | 449 ++++++------------ .settings/language.settings.xml | 76 +-- CMakeLists.txt | 210 ++++---- examples/transaction_recording/CMakeLists.txt | 2 + sc-components | 2 +- 5 files changed, 292 insertions(+), 447 deletions(-) diff --git a/.cproject b/.cproject index 82a9744..971e3cb 100644 --- a/.cproject +++ b/.cproject @@ -1,296 +1,163 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + CMAKE_BUILD_TOOL + $<cmake4eclipse_dyn> + test + true + true + true + + + diff --git a/.settings/language.settings.xml b/.settings/language.settings.xml index a6b251d..7ce3aeb 100644 --- a/.settings/language.settings.xml +++ b/.settings/language.settings.xml @@ -1,54 +1,28 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/CMakeLists.txt b/CMakeLists.txt index c73efaf..04e6dd5 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,104 +1,106 @@ -cmake_minimum_required(VERSION 3.12) -set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_CURRENT_SOURCE_DIR}/cmake ${CMAKE_CURRENT_SOURCE_DIR}/sc-components/cmake) - -project(SCC_Test) - -set(ENABLE_SCV TRUE CACHE BOOL "Enable use of SCV") - -set(ENABLE_SHARED TRUE CACHE BOOL "Build shared libraries") - -set(NO_SUBMODULE_CHECK FALSE CACHE BOOL "Disable the submodule check") - -include(GitFunctions) -get_branch_from_git() - -### set the directory names of the submodules -set(GIT_SUBMODULES sc-components) -set(GIT_SUBMODULE_DIR_sc-components .) -### set each submodules's commit or tag that is to be checked out -### (leave empty if you want master) -#set(GIT_SUBMODULE_VERSION_sc-components 3af6b9836589b082c19d9131c5d0b7afa8ddd7cd) -set(GIT_SUBMODULE_BRANCH_sc-components ${GIT_BRANCH}) - -include(GNUInstallDirs) -if(NOT NO_SUBMODULE_CHECK) - include(Submodules) -endif() -include(Conan) -include(BuildType) - -#enable_testing() - -set(CMAKE_CXX_STANDARD 11) -set(CMAKE_CXX_STANDARD_REQUIRED ON) -set(CMAKE_CXX_EXTENSIONS OFF) -set(CMAKE_POSITION_INDEPENDENT_CODE ON) - -include(CheckCXXCompilerFlag) -CHECK_CXX_COMPILER_FLAG("-march=native" COMPILER_SUPPORTS_MARCH_NATIVE) - -if(COMPILER_SUPPORTS_MARCH_NATIVE) - if("${CMAKE_BUILD_TYPE}" STREQUAL "") - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -march=native") - elseif(NOT(${CMAKE_BUILD_TYPE} STREQUAL "RelWithDebInfo")) - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -march=native") - endif() -endif() - -if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU" OR "${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang") - set(warnings "-Wall -Wextra -Werror") - set(CMAKE_CXX_FLAG_RELEASE "-O3 -DNDEBUG") - set(CMAKE_C_FLAG_RELEASE "-O3 -DNDEBUG") -elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC") - set(warnings "/W4 /WX /EHsc") -endif() - -if(ENABLE_COVERAGE) - include(CodeCoverage) - append_coverage_compiler_flags() - set(COVERAGE_EXCLUDES "osci-lib/scc/*" "/engr/dev/tools/*") -endif() - -find_program(CLANG_TIDY_EXE NAMES "clang-tidy-9") -if (CLANG_TIDY_EXE) - message(STATUS "clang-tidy found: ${CLANG_TIDY_EXE}") - set(CLANG_TIDY_CHECKS "-*,modernize-*,-modernize-use-trailing-return-type,clang-analyzer-core.*,clang-analyzer-cplusplus.*") - set(CMAKE_CXX_CLANG_TIDY - ${CLANG_TIDY_EXE}; - -checks=${CLANG_TIDY_CHECKS}; - -fix;) -else() - message(AUTHOR_WARNING "clang-tidy not found!") - set(CMAKE_CXX_CLANG_TIDY "" CACHE STRING "" FORCE) # delete it -endif() - -setup_conan() - -# This line finds the boost lib and headers. -set(Boost_NO_BOOST_CMAKE ON) # Don't do a find_package in config mode before searching for a regular boost install. -find_package(Boost COMPONENTS program_options filesystem system thread REQUIRED) - -# set-up SystemC and SCV -find_package(OSCISystemC) -if(NOT SystemC_FOUND) - message( FATAL_ERROR "SystemC library not found." ) -endif() - -add_subdirectory(sc-components) -add_subdirectory(examples) -add_subdirectory(tests) - -# -# SYSTEM PACKAGING (RPM, TGZ, ...) -# _____________________________________________________________________________ - -#include(CPackConfig) - -# -# CMAKE PACKAGING (for other CMake projects to use this one easily) -# _____________________________________________________________________________ - -#include(PackageConfigurator) - -#include(FeatureSummary) -#feature_summary(WHAT ENABLED_FEATURES DISABLED_FEATURES PACKAGES_FOUND) +cmake_minimum_required(VERSION 3.12) +set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_CURRENT_SOURCE_DIR}/cmake ${CMAKE_CURRENT_SOURCE_DIR}/sc-components/cmake) + +project(SCC_Test) + +set(ENABLE_SCV TRUE CACHE BOOL "Enable use of SCV") + +set(ENABLE_SHARED TRUE CACHE BOOL "Build shared libraries") + +set(NO_SUBMODULE_CHECK FALSE CACHE BOOL "Disable the submodule check") + +include(GitFunctions) +get_branch_from_git() + +### set the directory names of the submodules +set(GIT_SUBMODULES sc-components) +set(GIT_SUBMODULE_DIR_sc-components .) +### set each submodules's commit or tag that is to be checked out +### (leave empty if you want master) +#set(GIT_SUBMODULE_VERSION_sc-components 3af6b9836589b082c19d9131c5d0b7afa8ddd7cd) +set(GIT_SUBMODULE_BRANCH_sc-components ${GIT_BRANCH}) + +include(GNUInstallDirs) +if(NOT NO_SUBMODULE_CHECK) + include(Submodules) +endif() +include(Conan) +include(BuildType) + +#enable_testing() + +set(CMAKE_CXX_STANDARD 11) +set(CMAKE_CXX_STANDARD_REQUIRED ON) +set(CMAKE_CXX_EXTENSIONS OFF) +set(CMAKE_POSITION_INDEPENDENT_CODE ON) + +include(CheckCXXCompilerFlag) +CHECK_CXX_COMPILER_FLAG("-march=native" COMPILER_SUPPORTS_MARCH_NATIVE) + +if(COMPILER_SUPPORTS_MARCH_NATIVE) + if("${CMAKE_BUILD_TYPE}" STREQUAL "") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -march=native") + elseif(NOT(${CMAKE_BUILD_TYPE} STREQUAL "RelWithDebInfo")) + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -march=native") + endif() +endif() + +if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU" OR "${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang") + set(warnings "-Wall -Wextra -Werror") + set(CMAKE_CXX_FLAG_RELEASE "-O3 -DNDEBUG") + set(CMAKE_C_FLAG_RELEASE "-O3 -DNDEBUG") +elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC") + set(warnings "/W4 /WX /EHsc") +endif() + +if(ENABLE_COVERAGE) + include(CodeCoverage) + append_coverage_compiler_flags() + set(COVERAGE_EXCLUDES "osci-lib/scc/*" "/engr/dev/tools/*") +endif() + +find_program(CLANG_TIDY_EXE NAMES "clang-tidy-9") +if (CLANG_TIDY_EXE) + message(STATUS "clang-tidy found: ${CLANG_TIDY_EXE}") + set(CLANG_TIDY_CHECKS "-*,modernize-*,-modernize-use-trailing-return-type,clang-analyzer-core.*,clang-analyzer-cplusplus.*") + set(CMAKE_CXX_CLANG_TIDY + ${CLANG_TIDY_EXE}; + -checks=${CLANG_TIDY_CHECKS}; + -fix;) +else() + message(AUTHOR_WARNING "clang-tidy not found!") + set(CMAKE_CXX_CLANG_TIDY "" CACHE STRING "" FORCE) # delete it +endif() + +setup_conan() + +# This line finds the boost lib and headers. +set(Boost_NO_BOOST_CMAKE ON) # Don't do a find_package in config mode before searching for a regular boost install. +find_package(Boost COMPONENTS program_options filesystem system thread REQUIRED) + +# set-up SystemC and SCV +find_package(OSCISystemC) +if(NOT SystemC_FOUND) + message( FATAL_ERROR "SystemC library not found." ) +endif() + +enable_testing() + +add_subdirectory(sc-components) +add_subdirectory(examples) +add_subdirectory(tests) + +# +# SYSTEM PACKAGING (RPM, TGZ, ...) +# _____________________________________________________________________________ + +#include(CPackConfig) + +# +# CMAKE PACKAGING (for other CMake projects to use this one easily) +# _____________________________________________________________________________ + +#include(PackageConfigurator) + +#include(FeatureSummary) +#feature_summary(WHAT ENABLED_FEATURES DISABLED_FEATURES PACKAGES_FOUND) diff --git a/examples/transaction_recording/CMakeLists.txt b/examples/transaction_recording/CMakeLists.txt index f60d899..42f8db7 100644 --- a/examples/transaction_recording/CMakeLists.txt +++ b/examples/transaction_recording/CMakeLists.txt @@ -3,3 +3,5 @@ add_executable (transaction_recording scv_tr_recording_example.cpp ) target_link_libraries (transaction_recording LINK_PUBLIC scc) + +add_test(NAME tx_rec_test COMMAND transaction_recording) \ No newline at end of file diff --git a/sc-components b/sc-components index 71cab71..ffa9b52 160000 --- a/sc-components +++ b/sc-components @@ -1 +1 @@ -Subproject commit 71cab715b76935bf1559fcf6c1679997fd3ae9e9 +Subproject commit ffa9b526d7f64f7233720d139e7202aaba61895c