{"id":13419522,"url":"https://github.com/cucumber/cucumber-cpp","last_synced_at":"2025-04-09T05:09:56.223Z","repository":{"id":38346336,"uuid":"639447","full_name":"cucumber/cucumber-cpp","owner":"cucumber","description":"Support for writing Cucumber step definitions in C++","archived":false,"fork":false,"pushed_at":"2024-09-27T12:11:49.000Z","size":773,"stargazers_count":309,"open_issues_count":11,"forks_count":131,"subscribers_count":98,"default_branch":"main","last_synced_at":"2024-10-29T14:46:53.673Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/cucumber.png","metadata":{"funding":{"open_collective":"cucumber","github":"cucumber"},"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2010-04-30T06:22:30.000Z","updated_at":"2024-10-29T12:18:42.000Z","dependencies_parsed_at":"2023-01-29T04:16:04.538Z","dependency_job_id":"b2896d1d-4473-4d46-a22c-0ed6ed7d040c","html_url":"https://github.com/cucumber/cucumber-cpp","commit_stats":{"total_commits":423,"total_committers":54,"mean_commits":7.833333333333333,"dds":0.7588652482269503,"last_synced_commit":"fb1c7024f209432bf3ac332e396deab4fef1f32a"},"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cucumber%2Fcucumber-cpp","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cucumber%2Fcucumber-cpp/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cucumber%2Fcucumber-cpp/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cucumber%2Fcucumber-cpp/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cucumber","download_url":"https://codeload.github.com/cucumber/cucumber-cpp/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247980837,"owners_count":21027808,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-07-30T22:01:17.181Z","updated_at":"2025-04-09T05:09:56.207Z","avatar_url":"https://github.com/cucumber.png","language":"C++","funding_links":["https://opencollective.com/cucumber","https://github.com/sponsors/cucumber"],"categories":["TODO scan for Android support in followings","By Technology"],"sub_categories":["\u003ca name=\"cpp\"\u003e\u003c/a\u003e C++"],"readme":"# Cucumber-CPP\n\n## Overview\n\nCucumber-Cpp allows Cucumber to support step definitions written in C++.\n\n* [Cucumber-Cpp Website](https://github.com/cucumber/cucumber-cpp)\n* [Cucumber-Cpp Documentation](https://github.com/cucumber/cucumber-cpp/wiki/)\n* [Cucumber Website](https://cucumber.io/)\n* [Get in touch](https://cucumber.io/docs/community/get-in-touch/)\n\nIf you need to ask a question, post on the [Cucumber discussion group](https://github.com/orgs/cucumber/discussions).\n\nIf you want to contribute code to the project, guidelines are in [CONTRIBUTING.md](CONTRIBUTING.md).\n\n## Dependencies\n\nIt relies on a few executables:\n\n* [cmake](https://cmake.org/download/) 3.16 or later.\n  Required to setup environment and build software\n\nIt relies on a few libraries:\n\n* [Asio](https://think-async.com/Asio/) 1.18.1 or later.\n* [Boost.Test](https://www.boost.org/) 1.70. Optional for the Boost Test driver.\n* [GTest](https://github.com/google/googletest) 1.11.0 or later. Optional for the GTest driver.\n* [GMock](https://github.com/google/googletest) 1.11.0 or later. Optional for the internal test suite.\n* [nlohmann-json](https://github.com/nlohmann/json) 3.10.5 or later.\n* [Qt6 or Qt5](https://qt-project.org/). Optional for the CalcQt example and QtTest driver.\n* [TCLAP](https://tclap.sourceforge.net/) 1.2.5 or later.\n\nIt might work with earlier versions of the libraries, but it was not tested with them.\nSee the [CI scripts](.github/workflows/run-all.yml) for details about dependency installation.\n\nCucumber-Cpp uses the wire protocol at the moment, so you will need\nCucumber-Ruby installed and available on the path. It is also needed\nto run the functional test suite.\n\nPlease mind that Cucumber-Cpp is not compatible with Cucumber-Ruby 3.x\ndue to a [bug in its wire protocol](https://github.com/cucumber/cucumber-ruby/issues/1183)\nimplementation.\n\nTo install the Ruby prerequisites:\n\n```\ngem install bundler // For windows: gem install bundle\nbundle install\n```\n\n### Windows vs. Linux\n\nTo 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\nworkflow files [for Windows](.github/workflows/windows-build.yml) and [for Linux](.github/workflows/linux-build.yml).\n\n\n## Build\n\nBuilding Cucumber-Cpp with tests and samples:\n\n```\n# Create build directory\ncmake -E make_directory build\n\n# Generate Makefiles\ncmake -E chdir build cmake \\\n    -DCUKE_ENABLE_BOOST_TEST=on \\\n    -DCUKE_ENABLE_GTEST=on \\\n    -DCUKE_ENABLE_QT_6=on \\\n    -DCUKE_TESTS_UNIT=on \\\n    -DCUKE_ENABLE_EXAMPLES=on \\\n    ..\n\n# Build cucumber-cpp\ncmake --build build\n\n# Run unit tests\ncmake --build build --target test\n\n# Run install\ncmake --install build\n```\n\nRunning the Calc example on Unix:\n\n```\nbuild/examples/Calc/BoostCalculatorSteps \u003e/dev/null \u0026\n(cd examples/Calc; cucumber)\n```\n\nRunning the Calc example on Windows (NMake):\n\n```\nstart build\\examples\\Calc\\BoostCalculatorSteps.exe\ncucumber examples\\Calc\n```\n\n## The way it works\n(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))\n\nThe 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.\n\nC++ 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).\n\n```\n                    +------------------------------------------+\n                    |                                          |\n+----------+        | +----------+  +----------+  +----------+ |\n|          |        | |          |  |          |  |          | |\n| Cucumber |        | | Cucumber |  | C++ Step |  | Your     | |\n| Ruby     |---------\u003e| CPP Wire |--| Defs     |--| CPP App  | |\n|          |        | | Server   |  |          |  |          | |\n|          |        | |          |  |          |  |          | |\n+----------+        | +----------+  +----------+  +----------+ |\n                    |                                          |\n                    +------------------------------------------+\n```\n\n## Getting started\n\nHere is a basic example on how to get started with *cucumber-cpp*. First you need to create the basic feature structure:\n\n```\ncucumber --init\n```\n\nThen create a *cucumber.wire* file in the *features/step_definitions* folder with the following content:\n\n```\nhost: localhost\nport: 3902\n```\n\nCreate your first feature (an example is available [here](examples/Calc/features/addition.feature)).\n\nThen 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).\n\nRun 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.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcucumber%2Fcucumber-cpp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcucumber%2Fcucumber-cpp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcucumber%2Fcucumber-cpp/lists"}