4.2. Step - 00 : Installation of Cucumber for C/C++¶
The way we use Behave to run BDD tests with Python (BDD - Python), we use Cucumber CPP to run BDD Tests with C/C++
As a preparation step to play with BDD with C/C++, you will need to install few things up front.
Ruby
Bundler for Ruby:
gem install bundler
Packages to use Cucumber CPP on an Ubuntu System:
sudo apt-get install ruby-dev sudo apt-get install libboost-all-dev sudo apt-get install libgmock-dev sudo apt-get install cmake-extras
Optionally, you can as well install:
sudo apt-get install qtbase5-dev sudo apt-get install xvfb
4.2.1. Cucumber-CPP and it’s Ruby Dependencies.¶
Checkout the Cucumber-CPP first:
git clone https://github.com/cucumber/cucumber-cpp.git
Go to checkout directory, so that you can refer to Gem File:
cd cucumber-cpp
Install Dependencies. Do not run this as SUDO. Run as a normal command only:
bundle install
For future use, checkout sub modules:
git submodule init git submodule update
On Ubuntu (and similar linux systems) install Cucumber-CPP: Go to checkout directory, to compile Cucumber-CPP with CMake:
cd cucumber-cpp cmake -S . -B ../_cucumber-cpp_build
Optionally, you can just build without anything extra:
cd cucumber-cpp cmake -S . -B \ ../_cucumber-cpp_build_minimal \ -DCUKE_USE_STATIC_BOOST=ON \ -DCUKE_USE_STATIC_GTEST=ON \ -DCUKE_ENABLE_BOOST_TEST=OFF \ -DCUKE_ENABLE_EXAMPLES=OFF \ -DCUKE_ENABLE_GTEST=OFF \ -DCUKE_ENABLE_QT=OFF \ -DCUKE_TESTS_E2E=OFF \ -DCUKE_TESTS_UNIT=OFF \ -DCUKE_TESTS_VALGRIND=OFF cd ../_cucumber-cpp_build_minimal make all -j
Install the cucumber libs with sudo into the system:
sudo make install -j