Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
de36995
feat: add parallel support
daantimmer Mar 18, 2026
5952264
Add feature hooks support and corresponding tests
daantimmer Mar 18, 2026
f583896
refactor: rename parallel presets to asynchronous and add new configu…
daantimmer Mar 19, 2026
15dd373
fix: change return type to const for test case list in task latch ini…
daantimmer Mar 20, 2026
0d28299
fix: remove unnecessary loop in task creation for test cases
daantimmer Mar 20, 2026
e626bf0
Merge branch 'main' into feature/add-optional-parallel/async-support
daantimmer Mar 20, 2026
6fdada5
feat: add asynchronous support and update CI configurations
daantimmer Mar 20, 2026
54f62ff
fix: update cucumber_gherkin GIT_TAG to unreleased main and remove C+…
daantimmer Mar 20, 2026
52414ff
feat: update CI configuration to support asynchronous build and test …
daantimmer Mar 20, 2026
26cbedb
fix: remove global compile option and conditionally set target compil…
daantimmer Mar 20, 2026
4d126c1
feat: add cache variables for macOS Debug presets to specify Clang co…
daantimmer Mar 20, 2026
dc80b55
fix: update macOS Debug compiler paths to use LLVM 18
daantimmer Mar 20, 2026
3af94f7
refactor: simplify macOS Debug presets by removing redundant cache va…
daantimmer Mar 20, 2026
88e5a82
refactor: replace floating-point literals with integer constants for …
daantimmer Mar 20, 2026
2e7d140
refactor: change floating-point literals to std::size_t for time cons…
daantimmer Mar 20, 2026
66b8724
refactor: rename parameters in Step methods for clarity
daantimmer Mar 20, 2026
a4e3f74
fix: update cucumber_gherkin GIT_TAG to match unrelease PR
daantimmer Mar 20, 2026
a65fee8
refactor: remove unused runPassed member from Application class
daantimmer Mar 20, 2026
dcda946
refactor: mark parameters as maybe unused in step definitions
daantimmer Mar 20, 2026
a4987dc
fix: update cucumber_gherkin GIT_TAG to match unreleased main
daantimmer Mar 23, 2026
963455f
chore: update libcoro to forked version fixing Wall and Wextra being …
daantimmer Mar 29, 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
1 change: 1 addition & 0 deletions .clang-tidy
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ Checks: '
-cppcoreguidelines-pro-bounds-constant-array-index,
-cppcoreguidelines-pro-type-cstyle-cast,
-cppcoreguidelines-special-member-functions,
-cppcoreguidelines-avoid-reference-coroutine-parameters,
misc-*,
-misc-no-recursion,
-misc-non-private-member-variables-in-classes,
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jobs:
container: ghcr.io/philips-software/amp-devcontainer-cpp:v6.8.2@sha256:8d6d0b49bef9b1f572793dee8dcc05edcbe4f44f108f075640dda284ff3e2d4e # v6.8.2
strategy:
matrix:
target: [Host, Windows]
target: [Host, Host-Asynchronous, Windows]
fail-fast: false
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
Expand Down Expand Up @@ -65,8 +65,8 @@ jobs:
max-size: 2G
- uses: lukka/run-cmake@af1be47fd7c933593f687731bc6fdbee024d3ff4 # v10.8
with:
configurePreset: "Host"
buildPreset: "Host-Debug"
configurePreset: "Host-Asynchronous"
buildPreset: "Host-Asynchronous-Debug"
- run: |
bats --formatter junit cucumber_cpp/acceptance_test/test.bats | tee test-report.xml
- uses: EnricoMi/publish-unit-test-result-action@c950f6fb443cb5af20a377fd0dfaa78838901040 # v2.23.0
Expand All @@ -81,7 +81,7 @@ jobs:
matrix:
os: [macos, windows, ubuntu]
version: [latest]
type: [synchronous]
type: [synchronous, asynchronous]
fail-fast: false
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
Expand Down
5 changes: 4 additions & 1 deletion .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,10 @@
"args": [
"--format",
"pretty",
"summary",
// "summary",

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

todo(?)

"--parallel",
"2",
"--fail-fast",
"--retry",
"1",
"--tags",
Expand Down
14 changes: 10 additions & 4 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@ list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}/cmake")

