Repository: cucumber/cucumber-cpp Branch: main Commit: fedcaeab5382 Files: 129 Total size: 244.6 KB Directory structure: gitextract_c6fituri/ ├── .clang-format ├── .github/ │ ├── ISSUE_TEMPLATE.md │ ├── PULL_REQUEST_TEMPLATE.md │ └── workflows/ │ ├── format.yml │ ├── linux-build.yml │ ├── qt5.yml │ ├── run-all.yml │ ├── windows-build.yml │ └── zizmor-analysis.yaml ├── .gitignore ├── CHANGELOG.md ├── CMakeLists.txt ├── CONTRIBUTING.md ├── Gemfile ├── LICENSE ├── README.md ├── cmake/ │ └── modules/ │ ├── FindAsio.cmake │ ├── FindTCLAP.cmake │ ├── FindValgrind.cmake │ └── GitVersion.cmake ├── examples/ │ ├── CMakeLists.txt │ ├── Calc/ │ │ ├── CMakeLists.txt │ │ ├── README.txt │ │ ├── features/ │ │ │ ├── addition.feature │ │ │ ├── division.feature │ │ │ └── step_definitions/ │ │ │ ├── BoostCalculatorSteps.cpp │ │ │ ├── CalculatorSteps.cpp │ │ │ ├── FuncArgsCalculatorSteps.cpp │ │ │ ├── GTestCalculatorSteps.cpp │ │ │ ├── QtTestCalculatorSteps.cpp │ │ │ └── cucumber.wire │ │ └── src/ │ │ ├── Calculator.cpp │ │ └── Calculator.hpp │ ├── CalcQt/ │ │ ├── CMakeLists.txt │ │ ├── README.txt │ │ ├── features/ │ │ │ ├── addition.feature │ │ │ ├── behavior.feature │ │ │ ├── initialization.feature │ │ │ ├── step_definitions/ │ │ │ │ ├── BoostCalculatorQtSteps.cpp │ │ │ │ ├── CalculatorQtSteps.cpp │ │ │ │ ├── GTestCalculatorQtSteps.cpp │ │ │ │ ├── QtTestCalculatorQtSteps.cpp │ │ │ │ └── cucumber.wire │ │ │ └── subtraction.feature │ │ └── src/ │ │ ├── CalcQt.cpp │ │ ├── Calculator.cpp │ │ ├── Calculator.hpp │ │ ├── CalculatorWidget.cpp │ │ └── CalculatorWidget.hpp │ └── FeatureShowcase/ │ ├── CMakeLists.txt │ ├── README.txt │ └── features/ │ ├── step_definitions/ │ │ ├── TableSteps.cpp │ │ ├── TagSteps.cpp │ │ └── cucumber.wire │ ├── table.feature │ └── tag.feature ├── include/ │ └── cucumber-cpp/ │ ├── autodetect.hpp │ ├── defs.hpp │ ├── generic.hpp │ └── internal/ │ ├── ContextManager.hpp │ ├── CukeCommands.hpp │ ├── CukeEngine.hpp │ ├── CukeEngineImpl.hpp │ ├── Macros.hpp │ ├── RegistrationMacros.hpp │ ├── Scenario.hpp │ ├── Table.hpp │ ├── connectors/ │ │ └── wire/ │ │ ├── ProtocolHandler.hpp │ │ ├── WireProtocol.hpp │ │ ├── WireProtocolCommands.hpp │ │ └── WireServer.hpp │ ├── defs.hpp │ ├── drivers/ │ │ ├── BoostDriver.hpp │ │ ├── DriverSelector.hpp │ │ ├── GTestDriver.hpp │ │ ├── GenericDriver.hpp │ │ └── QtTestDriver.hpp │ ├── hook/ │ │ ├── HookMacros.hpp │ │ ├── HookRegistrar.hpp │ │ └── Tag.hpp │ ├── step/ │ │ ├── StepMacros.hpp │ │ └── StepManager.hpp │ └── utils/ │ ├── IndexSequence.hpp │ └── Regex.hpp ├── run-linux.sh ├── run-windows.ps1 ├── src/ │ ├── CMakeLists.txt │ ├── ContextManager.cpp │ ├── CukeCommands.cpp │ ├── CukeEngine.cpp │ ├── CukeEngineImpl.cpp │ ├── HookRegistrar.cpp │ ├── Regex.cpp │ ├── Scenario.cpp │ ├── StepManager.cpp │ ├── Table.cpp │ ├── Tag.cpp │ ├── connectors/ │ │ └── wire/ │ │ ├── WireProtocol.cpp │ │ ├── WireProtocolCommands.cpp │ │ └── WireServer.cpp │ ├── drivers/ │ │ ├── BoostDriver.cpp │ │ ├── GTestDriver.cpp │ │ ├── GenericDriver.cpp │ │ └── QtTestDriver.cpp │ └── main.cpp └── tests/ ├── CMakeLists.txt ├── integration/ │ ├── ContextHandlingTest.cpp │ ├── HookRegistrationTest.cpp │ ├── StepRegistrationTest.cpp │ ├── TaggedHookRegistrationTest.cpp │ ├── WireProtocolTest.cpp │ ├── WireServerTest.cpp │ └── drivers/ │ ├── BoostDriverTest.cpp │ ├── GTestDriverTest.cpp │ ├── GenericDriverTest.cpp │ └── QtTestDriverTest.cpp ├── unit/ │ ├── BasicStepTest.cpp │ ├── ContextManagerTest.cpp │ ├── CukeCommandsTest.cpp │ ├── RegexTest.cpp │ ├── StepCallChainTest.cpp │ ├── StepManagerTest.cpp │ ├── TableTest.cpp │ └── TagTest.cpp └── utils/ ├── ContextManagerTestDouble.hpp ├── CukeCommandsFixture.hpp ├── DriverTestRunner.hpp ├── HookRegistrationFixture.hpp └── StepManagerTestDouble.hpp ================================================ FILE CONTENTS ================================================ ================================================ FILE: .clang-format ================================================ --- Language: Cpp AccessModifierOffset: -4 AlignAfterOpenBracket: BlockIndent AlignEscapedNewlinesLeft: true AllowShortEnumsOnASingleLine: false AllowShortFunctionsOnASingleLine: None AlwaysBreakTemplateDeclarations: true BinPackArguments: false BinPackParameters: false BreakBeforeBinaryOperators: All BreakBeforeBraces: Attach BreakConstructorInitializers: AfterColon ColumnLimit: 100 FixNamespaceComments: true IncludeCategories: # The autodetect header should always be included last - Regex: '^$' Priority: 3 - Regex: '^["<]cucumber-cpp/' Priority: 1 - Regex: '.*' Priority: 2 IndentPPDirectives: BeforeHash IndentWidth: 4 NamespaceIndentation: None PackConstructorInitializers: Never PenaltyBreakString: 1000 PenaltyExcessCharacter: 10000 PenaltyReturnTypeOnItsOwnLine: 1000 PointerAlignment: Left ShortNamespaceLines: 200 SortIncludes: false SpaceAfterTemplateKeyword: false SpaceBeforeAssignmentOperators: true SpaceBeforeParens: ControlStatements Standard: Cpp11 ... ================================================ FILE: .github/ISSUE_TEMPLATE.md ================================================ ## Summary ## Expected Behavior ## Current Behavior ~~~ ~~~ ## Possible Solution ## Steps to Reproduce (for bugs) 1. 2. 3. 4. ## Context & Motivation ## Your Environment * Version used: * Operating System and version: * Link to your project: ================================================ FILE: .github/PULL_REQUEST_TEMPLATE.md ================================================ ## Summary ## Details ## Motivation and Context ## How Has This Been Tested? ## Types of changes - [ ] Bug fix (non-breaking change which fixes an issue). - [ ] New feature (non-breaking change which adds functionality). - [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected). ## Checklist: - [ ] It is my own work, its copyright is implicitly assigned to the project and no substantial part of it has been copied from other sources (including [Stack Overflow](https://stackoverflow.com/)). In rare occasions this is acceptable, like in CMake modules where the original copyright information should be kept. - [ ] I'm using the same code standards as the existing code (indentation, spacing, variable naming, ...). - [ ] I've added tests for my code. - [ ] I have verified whether my change requires changes to the documentation - [ ] My change either requires no documentation change or I've updated the documentation accordingly. - [ ] My branch has been rebased to main, keeping only relevant commits. ================================================ FILE: .github/workflows/format.yml ================================================ name: check format permissions: {} on: pull_request: branches: [ main ] workflow_dispatch: push: branches: - main concurrency: group: ${{ github.workflow }}-${{ github.head_ref || github.ref || github.run_id }} cancel-in-progress: true jobs: build: runs-on: ubuntu-22.04 steps: - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 with: persist-credentials: false - name: setup environment run: | sudo apt-get install --no-install-recommends \ clang-format-15 - name: check code format run: | clang-format-15 --style=file --Werror --dry-run --verbose `find . -type d \( -name '3rdparty' \) -prune -o -regex '.*\.\(cpp\|hpp\)' -print` ================================================ FILE: .github/workflows/linux-build.yml ================================================ name: Linux build permissions: {} on: pull_request: branches: [ main ] workflow_dispatch: push: branches: - main concurrency: group: ${{ github.workflow }}-${{ github.head_ref || github.ref || github.run_id }} cancel-in-progress: true jobs: build: strategy: matrix: cpp-compiler: - g++ - clang++-15 cpp-standard: - 17 - 20 runs-on: ubuntu-22.04 steps: - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 with: persist-credentials: false - name: setup environment run: | sudo apt-get install --no-install-recommends \ clang-15 \ cmake \ g++ \ git \ libasio-dev \ libboost-test-dev \ libgl1-mesa-dev \ libtclap-dev \ ninja-build \ nlohmann-json3-dev \ qt6-base-dev - name: install gtest run: | git clone https://github.com/google/googletest.git cd googletest mkdir build cd build cmake \ .. cmake --build . --parallel sudo cmake --install . - name: build run: | cmake -E make_directory build cmake -E chdir build cmake \ -DCMAKE_CXX_COMPILER=${{ matrix.cpp-compiler }} \ -DCMAKE_CXX_STANDARD=${{ matrix.cpp-standard }} \ -G Ninja \ -DCUKE_STRICT=on \ -DCUKE_ENABLE_BOOST_TEST=on \ -DCUKE_ENABLE_GTEST=on \ -DCUKE_ENABLE_QT_6=on \ -DCUKE_ENABLE_EXAMPLES=on \ -DCUKE_TESTS_UNIT=on \ .. cmake --build build --parallel --verbose - name: unit tests run: | cmake --build build --target test ================================================ FILE: .github/workflows/qt5.yml ================================================ name: build and test with Qt5 permissions: {} on: pull_request: branches: [ main ] workflow_dispatch: push: branches: - main concurrency: group: ${{ github.workflow }}-${{ github.head_ref || github.ref || github.run_id }} cancel-in-progress: true jobs: build: runs-on: ubuntu-22.04 steps: - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 with: persist-credentials: false - name: setup environment run: | sudo apt-get install --no-install-recommends \ cmake \ g++ \ git \ libasio-dev \ libboost-test-dev \ libtclap-dev \ ninja-build \ nlohmann-json3-dev \ qtbase5-dev \ ruby \ ruby-dev - name: install ruby tools run: | sudo gem install bundler sudo bundle install - name: install gtest run: | git clone https://github.com/google/googletest.git cd googletest mkdir build cd build cmake ../ cmake --build . --parallel sudo cmake --install . - name: build run: | cmake -E make_directory build cmake -E chdir build cmake \ -G Ninja \ -DCUKE_STRICT=on \ -DCUKE_ENABLE_BOOST_TEST=on \ -DCUKE_ENABLE_GTEST=on \ -DCUKE_ENABLE_QT_5=on \ -DCUKE_ENABLE_EXAMPLES=on \ -DCUKE_TESTS_UNIT=on \ .. cmake --build build --parallel --verbose - name: unit tests run: | cmake --build build --target test - name: QtCalc examples run: | for TEST in \ build/examples/CalcQt/GTestCalculatorQtSteps \ build/examples/CalcQt/QtTestCalculatorQtSteps \ build/examples/CalcQt/BoostCalculatorQtSteps \ ; do "${TEST}" 2> /dev/null & sleep 1 (cd examples/CalcQt; cucumber) wait % done ================================================ FILE: .github/workflows/run-all.yml ================================================ name: run all permissions: {} on: pull_request: branches: [ main ] workflow_dispatch: push: branches: - main concurrency: group: ${{ github.workflow }}-${{ github.head_ref || github.ref || github.run_id }} cancel-in-progress: true jobs: build-linux: runs-on: ubuntu-22.04 steps: - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 with: persist-credentials: false - name: update package index run: sudo apt-get -y update - name: setup environment run: | sudo apt-get install --no-install-recommends \ cmake \ g++ \ gcovr \ git \ libasio-dev \ libboost-test-dev \ libgl1-mesa-dev \ libtclap-dev \ ninja-build \ nlohmann-json3-dev \ qt6-base-dev \ ruby \ ruby-dev - name: install ruby tools run: | sudo gem install bundler sudo bundle install - name: install gtest run: | git clone https://github.com/google/googletest.git cd googletest mkdir build cd build cmake ../ cmake --build . --parallel sudo cmake --install . - name: build and run run: | ./run-linux.sh - name: code coverage summary report uses: irongut/CodeCoverageSummary@51cc3a756ddcd398d447c044c02cb6aa83fdae95 #v1.3.0 with: filename: coverage/cobertura.xml indicators: false hide_complexity: true format: markdown output: file - name: publish code coverage summary run: | echo '# Code Coverage Report' >> $GITHUB_STEP_SUMMARY cat code-coverage-results.md >> $GITHUB_STEP_SUMMARY ================================================ FILE: .github/workflows/windows-build.yml ================================================ name: Windows build permissions: {} on: pull_request: branches: [ main ] workflow_dispatch: push: branches: - main concurrency: group: ${{ github.workflow }}-${{ github.head_ref || github.ref || github.run_id }} cancel-in-progress: true jobs: build: strategy: matrix: cpp-standard: - 17 - 20 # You can find specific tool versions for Windows builds in the Runner specification: # https://github.com/actions/runner-images/blob/main/images/windows/Windows2022-Readme.md # In particular, this build uses: # cmake: 3.27.9 # VSCode: 2022 Enterprise Edition (corresponding C++ version: https://blog.knatten.org/2022/08/26/microsoft-c-versions-explained/) # Ruby: 3.0.6p216 # boost: 1.82.0 runs-on: windows-2022 env: BOOST_VERSION: 1.82.0 NLOHMANN_CLONE_DIR: nlohmann NLOHMANN_TAG: v3.11.3 ASIO_CLONE_DIR: asio ASIO_TAG: asio-1-29-0 TCLAP_CLONE_DIR: tclap TCLAP_TAG: v1.2.5 steps: - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 with: persist-credentials: false - name: install ruby tools run: | gem install bundler bundle install # - name: Install Google Test # uses: MarkusJx/googletest-installer@v1.1 - name: Restore cached boost dependencies id: cache-boost-deps uses: actions/cache@6f8efc29b200d32929f49075959781ed54ec270c #v3.5.0 with: path: | boost_1_82_0 key: ${{ runner.os }}-boost-1820 - name: install boost if: steps.cache-boost-deps.outputs.cache-hit != 'true' run: | $boost_version_str = ${Env:BOOST_VERSION}.Replace(".","_") $boost_url = "https://archives.boost.io/release/${Env:BOOST_VERSION}/source/boost_${boost_version_str}.zip" $ProgressPreference = 'SilentlyContinue' Write-Host "Downloading Boost from $boost_url" Invoke-WebRequest -Uri $boost_url -OutFile boost_${boost_version_str}.zip 7z x boost_${boost_version_str}.zip Write-Host "Unzipped directory content:" Get-ChildItem -Directory cd boost_${boost_version_str} cmd /C bootstrap ./b2.exe --build-type=complete toolset=msvc --with-regex --with-program_options --with-system --with-test - name: Get and build nlohmann-json run: | Start-Process "git" -ArgumentList "clone https://github.com/nlohmann/json.git $Env:NLOHMANN_CLONE_DIR --depth 1 --branch $Env:NLOHMANN_TAG" -PassThru -NoNewWindow -Wait cd $Env:NLOHMANN_CLONE_DIR cmake -B build -S . cd .. - name: Get ASIO run: Start-Process "git" -ArgumentList "clone https://github.com/chriskohlhoff/asio.git $Env:ASIO_CLONE_DIR --depth 1 --branch $Env:ASIO_TAG" -PassThru -NoNewWindow -Wait - name: Get TCLAP run: Start-Process "git" -ArgumentList "clone https://github.com/mirror/tclap.git $Env:TCLAP_CLONE_DIR --depth 1 --branch $Env:TCLAP_TAG" -PassThru -NoNewWindow -Wait - name: build and run run: | $current_script_dir = Get-Location | Select-Object -Expand "Path" $Env:nlohmann_json_DIR = "${current_script_dir}/$Env:NLOHMANN_CLONE_DIR/build" $Env:Asio_ROOT = "${current_script_dir}/$Env:ASIO_CLONE_DIR/asio" $Env:TCLAP_ROOT = "${current_script_dir}/$Env:TCLAP_CLONE_DIR" $Env:cpp_standard = ${{ matrix.cpp-standard }} ./run-windows.ps1 ================================================ FILE: .github/workflows/zizmor-analysis.yaml ================================================ name: GitHub Actions Security Analysis on: push: branches: - main - 'releases/**' paths: - '.github/**' pull_request: paths: - '.github/**' permissions: {} jobs: zizmor: name: Run Zizmor runs-on: ubuntu-latest permissions: security-events: write steps: - name: Checkout repository uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 with: persist-credentials: false - name: Run Zizmor uses: zizmorcore/zizmor-action@71321a20a9ded102f6e9ce5718a2fcec2c4f70d8 # v0.5.2 ================================================ FILE: .gitignore ================================================ # Bundler /Gemfile.lock # rvm /.ruby-version /.ruby-gemset # Build artifacts /build/ /coverage/ /.local/ # vim swap files *.swp # CLion /.idea /cmake-build-*/ # Qt Creator /CMakeLists.txt.user # build folder build ================================================ FILE: CHANGELOG.md ================================================ Please see [CONTRIBUTING.md](https://github.com/cucumber/cucumber/blob/main/CONTRIBUTING.md) on how to contribute to Cucumber. ## [0.8.0](https://github.com/cucumber/cucumber-cpp/compare/v0.7.0...v0.8.0) (07 January 2026) ### Added * Qt6 support ([#283](https://github.com/cucumber/cucumber-cpp/pull/283) Urs Fässler) * Windows CI support ([#288](https://github.com/cucumber/cucumber-cpp/pull/288) Christoph Wellm) * Test compilation with different compilers and language standards on Linux ([#282](https://github.com/cucumber/cucumber-cpp/pull/282) Urs Fässler) * Test to fail the build for deprecated asio features ([72e5fa9](https://github.com/cucumber/cucumber-cpp/commit/72e5fa9ff643d90a513bff57f7322606ecaf4270) Shirzart Enwer) ### Changed * Only enable minimal set of CMake options by default ([#281](https://github.com/cucumber/cucumber-cpp/pull/281) Urs Fässler) * Use CMake option for strict checks ([#310](https://github.com/cucumber/cucumber-cpp/pull/310) Joerg Kreuzberger) * Only treat compilation warnings as error in CI ([#301](https://github.com/cucumber/cucumber-cpp/pull/301) Joerg Kreuzberger) * Remove support for Qt4 ([#283](https://github.com/cucumber/cucumber-cpp/pull/283) Urs Fässler) * CalcQt example improvements ([#283](https://github.com/cucumber/cucumber-cpp/pull/283) Urs Fässler) * Update README with explanation how it works ([#291](https://github.com/cucumber/cucumber-cpp/pull/291) erichstuder) * Adjust links and information regarding where to get help ([#306](https://github.com/cucumber/cucumber-cpp/pull/306) Joerg Kreuzberger) * Use https for all links in README ([0911bd2](https://github.com/cucumber/cucumber-cpp/commit/0911bd265bf0b484d5661f4163074714868cc77b) Joerg Kreuzberger) ### Fixed * Support asio 1.33 ([#308](https://github.com/cucumber/cucumber-cpp/pull/308) Shirzart Enwer) * Boost download source fixed ([#309](https://github.com/cucumber/cucumber-cpp/pull/309) Shirzart Enwer) * Windows QtTestDriver ([#305](https://github.com/cucumber/cucumber-cpp/pull/305) Joerg Kreuzberger) * Flaky QtTestDriver test ([#296](https://github.com/cucumber/cucumber-cpp/pull/296) Joerg Kreuzberger) * Links to website and discussion group in README ([#299](https://github.com/cucumber/cucumber-cpp/pull/299) Joerg Kreuzberger) * Compile error with C++20 ([ea089a6](https://github.com/cucumber/cucumber-cpp/commit/ea089a6369641445dc52099298779cef6affdb8f) Urs Fässler) ## [0.7.0](https://github.com/cucumber/cucumber-cpp/compare/v0.6...v0.7.0) (30 December 2023) ### Added * add version info to cucumber-cpp-main ([8a0d16b8](https://github.com/cucumber/cucumber-cpp/pull/275/commits/8a0d16b8f59dd1c9d75045aa016d9ce235257311) Urs Fässler) * Remove dependency to Boost ([#275](https://github.com/cucumber/cucumber-cpp/pull/275) Urs Fässler) * List headers in cmake ([#274](https://github.com/cucumber/cucumber-cpp/pull/274) Urs Fässler) * Check code format on PR and main branch ([#268](https://github.com/cucumber/cucumber-cpp/pull/268) Urs Fässler) ### Changed * use semantic versioning ([#280](https://github.com/cucumber/cucumber-cpp/pull/280) Urs Fässler) * No googletest auto-download ([#279](https://github.com/cucumber/cucumber-cpp/pull/279) Urs Fässler) * Remove dependency to Boost ([#275](https://github.com/cucumber/cucumber-cpp/pull/275) Urs Fässler) * use asio without boost ([d131ae39](https://github.com/cucumber/cucumber-cpp/pull/275/commits/d131ae3951b9aeb03dd787bf6fee4a06a81c1f04)) * use TCLAP to parse program options ([b688cf41](https://github.com/cucumber/cucumber-cpp/pull/275/commits/b688cf41647803daa8a7656595b0d1bcbabf2310)) * use nlohmann/json library ([#273](https://github.com/cucumber/cucumber-cpp/pull/273) Urs Fässler) * remove boost::multi_array ([#269](https://github.com/cucumber/cucumber-cpp/pull/269) Urs Fässler) * Modernize overloading ([#267](https://github.com/cucumber/cucumber-cpp/pull/267) Urs Fässler) * refactoring: use stl regex instead of boost::regex ([#266](https://github.com/cucumber/cucumber-cpp/pull/266) Urs Fässler) ### Fixed * mention CI scripts for details about dependency installation ([#278](https://github.com/cucumber/cucumber-cpp/pull/278) Urs Fässler) * remove broken E2E tests ([#272](https://github.com/cucumber/cucumber-cpp/pull/272) Urs Fässler) * remove broken AppVeyor build ([#271](https://github.com/cucumber/cucumber-cpp/pull/271) Urs Fässler) ## [0.6](https://github.com/cucumber/cucumber-cpp/compare/v0.5...v0.6) (17 December 2023) ### Added ### Changed * Using C++ standard library where possible instead of boost ([#264](https://github.com/cucumber/cucumber-cpp/pull/264) Urs Fässler) ### Fixed * Statically linking `boost_system` ([#197](https://github.com/cucumber/cucumber-cpp/pull/197) Matthieu Longo) * Unable to `add_subdirectory(cucumber-cpp)` ([#211](https://github.com/cucumber/cucumber-cpp/pull/211) Sergey Bon) * Warning C4265 on Visual Studio ([#195](https://github.com/cucumber/cucumber-cpp/pull/195) Matthieu Longo) * Fix handling of optional regex captures ([#221](https://github.com/cucumber/cucumber-cpp/pull/221) Alain Martin) * Fix compilation with Boost 1.70.0 ([#225](https://github.com/cucumber/cucumber-cpp/pull/225) Krystian Młynarczyk) * Support step definitions with multi-byte characters ([#224](https://github.com/cucumber/cucumber-cpp/pull/224) Spencer Rudnick) * Supress warning about deprecated QSignalMapper ([#228](https://github.com/cucumber/cucumber-cpp/pull/228) Lukas Woodtli) * Remove CACHE FORCE arguments from CMAKE_CXX_FLAG on colored terminal output ([#232](https://github.com/cucumber/cucumber-cpp/pull/232) Alex Cani) * Enable compiling with clang's -Wsuggest-override ([#244](https://github.com/cucumber/cucumber-cpp/pull/244) Tobias Hahn) * Add posibility to build with sanitizers enabled ([#247](https://github.com/cucumber/cucumber-cpp/pull/247) Lukas Woodtli) * Add support for latest GoogleTest and Boost ([#249](https://github.com/cucumber/cucumber-cpp/pull/249) Canmor Lam) * add file extensions to adhere to policy CMP0115 ([#250](https://github.com/cucumber/cucumber-cpp/pull/250) Urs Fässler) * Support latest Qt and test on Ubuntu 22.04 ([#253](https://github.com/cucumber/cucumber-cpp/pull/253) Urs Fässler) * Update table.feature ([#258](https://github.com/cucumber/cucumber-cpp/pull/258) mbed101) ## [0.5](https://github.com/cucumber/cucumber-cpp/compare/v0.4...v0.5) (2 July 2018) ### Added * QtTest based test driver for cucumber-cpp ([#165](https://github.com/cucumber/cucumber-cpp/pull/165) Kamil Strzempowicz) * Listen on localhost by default to avoid firewall warnings ([#158](https://github.com/cucumber/cucumber-cpp/pull/158) Nik Reiman) * Better integrate Qt into buildsystem, it can now be disabled, and test it in CI ([#160](https://github.com/cucumber/cucumber-cpp/pull/160) Kamil Strzempowicz & Giel van Schijndel) * Support taking regex captures as arguments to the step definition's function ([#159](https://github.com/cucumber/cucumber-cpp/pull/159) Giel van Schijndel) * Support building as shared library on Windows and hide internal symbols on all platforms ([#147](https://github.com/cucumber/cucumber-cpp/pull/147) [Nik Reiman](https://github.com/nre-ableton)) * Support installing library targets along with headers ([#182](https://github.com/cucumber/cucumber-cpp/pull/182) [Matthieu](https://github.com/matlo607)) ### Changed * Renamed HISTORY.md to CHANGELOG.md and updated to bring inline with [cucumber/cucumber #251](https://github.com/cucumber/cucumber/issues/251) ([#166](https://github.com/cucumber/cucumber-cpp/pull/166) [jaysonesmith](https://github.com/jaysonesmith)) ### Fixed * Fix compiler warning ([#192](https://github.com/cucumber/cucumber-cpp/issues/192) [Giel van Schijndel](https://github.com/muggenhor)), ([#184](https://github.com/cucumber/cucumber-cpp/pull/184) [Kamil Strzempowicz](https://github.com/konserw)) * Add missing virtual destructor in base class SocketServer used by TCPSocketServer and UnixSocketServer ([#183](https://github.com/cucumber/cucumber-cpp/pull/183) Matthieu Longo) * Fix breaking changes in API of boost-1.66.0 ([#180](https://github.com/cucumber/cucumber-cpp/pull/180) Matthieu Longo) * Fix conflicting "using std" declaration with "using boost::thread" ([#181](https://github.com/cucumber/cucumber-cpp/pull/181) Matthieu Longo) * Fix building with boost > 1.64 by adding 2 new methods to BoostLogInterceptor ([#175](https://github.com/cucumber/cucumber-cpp/pull/175) Kamil Strzempowicz) * Fixing Visual Studio 2013 error: no appropriate default constructor available ([#188](https://github.com/cucumber/cucumber-cpp/pull/188) Antoine Allard) * Fix issue #81 by intercepting messages from BOOST_*_MESSAGE macros ([#164](https://github.com/cucumber/cucumber-cpp/pull/164) Kamil Strzempowicz) * Allow running all GTest cases without filter separation ([#144](https://github.com/cucumber/cucumber-cpp/pull/144) Giel van Schijndel) * Fix QNX build by depending on standard C++ instead of specific implementation ([#156](https://github.com/cucumber/cucumber-cpp/issues/156) Giel van Schijndel) * Ensure CMake 3.1+ is available, 2.8.12 wasn't enough for quite a while ([#152](https://github.com/cucumber/cucumber-cpp/pull/152) Giel van Schijndel) * Fix crash during termination of the CalcQt example's step definitions ([#62](https://github.com/cucumber/cucumber-cpp/issues/62) Giel van Schijndel) ## [0.4](https://github.com/cucumber/cucumber-cpp/compare/v0.3.1...v0.4) (31 March 2017) ### New Features * Support for MinGW build ([#130](https://github.com/cucumber/cucumber-cpp/pull/130) Michel Estermann) * Add support for Unix sockets ([#126](https://github.com/cucumber/cucumber-cpp/pull/126) Giel van Schijndel) * Add support for using ephemeral ports ([#131](https://github.com/cucumber/cucumber-cpp/pull/131) Giel van Schijndel) * Removed CppSpec support ([#118](https://github.com/cucumber/cucumber-cpp/pull/118) Paolo Ambrosio) * Support for GoogleTest 1.8 ([#120](https://github.com/cucumber/cucumber-cpp/pull/120) Kamil Strzempowicz) * Disable Nagle on TCP socket ([#125](https://github.com/cucumber/cucumber-cpp/pull/125) Giel van Schijndel) ### Bugfixes * Fixed suggested step definition when step sentence contains double quote ([#116](https://github.com/cucumber/cucumber-cpp/issues/116) Kamil Strzempowicz, [fbc49a3](https://github.com/cucumber/cucumber-cpp/commit/fbc49a34e12a0b9b2a6e121d97ba1ad8f46dce8f) Paolo Ambrosio) * Fixed `defs.hpp` deprecation warning on MSVC ([#124](https://github.com/cucumber/cucumber-cpp/pull/124) Antoine Allard) * Fixed parallel build ([#135](https://github.com/cucumber/cucumber-cpp/pull/135) Giel van Schijndel) * Fixed memory leaks and better memory management ([#134](https://github.com/cucumber/cucumber-cpp/pull/134) Giel van Schijndel) * Fixed clang warning about bad `typeid` usage ([#138](https://github.com/cucumber/cucumber-cpp/pull/138) Kamil Strzempowicz) ## [0.3.1](https://github.com/cucumber/cucumber-cpp/compare/v0.3...v0.3.1) (11 April 2016) ### New Features * Support for Boost 1.60 ([#101](https://github.com/cucumber/cucumber-cpp/pull/101) Kai Unger) * Support for CMake inclusion in other projects ([#76](https://github.com/cucumber/cucumber-cpp/pull/76) Eric Brayet) * Added Qt5 support in CalcQt example ([#98](https://github.com/cucumber/cucumber-cpp/pull/98) Kamil Strzempowicz) * Improved Generic Driver to write steps without testing framework ([#99](https://github.com/cucumber/cucumber-cpp/pull/99) Kamil Strzempowicz) ### Bugfixes None ## [0.3](https://github.com/cucumber/cucumber-cpp/compare/v0.2...v0.3) (22 December 2013) ### New Features * Added BEFORE_ALL and AFTER_ALL macros ([#65](https://github.com/cucumber/cucumber-cpp/pull/65) Larry Price) * Added CalcQt example ([#58](https://github.com/cucumber/cucumber-cpp/pull/58) Gianni Ambrosio) * Replaced USING_CONTEXT with ScenarioScope ([27256e9](https://github.com/cucumber/cucumber-cpp/commit/27256e932c75e9d4d57d4839042317e6a04cfe46) Paolo Ambrosio) * Changed include name from core.hpp to defs.hpp ([5bbac06](https://github.com/cucumber/cucumber-cpp/commit/5bbac062e19dcf9de2761f4ded115aa7212c14d7) Paolo Ambrosio) * Project rename from CukeBins to Cucumber-Cpp ([efecfd0](https://github.com/cucumber/cucumber-cpp/commit/efecfd0813efa1b6d406c2fd0cd03d8a84bed3ff) Paolo Ambrosio) ### Bugfixes * Fixed socket server bug in VS2012 forcing Boost 1.51 ([#57](https://github.com/cucumber/cucumber-cpp/pull/57) Jared Szechy, [e41a9b7](https://github.com/cucumber/cucumber-cpp/commit/e681c5028a756d8f711574a86e84ca8b98333d5c) Paolo Ambrosio) * Fixed crashes on some architectures ([#52](https://github.com/cucumber/cucumber-cpp/pull/52) Sabst) * Fixed AFTER hook ordering issue ([#43](https://github.com/cucumber/cucumber-cpp/pull/43) Greg Williams) * Added default empty constructor to work with less permissive gcc 4.6 settings ([#38](https://github.com/cucumber/cucumber-cpp/pull/38) Hugo Ferreira) ## [0.2](https://github.com/cucumber/cucumber-cpp/compare/v0.1...v0.2) (25 June 2011) TODO ## [0.1](https://github.com/cucumber/cucumber-cpp/commits/v0.1) (03 May 2010) * Initial implementation ================================================ FILE: CMakeLists.txt ================================================ cmake_minimum_required(VERSION 3.16) cmake_policy(SET CMP0063 NEW) # CMP0077: option() honors normal variables # https://cmake.org/cmake/help/latest/policy/CMP0077.html cmake_policy(SET CMP0077 NEW) # CMP0074: find_package() makes use of _ROOT variables # https://cmake.org/cmake/help/latest/policy/CMP0074.html cmake_policy(SET CMP0074 NEW) project(Cucumber-Cpp) option(CUKE_ENABLE_BOOST_TEST "Enable Boost.Test framework" OFF) option(CUKE_ENABLE_GTEST "Enable Google Test framework" OFF) option(CUKE_ENABLE_QT_5 "Enable Qt5 framework" OFF) option(CUKE_ENABLE_QT_6 "Enable Qt6 framework" OFF) option(CUKE_ENABLE_EXAMPLES "Build examples" OFF) option(CUKE_TESTS_UNIT "Enable unit tests" OFF) option(BUILD_SHARED_LIBS "Generate shared libraries" OFF) option(CUKE_CODE_COVERAGE "Enable instrumentation for code coverage" OFF) set(CUKE_ENABLE_SANITIZER "OFF" CACHE STRING "Sanitizer to use for checking") set_property(CACHE CUKE_ENABLE_SANITIZER PROPERTY STRINGS OFF "address" "thread" "undefined") option(CUKE_TESTS_VALGRIND "Enable tests within Valgrind" OFF) option(CUKE_STRICT "Additional and more strict checks" OFF) if(NOT DEFINED CMAKE_CXX_STANDARD) set(CMAKE_CXX_STANDARD 17) set(CMAKE_CXX_STANDARD_REQUIRED ON) set(CMAKE_CXX_EXTENSIONS OFF) elseif(CMAKE_CXX_STANDARD LESS 17) message(FATAL_ERROR "C++17 (above) is required") endif() if(CUKE_CODE_COVERAGE) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} --coverage") endif() if(CUKE_STRICT) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Werror") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DASIO_NO_DEPRECATED") endif() set(CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake/modules) # # Option deprecation: if deprecated option is defined # then print a warning and use its value instead # function(option_depr_message old prefer) message (DEPRECATION "${old} is deprecated in favor of ${prefer}") endfunction() function(option_depr old prefer) if(DEFINED ${old}) option_depr_message(${old} ${prefer}) set (${prefer} ${${old}} CACHE BOOL "Set from deprecated ${old}" FORCE) endif() endfunction() function(option_depr_invert old prefer) if(DEFINED ${old}) option_depr_message(${old} ${prefer}) set (${prefer} $ CACHE BOOL "Set from deprecated ${old}" FORCE) endif() endfunction() option_depr_invert (CUKE_DISABLE_BOOST_TEST CUKE_ENABLE_BOOST_TEST) option_depr_invert (CUKE_DISABLE_GTEST CUKE_ENABLE_GTEST) option_depr_invert (CUKE_DISABLE_QT_5 CUKE_ENABLE_QT_5) option_depr_invert (CUKE_DISABLE_QT_6 CUKE_ENABLE_QT_6) option_depr_invert (CUKE_DISABLE_UNIT_TESTS CUKE_TESTS_UNIT) option_depr (VALGRIND_TESTS CUKE_TESTS_VALGRIND) # # Check that at least one test framework is enabled # set(CUKE_TEST_FRAMEWORKS CUKE_ENABLE_BOOST_TEST CUKE_ENABLE_GTEST CUKE_ENABLE_QT_5 CUKE_ENABLE_QT_6 ) set(TEST_FRAMEWORK_FOUND FALSE) foreach(test_framework ${CUKE_TEST_FRAMEWORKS}) if(${test_framework}) set(TEST_FRAMEWORK_FOUND TRUE) endif() endforeach() if(NOT TEST_FRAMEWORK_FOUND) message(WARNING "No test framework enabled. At least one should be enabled. Options are: ${CUKE_TEST_FRAMEWORKS}.") endif() # # Generic Compiler Flags # if(CMAKE_CXX_COMPILER_ID MATCHES "Clang|GNU") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS_INIT} -Wall -Wextra -Wsuggest-override ${CMAKE_CXX_FLAGS}") # TODO: A better fix should handle ld's --as-needed flag if(UNIX AND NOT APPLE) set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Xlinker '--no-as-needed'") endif() elseif(MSVC) set(CMAKE_CXX_FLAGS "-DNOMINMAX ${CMAKE_CXX_FLAGS}") # exclude M$ min/max macros set(CMAKE_CXX_FLAGS "/wd4996 ${CMAKE_CXX_FLAGS}") # don't warn about use of plain C functions without (non-portable) "_s" suffix #set(CMAKE_CXX_FLAGS_DEBUG "/analyze ${CMAKE_CXX_FLAGS_DEBUG}") endif() # # Colored Terminal Output # if(UNIX AND ( (CMAKE_CXX_COMPILER_ID MATCHES "Clang") OR (CMAKE_CXX_COMPILER_ID STREQUAL "GNU" AND NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.9)) AND CMAKE_GENERATOR STREQUAL "Ninja") # These compilers generate coloured output, but by default only when their output channel is a # terminal (TTY/PTY). Ninja however captures all output in a pipe (per-subprocess), disabling # coloured compiler diagnostics. We forcefully enable it because Ninja, since 1.0.0 # (ninja-build/ninja#198) takes care to strip VT100 CSI control sequences from the output if Ninja # itself is writing to a pipe instead of a terminal. As a result this should give us the best of # both worlds: coloured output when we're running in a terminal, plain output for editors, IDEs, # etc. set(CMAKE_CXX_FLAGS "-fdiagnostics-color=always ${CMAKE_CXX_FLAGS}") endif() # # Boost # set(Boost_USE_STATIC_RUNTIME OFF) if(CUKE_ENABLE_BOOST_TEST) # "An external test runner utility is required to link with dynamic library" (Boost User's Guide) set(CMAKE_CXX_FLAGS "-DBOOST_TEST_DYN_LINK ${CMAKE_CXX_FLAGS}") find_package(Boost 1.70 COMPONENTS unit_test_framework REQUIRED) endif() # # GTest # if(CUKE_ENABLE_GTEST) find_package(GTest 1.11.0 REQUIRED) endif() # # Qt # if(CUKE_ENABLE_QT_5 AND CUKE_ENABLE_QT_6) message(FATAL_ERROR "Qt version 5 and 6 enabled, please select at most one") endif() if(CUKE_ENABLE_QT_5) find_package(Qt5 REQUIRED COMPONENTS Core Gui Widgets Test ) message(STATUS "Found Qt version: ${Qt5Core_VERSION_STRING}") if(Qt5Core_VERSION_STRING VERSION_LESS 5.15.0) add_library(Qt::Core INTERFACE IMPORTED) add_library(Qt::Gui INTERFACE IMPORTED) add_library(Qt::Widgets INTERFACE IMPORTED) add_library(Qt::Test INTERFACE IMPORTED) set_target_properties(Qt::Core PROPERTIES INTERFACE_LINK_LIBRARIES Qt5::Core ) set_target_properties(Qt::Gui PROPERTIES INTERFACE_LINK_LIBRARIES Qt5::Gui ) set_target_properties(Qt::Widgets PROPERTIES INTERFACE_LINK_LIBRARIES Qt5::Widgets) set_target_properties(Qt::Test PROPERTIES INTERFACE_LINK_LIBRARIES Qt5::Test ) endif() endif() if(CUKE_ENABLE_QT_6) find_package(Qt6 REQUIRED COMPONENTS Core Gui Widgets Test ) message(STATUS "Found Qt version: ${Qt6Core_VERSION}") endif() # # Sanitizers # if(CUKE_ENABLE_SANITIZER AND NOT ${CUKE_ENABLE_SANITIZER} EQUAL "OFF") message("Disabling valgrind when a sanitizer is enabled") set(CUKE_TESTS_VALGRIND OFF) if (WIN32) message(WARNING "The use of the sanatizers on Windows is not tested") endif() add_compile_options("-fsanitize=${CUKE_ENABLE_SANITIZER}") add_link_options("-fsanitize=${CUKE_ENABLE_SANITIZER}") endif() # # Valgrind # if(CUKE_TESTS_VALGRIND) find_package(Valgrind REQUIRED) set(VALGRIND_ARGS --error-exitcode=2 --leak-check=full --undef-value-errors=no) if(NOT VALGRIND_VERSION_STRING VERSION_LESS 3.9) # Valgrind 3.9 no longer shows all leaks unless asked to list(APPEND VALGRIND_ARGS --show-leak-kinds=all) endif() function(add_test name) if(NOT name STREQUAL "NAME") _add_test(${VALGRIND_EXECUTABLE} ${VALGRIND_ARGS} ${ARGV}) return() endif() set(TEST_ARGS ${ARGV}) list(FIND TEST_ARGS COMMAND COMMAND_IDX) if(COMMAND_IDX EQUAL -1) message(AUTHOR_WARNING "Weird command-line given to add_test(), not injecting valgrind") _add_test(${ARGV}) return() endif() # We want to operate on the COMMAND, not the 'COMMAND' keyword preceding it math(EXPR COMMAND_IDX "${COMMAND_IDX} + 1") # Keep add_test() behaviour of replacing COMMANDs, when executable targets, with their output files list(GET TEST_ARGS ${COMMAND_IDX} COMMAND) if(TARGET ${COMMAND}) get_target_property(COMMAND_TYPE ${COMMAND} TYPE) if(COMMAND_TYPE STREQUAL "EXECUTABLE") # Inserting first, removing the original only after that, because inserting to the end of the list doesn't work math(EXPR ORIG_COMMAND_IDX "${COMMAND_IDX} + 1") list(INSERT TEST_ARGS ${COMMAND_IDX} "$") list(REMOVE_AT TEST_ARGS ${ORIG_COMMAND_IDX}) endif() endif() # Insert the valgrind command line, before the command to execute list(INSERT TEST_ARGS ${COMMAND_IDX} ${VALGRIND_EXECUTABLE} ${VALGRIND_ARGS}) _add_test(${TEST_ARGS}) endfunction() endif() # # Cucumber-Cpp # set(CUKE_INCLUDE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/include) add_subdirectory(src) # # Tests # if(CUKE_TESTS_UNIT) enable_testing() add_subdirectory(tests) else() message(STATUS "Skipping unit tests") endif() # # Examples # if(CUKE_ENABLE_EXAMPLES) add_subdirectory(examples) endif() ================================================ FILE: CONTRIBUTING.md ================================================ ## About to create a new Github Issue? We appreciate that. But before you do, please learn our basic rules: * Do you have a feature request? Then don't expect it to be implemented unless you or someone else sends a [pull request](https://help.github.com/articles/using-pull-requests). * Reporting a bug? We need to know what compiler, operating system and architecture (32 or 64 bit) you are using, including versions of all libraries. Bugs with [pull requests](https://help.github.com/articles/using-pull-requests) get fixed quicker. Some bugs may never be fixed. * You have to tell us how to reproduce a bug. Bonus point for a [pull request](https://help.github.com/articles/using-pull-requests) with a failing test that reproduces the bug. * Want to paste some code or output? Put \`\`\` on a line above and below your code/output. See [GFM](https://help.github.com/articles/github-flavored-markdown)'s *Fenced Code Blocks* for details. * We love [pull requests](https://help.github.com/articles/using-pull-requests), but if you don't have a test to go with it we probably won't merge it. ## Contributing Before you can contribute, you have to be able to build the source and run tests. ### The Github Process The process for using git/github is similar to the [Github-Flow](http://scottchacon.com/2011/08/31/github-flow.html) * **Anything** in the main branch is good enough to release * Working on nontrivial features + Create a descriptively named branch off of main + Commit to that branch locally and regularly + Push your work to the same named branch on the server + Regularly rebase this branch from main to keep it up to date * Open a pull request + When you need feedback or help + You think the branch is ready for merging (you can use the [hub](https://github.com/defunkt/hub#git-pull-request) command-line tool) * For any nontrivial change, even if you have the rights to merge the pull request yourself, wait before someone else has reviewed and agreed on the change Here is an [Example](https://github.com/cucumber/bool/pull/12) of this process in action #### Tips for good commits 1. Read up on [Github Flavored Markdown](https://help.github.com/articles/github-flavored-markdown) + Especially links and syntax highlighting. GFM can be used in tickets as well as commit messages (e.g. put "#4" somewhere in a commit message to link ticket 4 to that commit 2. Close tickets with commits if you can + Add "Closes #5, #9" somewhere in the commit message to both link and close. See [Issues 2.0 the Next Generation](https://github.com/blog/831-issues-2-0-the-next-generation) for details. + Use [this script](https://gist.github.com/aslakhellesoy/4754009) to compile and view GFM locally 3. Subscribe to ticket feeds so you stay in the loop and get a chance to provide feedback on tickets 4. The code standard is the existing code + Use the same indentation, spacing, line ending, ASCII for source code, UTF-8 everywhere else 5. Use git diff (or git diff --cached if you have staged) before every commit + This helps you avoid committing changes you didn't mean to ## Maintainers' guide ### Merge a PR - Verify that: - All checks have passed - At least one maintainer has approved any non-trivial change, and a discussion has occurred for any breaking change - The branch does not need rebasing or squashing of commits - To merge: - Follow the command line instructions on GitHub - If it is either a new feature or a bugfix, specify the `--no-commit` flag when merging and add a line to `CHANGELOG.md` following the current convention. Add this file to the changes to be committed and commit the merge. - Commit message should follow the current convention: `Merge #42 'Description of the change usually from the PR description'` ### Do a release - Release commit (e.g. [fdf8a5c](https://github.com/cucumber/cucumber-cpp/commit/fdf8a5c4ef4c51dfa7ea82077f706414a4c6322d)): - Change `CHANGELOG.md` renaming the "In Git" section with the release number and date - Commit with message `Update changelog for the X.Y.Z release` - Create an annotated tag for this commit named `vX.Y.Z` - New development branch commit (e.g. [da60995](https://github.com/cucumber/cucumber-cpp/commit/da609956fcd42046e5182c6226acd7e53dd7754e)): - Add new "In Git" section to `CHANGELOG.md` - Commit with message `Preparing history file for next development release` - Push commits and tags to main ================================================ FILE: Gemfile ================================================ source 'https://rubygems.org' group :test do gem 'cucumber', "=7.1.0" gem 'cucumber-wire', "=6.2.1" end ================================================ FILE: LICENSE ================================================ MIT License Copyright (c) 2010 Paolo Ambrosio Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ================================================ FILE: README.md ================================================ # Cucumber-CPP ## Overview Cucumber-Cpp allows Cucumber to support step definitions written in C++. * [Cucumber-Cpp Website](https://github.com/cucumber/cucumber-cpp) * [Cucumber-Cpp Documentation](https://github.com/cucumber/cucumber-cpp/wiki/) * [Cucumber Website](https://cucumber.io/) * [Get in touch](https://cucumber.io/docs/community/get-in-touch/) If you need to ask a question, post on the [Cucumber discussion group](https://github.com/orgs/cucumber/discussions). If you want to contribute code to the project, guidelines are in [CONTRIBUTING.md](CONTRIBUTING.md). ## Dependencies It relies on a few executables: * [cmake](https://cmake.org/download/) 3.16 or later. Required to setup environment and build software It relies on a few libraries: * [Asio](https://think-async.com/Asio/) 1.18.1 or later. * [Boost.Test](https://www.boost.org/) 1.70. Optional for the Boost Test driver. * [GTest](https://github.com/google/googletest) 1.11.0 or later. Optional for the GTest driver. * [GMock](https://github.com/google/googletest) 1.11.0 or later. Optional for the internal test suite. * [nlohmann-json](https://github.com/nlohmann/json) 3.10.5 or later. * [Qt6 or Qt5](https://qt-project.org/). Optional for the CalcQt example and QtTest driver. * [TCLAP](https://tclap.sourceforge.net/) 1.2.5 or later. It might work with earlier versions of the libraries, but it was not tested with them. See the [CI scripts](.github/workflows/run-all.yml) for details about dependency installation. Cucumber-Cpp uses the wire protocol at the moment, so you will need Cucumber-Ruby installed and available on the path. It is also needed to run the functional test suite. Please mind that Cucumber-Cpp is not compatible with Cucumber-Ruby 3.x due to a [bug in its wire protocol](https://github.com/cucumber/cucumber-ruby/issues/1183) implementation. To install the Ruby prerequisites: ``` gem install bundler // For windows: gem install bundle bundle install ``` ### Windows vs. Linux To get an inspiration on how to set up the dependencies on your specific system (Windows or Linux), you may want to have a look at the workflow files [for Windows](.github/workflows/windows-build.yml) and [for Linux](.github/workflows/linux-build.yml). ## Build Building Cucumber-Cpp with tests and samples: ``` # Create build directory cmake -E make_directory build # Generate Makefiles cmake -E chdir build cmake \ -DCUKE_ENABLE_BOOST_TEST=on \ -DCUKE_ENABLE_GTEST=on \ -DCUKE_ENABLE_QT_6=on \ -DCUKE_TESTS_UNIT=on \ -DCUKE_ENABLE_EXAMPLES=on \ .. # Build cucumber-cpp cmake --build build # Run unit tests cmake --build build --target test # Run install cmake --install build ``` Running the Calc example on Unix: ``` build/examples/Calc/BoostCalculatorSteps >/dev/null & (cd examples/Calc; cucumber) ``` Running the Calc example on Windows (NMake): ``` start build\examples\Calc\BoostCalculatorSteps.exe cucumber examples\Calc ``` ## The way it works (This is a great explanation by [paoloambrosio](https://github.com/paoloambrosio) copied from [stackoverflow](https://stackoverflow.com/questions/50760865/cucumber-cpp-required-software-for-running-example)) The way Cucumber-CPP currently works is by having Cucumber-Ruby connecting to a TCP port where the C++ implementation is listening. When the wire protocol is defined in the cucumber.wire file, with host and port where your C++ wire protocol server is listening, Cucumber-Ruby will try and run them with Cucumber-CPP. C++ is a compiled language, so step definitions must be compiled first. The examples provided use CMake, as described in the README. Cucumber-CPP needs to be linked to the step definitions and to everything that they use (usually the application under test), creating an executable file that will listen to the wire protocol port (defaults to localhost:3902) for Cucumber-Ruby to connect to (and exiting when it disconnects). ``` +------------------------------------------+ | | +----------+ | +----------+ +----------+ +----------+ | | | | | | | | | | | | Cucumber | | | Cucumber | | C++ Step | | Your | | | Ruby |--------->| CPP Wire |--| Defs |--| CPP App | | | | | | Server | | | | | | | | | | | | | | | | +----------+ | +----------+ +----------+ +----------+ | | | +------------------------------------------+ ``` ## Getting started Here is a basic example on how to get started with *cucumber-cpp*. First you need to create the basic feature structure: ``` cucumber --init ``` Then create a *cucumber.wire* file in the *features/step_definitions* folder with the following content: ``` host: localhost port: 3902 ``` Create your first feature (an example is available [here](examples/Calc/features/addition.feature)). Then create your step definition runner (an example is available [here](examples/Calc/features/step_definitions/BoostCalculatorSteps.cpp)). In order to compile the step definition runner, make sure to add [cucumber include directory](include/cucumber-cpp) to the include path and link with *libcucumber-cpp.a* and additional testing libraries (boost unit test). Run the step definition runner in the background and then cucumber, like in the Calc example in the previous section. The step definition runner should exit after the feature is run and cucumber exits. ================================================ FILE: cmake/modules/FindAsio.cmake ================================================ find_path(ASIO_INCLUDE_DIR asio.hpp) if (ASIO_INCLUDE_DIR) set(ASIO_FOUND TRUE) else () set(ASIO_FOUND FALSE) endif () include(FindPackageHandleStandardArgs) FIND_PACKAGE_HANDLE_STANDARD_ARGS(Asio REQUIRED_VARS ASIO_INCLUDE_DIR) ================================================ FILE: cmake/modules/FindTCLAP.cmake ================================================ find_path(TCLAP_INCLUDE_DIR tclap/CmdLine.h) if (TCLAP_INCLUDE_DIR) set(TCLAP_FOUND TRUE) else () set(TCLAP_FOUND FALSE) endif () include(FindPackageHandleStandardArgs) FIND_PACKAGE_HANDLE_STANDARD_ARGS(TCLAP REQUIRED_VARS TCLAP_INCLUDE_DIR) ================================================ FILE: cmake/modules/FindValgrind.cmake ================================================ #.rst: # FindValgrind # ------- # # The module defines the following variables: # # ``VALGRIND_EXECUTABLE`` # Path to Valgrind command-line client. # ``Valgrind_FOUND`` # True if the Valgrind command-line client was found. # ``VALGRIND_VERSION_STRING`` # The version of Valgrind found. # # Example usage: # # .. code-block:: cmake # # find_package(Valgrind) # if(Valgrind_FOUND) # message("Valgrind found: ${VALGRIND_EXECUTABLE}") # endif() #============================================================================= # Copyright (c) 2017 Giel van Schijndel # # CMake - Cross Platform Makefile Generator # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions # are met: # # * Redistributions of source code must retain the above copyright # notice, this list of conditions and the following disclaimer. # # * Redistributions in binary form must reproduce the above copyright # notice, this list of conditions and the following disclaimer in the # documentation and/or other materials provided with the distribution. # # * Neither the names of Kitware, Inc., the Insight Software Consortium, # nor the names of their contributors may be used to endorse or promote # products derived from this software without specific prior written # permission. # # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT # LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR # A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT # HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. # # ------------------------------------------------------------------------------ # # The above copyright and license notice applies to distributions of # CMake in source and binary form. Some source files contain additional # notices of original copyright by their contributors; see each source # for details. Third-party software packages supplied with CMake under # compatible licenses provide their own copyright notices documented in # corresponding subdirectories. # # ------------------------------------------------------------------------------ # # CMake was initially developed by Kitware with the following sponsorship: # # * National Library of Medicine at the National Institutes of Health # as part of the Insight Segmentation and Registration Toolkit (ITK). # # * US National Labs (Los Alamos, Livermore, Sandia) ASC Parallel # Visualization Initiative. # # * National Alliance for Medical Image Computing (NAMIC) is funded by the # National Institutes of Health through the NIH Roadmap for Medical Research, # Grant U54 EB005149. # # * Kitware, Inc. #============================================================================= find_program(VALGRIND_EXECUTABLE NAMES valgrind DOC "Valgrind command line executable" ) mark_as_advanced(VALGRIND_EXECUTABLE) if(VALGRIND_EXECUTABLE) execute_process(COMMAND ${VALGRIND_EXECUTABLE} --version OUTPUT_VARIABLE VALGRIND_VERSION_STRING ERROR_QUIET OUTPUT_STRIP_TRAILING_WHITESPACE) if (VALGRIND_VERSION_STRING MATCHES "^valgrind-[0-9]") string(REPLACE "valgrind-" "" VALGRIND_VERSION_STRING "${VALGRIND_VERSION_STRING}") endif() endif() include(FindPackageHandleStandardArgs) find_package_handle_standard_args(Valgrind REQUIRED_VARS VALGRIND_EXECUTABLE VERSION_VAR VALGRIND_VERSION_STRING) ================================================ FILE: cmake/modules/GitVersion.cmake ================================================ function(git_get_version VERSION_VARIABLE) find_program(GIT_EXECUTABLE git) if(NOT GIT_EXECUTABLE) message(FATAL_ERROR "Git not found. Please install Git and make sure it is in your system's PATH.") endif() execute_process( COMMAND ${GIT_EXECUTABLE} describe --always --dirty OUTPUT_VARIABLE VERSION_STRING OUTPUT_STRIP_TRAILING_WHITESPACE WORKING_DIRECTORY "${PROJECT_SOURCE_DIR}" ERROR_VARIABLE GIT_DESCRIBE_ERROR RESULT_VARIABLE GIT_DESCRIBE_RESULT ) if(NOT GIT_DESCRIBE_RESULT EQUAL 0) message(FATAL_ERROR "Error running 'git describe': ${GIT_DESCRIBE_ERROR}") endif() string(LENGTH "${VERSION_STRING}" VERSION_STRING_LENGTH) string(SUBSTRING "${VERSION_STRING}" 0 1 FIRST_CHARACTER) if("${FIRST_CHARACTER}" STREQUAL "v") string(SUBSTRING "${VERSION_STRING}" 1 ${VERSION_STRING_LENGTH} VERSION_STRING) endif() set(${VERSION_VARIABLE} ${VERSION_STRING} PARENT_SCOPE) endfunction() ================================================ FILE: examples/CMakeLists.txt ================================================ add_subdirectory(Calc) add_subdirectory(CalcQt) add_subdirectory(FeatureShowcase) ================================================ FILE: examples/Calc/CMakeLists.txt ================================================ project(Calc) add_library(Calc STATIC src/Calculator.cpp) target_include_directories(Calc INTERFACE src) if(TARGET GTest::gtest) add_executable(GTestCalculatorSteps features/step_definitions/GTestCalculatorSteps.cpp) target_link_libraries(GTestCalculatorSteps PRIVATE Calc cucumber-cpp GTest::gtest) add_executable(FuncArgsCalculatorSteps features/step_definitions/FuncArgsCalculatorSteps.cpp) target_link_libraries(FuncArgsCalculatorSteps PRIVATE Calc cucumber-cpp GTest::gtest) endif() if(TARGET Boost::unit_test_framework) add_executable(BoostCalculatorSteps features/step_definitions/BoostCalculatorSteps.cpp) target_link_libraries(BoostCalculatorSteps PRIVATE Calc cucumber-cpp Boost::unit_test_framework) endif() if(TARGET Qt::Test) add_executable(QtTestCalculatorSteps features/step_definitions/QtTestCalculatorSteps.cpp) target_link_libraries(QtTestCalculatorSteps Calc Qt::Test cucumber-cpp) endif() ================================================ FILE: examples/Calc/README.txt ================================================ This was inspired by Cuke4Nuke Calc sample ================================================ FILE: examples/Calc/features/addition.feature ================================================ # language: en Feature: Addition In order to avoid silly mistakes As a math idiot I want to be told the sum of two numbers Scenario Outline: Add two numbers Given I have entered into the calculator And I have entered into the calculator When I press