Skip to content

Latest commit

 

History

History
69 lines (59 loc) · 1.62 KB

README.md

File metadata and controls

69 lines (59 loc) · 1.62 KB

Environment

  • This was tested and ran on RHEL 7 leveraging the devtoolset-8

References

  • This leverages GUnit to extend GTest and add BDD capabilities to it

Build Calculator App

% make build

Build Tests

% make test

Running Calculator App

% make run

Running Calculator Unit Tests

% make runtests

Running All Tests

Terminal

% make test
% SCENARIO="test/BDD/calculator.feature" make runtests

Debug Pane VSCode

  • Click the Run & Debug widget on the left side
  • Click the play button beside Debug Tests in the top left

Filter Tests

Run CalculatorTests_GTest.cpp

% bin/runtests --gtest_filter="CalculatorTestsGTest.Should*"

Run CalculatorTests_GUnit.cpp

% bin/runtests --gtest_filter="Calculator Tests GUnit.:Return Correct*"

Run calculator.feature

% SCENARIO="test/BDD/calculator.feature" bin/runtests --gtest_filter="Calculator Addition.*"

Making This Repo Work in a Different Environment

  • If you want to build this in any other environment, you will have to natively compile the libs for your target environment. See console commands below
% git clone https://github.com/cpp-testing/GUnit.git
% cd GUnit
% git submodule update --init --recursive
% mkdir build && cd build
% cmake ..
% cmake --build . --target install
  • The key libs you need are in this repo under lib
    • fmem
    • gherkin
    • gherkin-cpp
    • gtest
    • gunit
    • json (Header only)