Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 33 additions & 0 deletions .github/workflows/dmq_latest.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: DelegateMQ latest

# Builds and tests against DelegateMQ's latest code instead of the pinned
# release (DMQ_GIT_TAG in CMakeLists.txt), so a DelegateMQ change that would
# break this framework shows up before the next DelegateMQ release. It only
# reports: pull requests are checked by the pinned-release workflows.

on:
schedule:
- cron: '0 6 * * 1' # Mondays, 06:00 UTC
workflow_dispatch:
inputs:
dmq_ref:
description: 'DelegateMQ branch or tag to build against'
required: false
default: 'master'

jobs:
build:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v7

- name: Configure CMake
run: cmake -S . -B build -DENABLE_IT=ON -DDMQ_GIT_TAG=${{ github.event.inputs.dmq_ref || 'master' }}

- name: Build
run: cmake --build build

- name: Run IntegrationTestFrameworkApp
run: ./build/IntegrationTestFrameworkApp
71 changes: 39 additions & 32 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,77 +1,83 @@
# Example CMake command line to create project build files:
#
# cmake -B Build . -DENABLE_IT=ON
# cmake -B build . -DENABLE_IT=ON
#
# DelegateMQ is fetched from GitHub at the release tag DMQ_GIT_TAG when CMake
# configures. To build against a local DelegateMQ checkout instead, add
# -DFETCHCONTENT_SOURCE_DIR_DELEGATEMQ=<path>. To configure again without
# network access, add -DFETCHCONTENT_FULLY_DISCONNECTED=ON.

# Specify the minimum CMake version required
cmake_minimum_required(VERSION 3.10)
cmake_minimum_required(VERSION 3.16)

# Project name and language (C or C++)
project(IntegrationTestFramework VERSION 1.0 LANGUAGES CXX)
project(IntegrationTestFramework VERSION 1.1.0 LANGUAGES CXX)

# Set C++ standard
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED True)

# Ensure all libraries use the dynamically linked runtime (/MDd for Debug, /MD for Release)
set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>DLL")

# Set build options (see Predef.cmake)
# Force GoogleTest to use the dynamic runtime libraries
set(gtest_force_shared_crt ON CACHE BOOL "" FORCE)

# DelegateMQ build options, set before DelegateMQ is added
set(DMQ_ASSERTS "OFF") # ON for assert faults
set(DMQ_ALLOCATOR "OFF") # ON for fixed-block allocator
set(DMQ_LOG "OFF") # ON for spglog output
set(DMQ_LOG "OFF") # ON for spdlog output
set(DMQ_UTIL "ON") # ON for delegate utility classes
set(DMQ_THREAD "DMQ_THREAD_STDLIB") # Set thread support library or none
set(DMQ_SERIALIZE "DMQ_SERIALIZE_SERIALIZE") # Set serialization support library or none
set(DMQ_TRANSPORT "DMQ_TRANSPORT_NONE") # Set transport support library or none
include("${CMAKE_SOURCE_DIR}/DelegateMQ/DelegateMQ.cmake")

# Enable integration test build
set (ENABLE_IT "ON")
add_compile_definitions(IT_ENABLE)
# DelegateMQ release to build against
set(DMQ_GIT_TAG "v2.4.1" CACHE STRING "DelegateMQ release tag (or branch) to fetch")

# Set C++ standard
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED True)

# Ensure all libraries use the dynamically linked runtime (/MDd for Debug, /MD for Release)
set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:DebugDLL>")
include(FetchContent)
FetchContent_Declare(
delegatemq
GIT_REPOSITORY https://github.com/DelegateMQ/DelegateMQ.git
GIT_TAG ${DMQ_GIT_TAG}
GIT_SHALLOW TRUE
)
FetchContent_MakeAvailable(delegatemq)

# Force GoogleTest to use the dynamic runtime libraries
set(gtest_force_shared_crt ON CACHE BOOL "" FORCE)
# Enable integration test build
set (ENABLE_IT "ON")

# Collect all .cpp and *.h source files in the current directory
file(GLOB SOURCES "*.cpp" "*.h")

# Collect DelegateMQ predef source files
list(APPEND SOURCES ${DMQ_PORT_SOURCES})

# Organize delegate source files within IDE (Visual Studio)
source_group("Delegate Files" FILES ${DMQ_LIB_SOURCES})
source_group("Port Files" FILES ${DMQ_PORT_ONLY_SOURCES})
source_group("Extras Files" FILES ${DMQ_EXTRAS_SOURCES})

# Platform-specific linker flags
if(CMAKE_CXX_COMPILER_ID MATCHES "GNU|Clang")
# GCC/Clang: Use --no-as-needed to prevent the removal of unused libraries
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,--no-as-needed")
endif()

# Define the IT_ENABLE macro for the IntegrationTestFrameworkApp target
# Define the IT_ENABLE macro when building integration tests
if (ENABLE_IT)
add_compile_definitions(IT_ENABLE)
endif()

# Add subdirectories to include path
include_directories(
include_directories(
${CMAKE_SOURCE_DIR}/Logger/src
${CMAKE_SOURCE_DIR}/Port/src
)

# Add subdirectories to include path if building integration tests
if (ENABLE_IT)
include_directories(
${DMQ_ROOT_DIR}
${CMAKE_SOURCE_DIR}/Logger/it
${CMAKE_SOURCE_DIR}/IntegrationTest
${CMAKE_SOURCE_DIR}/GoogleTest/googletest/include
)
endif()

# Add an executable target
add_executable(IntegrationTestFrameworkApp ${SOURCES} ${DMQ_LIB_SOURCES})
add_executable(IntegrationTestFrameworkApp ${SOURCES})

# Add subdirectories to build (product related code)
add_subdirectory(Logger/src)
Expand All @@ -84,16 +90,17 @@ if (ENABLE_IT)
add_subdirectory(GoogleTest)
endif()

target_link_libraries(IntegrationTestFrameworkApp PRIVATE
target_link_libraries(IntegrationTestFrameworkApp PRIVATE
LoggerLib
PortLib
DelegateMQ::DelegateMQ
)

if (ENABLE_IT)
target_link_libraries(IntegrationTestFrameworkApp PRIVATE
target_link_libraries(IntegrationTestFrameworkApp PRIVATE
Logger_ITLib
IntegrationTestLib
gtest
gtest_main
)
endif()
endif()
40 changes: 0 additions & 40 deletions DelegateMQ/Common.cmake

This file was deleted.

127 changes: 0 additions & 127 deletions DelegateMQ/Defaults.cmake

This file was deleted.

Loading