Coder Social home page Coder Social logo

mbed101 / cucumber-cpp Goto Github PK

View Code? Open in Web Editor NEW

This project forked from cucumber/cucumber-cpp

0.0 0.0 0.0 646 KB

Support for writing Cucumber step definitions in C++

License: MIT License

Shell 1.44% Ruby 4.15% C++ 71.83% CMake 20.55% Gherkin 2.02%

cucumber-cpp's Introduction

Cucumber-CPP

Join the chat at https://gitter.im/cucumber/cucumber-cpp Linux and OSX build status Windows build status Coverage Status

Cucumber-Cpp allows Cucumber to support step definitions written in C++.

If you need to ask a question, don't open a ticket on GitHub! Please post your question on the Cucumber discussion group instead, prefixing the title with [CPP].

If you want to contribute code to the project, guidelines are in the CONTRIBUTING.md file.

It relies on a few executables:

  • cmake 3.1 or later. Required to setup environment and build software

It relies on a few libraries:

  • Boost 1.46 or later (1.51+ on Windows). Required libraries: thread, system, regex, date_time and program_options. Optional library for Boost Test driver: test.
  • GTest 1.6 or later. Optional for the GTest driver. By default downloaded and built by CMake.
  • GMock 1.6 or later. Optional for the internal test suite. By default downloaded and built by CMake.
  • Qt 4 or 5. Optional for the CalcQt example and QtTest driver (only Qt 5).

This header-only library is included in the source code:

It might work with earlier versions of the libraries, but it was not tested with them.

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 implementation.

To install the Ruby prerequisites:

gem install bundler // For windows: gem install bundle
bundle install

Building Cucumber-Cpp with tests and samples:

# Download test suite
git submodule init
git submodule update

# Create build directory
cmake -E make_directory build

# Generate Makefiles
cmake -E chdir build cmake -DCUKE_ENABLE_EXAMPLES=on -DCMAKE_INSTALL_PREFIX=${prefix} ..

# Build cucumber-cpp and tests
cmake --build build

# Run unit tests
cmake --build build --target test

# Run install
cmake --build build --target install

# Check implementation against common cucumber test suite
cmake --build build --target features

Running the Calc example on Unix:

build/examples/Calc/BoostCalculatorSteps >/dev/null &
cucumber examples/Calc

Running the Calc example on Windows (NMake):

start build\examples\Calc\BoostCalculatorSteps.exe
cucumber examples\Calc

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).

Then create your step definition runner (an example is available here). In order to compile the step definition runner, make sure to add cucumber include directory 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.

cucumber-cpp's People

Contributors

paoloambrosio avatar muggenhor avatar konserw avatar jermus67 avatar larryprice avatar ursfassler avatar uoqs avatar hvellyr avatar matlo607 avatar mxygem avatar mpkorstanje avatar lemutar avatar toh-ableton avatar sabst avatar meshell avatar martindelille avatar lukaswoodtli avatar maxmeyer avatar canmor avatar aslakhellesoy avatar cqcmdwym avatar gambr avatar hugoferreira avatar kevgo avatar mattwynne avatar gitter-badger avatar aallrd avatar ala-ableton avatar gck-ableton avatar kai-unger avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.