project(cucumber-cpp-runner LANGUAGES C CXX VERSION 4.0.0) # x-release-please-version

set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD_REQUIRED On)
set(CMAKE_CXX_EXTENSIONS Off)

include(ccr_test_helpers)

if (CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR)
Expand All @@ -18,10 +22,12 @@ else()
set(CCR_EXCLUDE_FROM_ALL "EXCLUDE_FROM_ALL")
endif()


option(CCR_FETCH_DEPS "Fetch dependencies via FetchContent." ${CCR_DEFAULTOPT} )
option(CCR_BUILD_TESTS "Enable build of the tests" ${CCR_DEFAULTOPT})
option(CCR_ENABLE_COVERAGE "Enable compiler flags for code coverage measurements" Off)
option(CCR_ENABLE_TIME_PROFILE "Enable compiler flags for time profiling measurements" Off)
option(CCR_ENABLE_PARALLEL_SUPPORT "Enable parallel support through libcoro" Off)

set(CMAKE_POSITION_INDEPENDENT_CODE ON)

Expand Down Expand Up @@ -57,10 +63,6 @@ if (CCR_ENABLE_TIME_PROFILE)
endif()
endif()

set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD_REQUIRED On)
set(CMAKE_CXX_EXTENSIONS Off)

set_directory_properties(PROPERTY USE_FOLDERS ON)

include(FetchContent)
Expand All @@ -78,6 +80,10 @@ else()
find_package(cucumber_gherkin REQUIRED)
find_package(fmt REQUIRED)

if(CCR_ENABLE_PARALLEL_SUPPORT)
find_package(libcoro REQUIRED)
endif()

