Skip to content

A hello world example of GUnit's Behavior Driven Development framework targeting RHEL 7

Notifications You must be signed in to change notification settings

MattYoung50/behavior-driven-development-cpp

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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)

About

A hello world example of GUnit's Behavior Driven Development framework targeting RHEL 7

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages