Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
206f412
feat: add plugin support
daantimmer Jul 24, 2026
2e16fea
Rework compatibility tests in to plugins
daantimmer Jul 24, 2026
9a88e4c
some cleanup
daantimmer Jul 24, 2026
47f8e64
fix include guards
daantimmer Jul 24, 2026
2e05c2e
use libraries.clear()
daantimmer Jul 24, 2026
14beb62
Add flow and object diagramas
daantimmer Jul 24, 2026
67d9469
Implement dynamic plugin support with snapshot management in Definiti…
daantimmer Jul 24, 2026
50e9bdd
Suppress character conversion warnings for Clang in GoogleTest targets
daantimmer Jul 24, 2026
6ecc6d7
Fix gtest discovery condition to exclude cross-compiling
daantimmer Jul 24, 2026
3540749
Change execution behavior to continue on failure in CMake presets
daantimmer Jul 24, 2026
5c3cb0a
Update include directories in ccr_plugin_register and ccr_add_plugin …
daantimmer Jul 24, 2026
4a4e2e2
solve loading plugins on windows
daantimmer Jul 24, 2026
a4d5c7f
resolve parameter registration for plugins for windows
daantimmer Jul 24, 2026
7391e56
chain plugin registration for windows instead
daantimmer Jul 24, 2026
4d43d69
fix macos build?
daantimmer Jul 24, 2026
6aab179
Add missing link for fmt::fmt in ccr_plugin_register
daantimmer Jul 24, 2026
857f3e5
Set .dylib suffix for Apple plugin targets
daantimmer Jul 24, 2026
527ca60
Clear converter type map and unregister plugins before unloading libr…
daantimmer Jul 24, 2026
bbb06e8
also test for timestamps and durations
daantimmer Jul 24, 2026
60ab2b1
move ccache detection to root CMakeLists
daantimmer Jul 24, 2026
308bdbd
Add PluginHostContext and update registration mechanism for plugins
daantimmer Jul 24, 2026
281ceb2
working on getting error reporting to be shared between
daantimmer Jul 24, 2026
971e3af
execute the CucumberResultReporter in the body of a step/hook
daantimmer Jul 24, 2026
9c46922
delete actual_run from examples-tables
daantimmer Jul 25, 2026
43c02eb
Refactor converter map handling in PluginRegister to avoid unnecessar…
daantimmer Jul 25, 2026
fe4a0d8
Add plugin support with ABI versioning and snapshot management
daantimmer Jul 25, 2026
0a1992e
Enhance readability settings in .clang-tidy for identifier naming con…
daantimmer Jul 25, 2026
a466374
Implement PluginSession management for dynamic library loading and un…
daantimmer Jul 25, 2026
dd77a97
Refactor method names in ConverterTypeMap for consistency and clarity
daantimmer Jul 25, 2026
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
13 changes: 13 additions & 0 deletions .clang-tidy
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,17 @@ HeaderFilterRegex: '.*'
FormatStyle: file
CheckOptions:
AllowSoleDefaultDtor: true
# readability-identifier-naming
readability-identifier-naming.NamespaceCase: lower_case
readability-identifier-naming.StructCase: CamelCase
readability-identifier-naming.ClassCase: CamelCase
readability-identifier-naming.EnumCase: CamelCase
readability-identifier-naming.EnumConstantCase: camelBack
readability-identifier-naming.MemberCase: camelBack
readability-identifier-naming.ParameterCase: camelBack
readability-identifier-naming.VariableCase: camelBack
readability-identifier-naming.FunctionCase: CamelCase
readability-identifier-naming.MethodCase: CamelCase
readability-identifier-naming.TypeAliasCase: CamelCase
readability-identifier-naming.TypedefCase: CamelCase
...
4 changes: 2 additions & 2 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
"cmake.useCMakePresets": "always",
"cucumberautocomplete.steps": [
"compatibility/*/*.cpp",
"cucumber_cpp/example/steps/*.cpp",
"cucumber_cpp/acceptance_test/steps/*.cpp"
"cucumber_cpp/example/*/*.cpp",
"cucumber_cpp/acceptance_test/*/*.cpp"
],
"cucumberautocomplete.gherkinDefinitionPart": "(GIVEN|WHEN|THEN|STEP)\\(",
"cucumberautocomplete.customParameters": [
Expand Down
13 changes: 13 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,19 @@ set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD_REQUIRED On)
set(CMAKE_CXX_EXTENSIONS Off)

# Compiler cache
find_program(CCACHE_PROGRAM ccache)
if(CCACHE_PROGRAM)
set(CMAKE_CXX_COMPILER_LAUNCHER "${CCACHE_PROGRAM}")
message(STATUS "Using ccache: ${CCACHE_PROGRAM}")
else()
find_program(SCCACHE_PROGRAM sccache)
if(SCCACHE_PROGRAM)
set(CMAKE_CXX_COMPILER_LAUNCHER "${SCCACHE_PROGRAM}")
message(STATUS "Using sccache: ${SCCACHE_PROGRAM}")
endif()
endif()

set_directory_properties(PROPERTY USE_FOLDERS ON)

include(FetchContent)
Expand Down
6 changes: 2 additions & 4 deletions CMakePresets.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,7 @@
"installDir": "${sourceDir}/.install/${presetName}",
"cacheVariables": {
"CMAKE_EXPORT_COMPILE_COMMANDS": "On",
"CMAKE_CONFIGURATION_TYPES": "Debug;RelWithDebInfo;Release",
"CMAKE_C_COMPILER_LAUNCHER": "ccache",
"CMAKE_CXX_COMPILER_LAUNCHER": "ccache"
"CMAKE_CONFIGURATION_TYPES": "Debug;RelWithDebInfo;Release"
}
},
{
Expand Down Expand Up @@ -194,7 +192,7 @@
},
"execution": {
"noTestsAction": "error",
"stopOnFailure": true
"stopOnFailure": false
}
},
{
Expand Down
64 changes: 64 additions & 0 deletions cmake/ccr_add_plugin.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
# Helper function for creating cucumber-cpp-runner plugin targets
#
# Usage:
# ccr_add_plugin(my_plugin)
# ccr_add_plugin(my_plugin step1.cpp step2.cpp hooks.cpp)
#
# Creates a MODULE library target suitable for dynamic loading via --load.
# Plugins use the same STEP/HOOK/PARAMETER macros as statically-linked code.
# All symbols resolve from the host executable at runtime (ENABLE_EXPORTS).
# On macOS, -undefined dynamic_lookup suppresses linker errors for host symbols.
# On Windows, the plugin links against the host executable's import library.
#
# The default ccr_register entry point is provided automatically via
# ccr_plugin_register. Plugins do not need to define it themselves.
#
# Sources can be passed directly (like add_library) or added later via
# target_sources.

# Object library providing the default ccr_register entry point.
# Built once and linked into every plugin created by ccr_add_plugin.
if (NOT TARGET ccr_plugin_register)
add_library(ccr_plugin_register OBJECT
${CMAKE_CURRENT_LIST_DIR}/../cucumber_cpp/library/plugin/PluginRegister.cpp
)
target_include_directories(ccr_plugin_register SYSTEM PRIVATE
$<TARGET_PROPERTY:cucumber_cpp,INTERFACE_INCLUDE_DIRECTORIES>
$<TARGET_PROPERTY:cucumber_cpp.library,INCLUDE_DIRECTORIES>
)
target_link_libraries(ccr_plugin_register PRIVATE fmt::fmt)
set_target_properties(ccr_plugin_register PROPERTIES
CXX_VISIBILITY_PRESET default
)
endif()

function(ccr_add_plugin TARGET_NAME)
add_library(${TARGET_NAME} MODULE ${ARGN} $<TARGET_OBJECTS:ccr_plugin_register>)

# Plugins need the header include paths from cucumber_cpp and its
# transitive dependencies (fmt, gtest, gherkin, etc.) but must NOT link
# the actual libraries — symbols resolve from the host at runtime.
target_include_directories(${TARGET_NAME} SYSTEM PRIVATE
$<TARGET_PROPERTY:cucumber_cpp,INTERFACE_INCLUDE_DIRECTORIES>
$<TARGET_PROPERTY:cucumber_cpp.library,INCLUDE_DIRECTORIES>
)
Comment thread
daantimmer marked this conversation as resolved.

target_compile_definitions(${TARGET_NAME} PRIVATE
$<TARGET_PROPERTY:cucumber_cpp.library,COMPILE_DEFINITIONS>
)

if (WIN32)
target_link_libraries(${TARGET_NAME} PRIVATE cucumber_cpp)
elseif (APPLE)
target_link_options(${TARGET_NAME} PRIVATE -undefined dynamic_lookup)
endif()

set_target_properties(${TARGET_NAME} PROPERTIES
PREFIX ""
CXX_VISIBILITY_PRESET default
)

if (APPLE)
set_target_properties(${TARGET_NAME} PROPERTIES SUFFIX ".dylib")
endif()
endfunction()
2 changes: 2 additions & 0 deletions cmake/dependencies.cpm.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,8 @@ if(CCR_FETCH_DEPS)
set_target_properties(gtest gtest_main gmock gmock_main PROPERTIES
FOLDER External/GoogleTest
)
target_compile_options(gtest PRIVATE $<$<CXX_COMPILER_ID:Clang,AppleClang>:-Wno-character-conversion>)
target_compile_options(gmock PRIVATE $<$<CXX_COMPILER_ID:Clang,AppleClang>:-Wno-character-conversion>)
endif()

# ---------------------------------------------------------------------------
Expand Down
Loading
Loading