if (CCR_BUILD_TESTS)
find_package(yaml-cpp REQUIRED)
endif()
Expand Down
143 changes: 141 additions & 2 deletions CMakePresets.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,23 @@
"generator": "Ninja",
"cacheVariables": {
"CMAKE_BUILD_TYPE": "Debug",
"CCR_ENABLE_COVERAGE": "On"
"CCR_ENABLE_COVERAGE": "On",
"CCR_ENABLE_PARALLEL_SUPPORT": "On"
}
},
{
"name": "Host",
"inherits": "defaults",
"generator": "Ninja Multi-Config"
},
{
"name": "Host-Asynchronous",
"inherits": "Host",
"generator": "Ninja Multi-Config",
"cacheVariables": {
"CCR_ENABLE_PARALLEL_SUPPORT": "On"
}
},
{
"name": "host-single-Debug-synchronous",
"hidden": true,
Expand All @@ -57,6 +66,32 @@
"displayName": "Configuration for macOS Debug and Tests, Single Config Generator, synchronous",
"inherits": "host-single-Debug-synchronous"
},
{
"name": "host-single-Debug-asynchronous",
"hidden": true,
"inherits": "defaults",
"generator": "Ninja",
"cacheVariables": {
"CMAKE_BUILD_TYPE": "Debug",
"CCR_ENABLE_PARALLEL_SUPPORT": "On"
}
},
{
"name": "ubuntu-Debug-asynchronous",
"displayName": "Configuration for Linux Debug and Tests, Single Config Generator, asynchronous",
"inherits": "host-single-Debug-asynchronous"
},
{
"name": "windows-Debug-asynchronous",
"displayName": "Configuration for Windows Debug and Tests, Single Config Generator, asynchronous",
"inherits": "host-single-Debug-asynchronous",
"toolchainFile": "${sourceDir}/cmake/Windows.MSVC.toolchain.cmake"
},
{
"name": "macos-Debug-asynchronous",
"displayName": "Configuration for macOS Debug and Tests, Single Config Generator, asynchronous",
"inherits": "host-single-Debug-asynchronous"
},
{
"name": "host-single-time-profile",
"displayName": "Configuration time profiling",
Expand Down Expand Up @@ -86,6 +121,13 @@
"CCACHE_COMPILERTYPE": "clang-cl"
},
"generator": "Ninja Multi-Config"
},
{
"name": "Windows-Asynchronous",
"inherits": "Windows",
"cacheVariables": {
"CCR_ENABLE_PARALLEL_SUPPORT": "On"
}
}
],
"buildPresets": [
Expand All @@ -104,6 +146,17 @@
"configurePreset": "Host",
"jobs": 4
},
{
"name": "Host-Asynchronous-Release",
"configuration": "Release",
"configurePreset": "Host-Asynchronous"
},
{
"name": "Host-Asynchronous-Debug",
"configuration": "Debug",
"configurePreset": "Host-Asynchronous",
"jobs": 4
},
{
"name": "Host-Iwyu-Debug",
"configuration": "Debug",
Expand All @@ -124,6 +177,21 @@
"configuration": "Debug",
"configurePreset": "macos-Debug-synchronous"
},
{
"name": "ubuntu-Debug-asynchronous",
"configuration": "Debug",
"configurePreset": "ubuntu-Debug-asynchronous"
},
{
"name": "windows-Debug-asynchronous",
"configuration": "Debug",
"configurePreset": "windows-Debug-asynchronous"
},
{
"name": "macos-Debug-asynchronous",
"configuration": "Debug",
"configurePreset": "macos-Debug-asynchronous"
},
{
"name": "host-single-time-profile",
"configuration": "Debug",
Expand All @@ -150,7 +218,9 @@
"name": "defaults",
"hidden": true,
"output": {
"outputOnFailure": true
"outputOnFailure": true,
"verbosity": "extra",
"debug": true
},
"execution": {
"noTestsAction": "error",
Expand Down Expand Up @@ -192,6 +262,24 @@
"configurePreset": "macos-Debug-synchronous",
"configuration": "Debug",
"inherits": "defaults"
},
{
"name": "ubuntu-Debug-asynchronous",
"configurePreset": "ubuntu-Debug-asynchronous",
"configuration": "Debug",
"inherits": "defaults"
},
{
"name": "windows-Debug-asynchronous",
"configurePreset": "windows-Debug-asynchronous",
"configuration": "Debug",
"inherits": "defaults"
},
{
"name": "macos-Debug-asynchronous",
"configurePreset": "macos-Debug-asynchronous",
"configuration": "Debug",
"inherits": "defaults"
}
],
"workflowPresets": [
Expand Down Expand Up @@ -245,6 +333,57 @@
"name": "macos-Debug-synchronous"
}
]
},
{
"name": "ubuntu-Debug-asynchronous",
"steps": [
{
"type": "configure",
"name": "ubuntu-Debug-asynchronous"
},
{
"type": "build",
"name": "ubuntu-Debug-asynchronous"
},
{
"type": "test",
"name": "ubuntu-Debug-asynchronous"
}
]
},
{
"name": "windows-Debug-asynchronous",
"steps": [
{
"type": "configure",
"name": "windows-Debug-asynchronous"
},
{
"type": "build",
"name": "windows-Debug-asynchronous"
},
{
"type": "test",
"name": "windows-Debug-asynchronous"
}
]
},
{
"name": "macos-Debug-asynchronous",
"steps": [
{
"type": "configure",
"name": "macos-Debug-asynchronous"
},
{
"type": "build",
"name": "macos-Debug-asynchronous"
},
{
"type": "test",
"name": "macos-Debug-asynchronous"
}
]
}
]
}
2 changes: 1 addition & 1 deletion compatibility/BaseCompatibility.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@ namespace compatibility
auto contextStorageFactory{ std::make_shared<cucumber_cpp::library::ContextStorageFactoryImpl>() };
auto programContext{ std::make_unique<cucumber_cpp::Context>(contextStorageFactory) };

cucumber_cpp::library::util::Broadcaster broadcaster;
cucumber_cpp::library::util::BroadcasterImpl broadcaster;

BroadcastListener broadcastListener{ devkit.ndjsonFile, devkit.ndjsonFile.parent_path() / "expected.ndjson", devkit.ndjsonFile.parent_path() / "actual.ndjson", broadcaster };

Expand Down
4 changes: 2 additions & 2 deletions compatibility/ambiguous/ambiguous.cpp
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
#include "cucumber_cpp/Steps.hpp"
#include <string>

STEP(R"(^a (.*?) with (.*?)$)", (const std::string& arg1, const std::string& arg2))
STEP(R"(^a (.*?) with (.*?)$)", ([[maybe_unused]] const std::string& arg1, [[maybe_unused]] const std::string& arg2))
{
// no-op
}

STEP(R"(^a step with (.*?)$)", (const std::string& arg1))
STEP(R"(^a step with (.*?)$)", ([[maybe_unused]] const std::string& arg1))
{
// no-op
}
2 changes: 1 addition & 1 deletion compatibility/minimal/minimal.cpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#include "cucumber_cpp/Steps.hpp"
#include <cstdint>

STEP(R"(I have {int} cukes in my belly)", (std::int32_t number))
STEP(R"(I have {int} cukes in my belly)", ([[maybe_unused]] std::int32_t number))
{
// no-op
}
2 changes: 1 addition & 1 deletion compatibility/regular-expression/regular-expression.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#include <optional>
#include <string>

STEP(R"(^a (.*?)(?: and a (.*?))?(?: and a (.*?))?$)", (const std::optional<std::string>& vegetable1, const std::optional<std::string>& vegetable2, const std::optional<std::string>& vegetable3))
STEP(R"(^a (.*?)(?: and a (.*?))?(?: and a (.*?))?$)", ([[maybe_unused]] const std::optional<std::string>& vegetable1, [[maybe_unused]] const std::optional<std::string>& vegetable2, [[maybe_unused]] const std::optional<std::string>& vegetable3))
{
// no-op
}
2 changes: 1 addition & 1 deletion compatibility/rules-backgrounds/rules-backgrounds.cpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#include "cucumber_cpp/Steps.hpp"
#include <string>

GIVEN(R"(an order for {string})", (const std::string& order))
GIVEN(R"(an order for {string})", ([[maybe_unused]] const std::string& order))
{
// no-op
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
struct Airport
{};

GIVEN(R"({airport} is closed because of a strike)", (const Airport& airport))
GIVEN(R"({airport} is closed because of a strike)", ([[maybe_unused]] const Airport& airport))
{
FAIL() << "Should not be called because airport parameter type has not been defined";
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
@featurehook
Feature: Test feature hook bindings
Scenario: Run feature hooks before and after
Given a given step
11 changes: 11 additions & 0 deletions cucumber_cpp/acceptance_test/hooks/Hooks.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#include "cucumber_cpp/CucumberCpp.hpp"
#include "cucumber_cpp/Steps.hpp"
#include "gmock/gmock.h"
#include <gtest/gtest.h>
#include <iostream>
Expand All @@ -17,6 +18,16 @@ HOOK_AFTER_ALL()
std::cout << "HOOK_AFTER_ALL\n";
}

HOOK_BEFORE_FEATURE("@featurehook")
{
std::cout << "HOOK_BEFORE_FEATURE\n";
}

HOOK_AFTER_FEATURE("@featurehook")
{
std::cout << "HOOK_AFTER_FEATURE\n";
}

HOOK_BEFORE_SCENARIO("@scenariohook and @bats")
{
std::cout << "HOOK_BEFORE_SCENARIO\n";
Expand Down
2 changes: 1 addition & 1 deletion cucumber_cpp/acceptance_test/steps/Steps.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#include "cucumber_cpp/CucumberCpp.hpp"
#include "cucumber_cpp/Steps.hpp"
#include "fmt/format.h"
#include "gmock/gmock.h"
#include "gtest/gtest.h"
Expand Down
Loading
Loading