A slice of cucumber

13
A Slice of Cucumber Zeb Mason at #ShefTest on 2016/11/07

Transcript of A slice of cucumber

Page 1: A slice of cucumber

A Slice of CucumberZeb Mason

at #ShefTeston 2016/11/07

Page 2: A slice of cucumber

There are many C++ test frameworks

Aeryn CATCH-VC6 CPUnit FCTX libunittest OAKUT Symbian OS Unit Unit++ xUnit++API Sanity Checker cfix Criterion Fructose

Typemock Isolator++ Opmock TBrun unit.hpp tinytest

ATF Cput crpcut

Google C++ Mocking Framework

Microsoft Unit Testing Framework for C++

Parasoft C/C++test Tessy UnitTest++ …

Bandit CPPOCL/test CUTE Google Test Mockator QtTest TDOG upp11Boost Test Library CppTest cutee Hestia mock++/mockcpp QuickCheck++ Test soon UquoniTestBugEye cpptest-lite CxxTest Hippomocks mockitopp QuickTest Testwell CTA++ VectorCAST/C++QA Systems Cantata CppUnit Embunit Igloo mockpp SafetyNet tpunit++ Visual AssertCATCH CppUTest Exercisix lest NanoCppUnit ShortCUT Trompeloeil WinUnitdoctest CppUnitLite FakeIt liblittletest NullUnit STRIDE TUT xTests

(Source WikiPedia)

Page 3: A slice of cucumber

There are many C++ test frameworks

(Source xkcd)

Page 4: A slice of cucumber

Choose one• Microsoft::VisualStudio::CppUnitTestFramework• The Visual Studio standard• Test runner built into Visual Studio• The lazy choice

Page 5: A slice of cucumber

Re-write tests in Gherkin• That means use Cucumber-CPP?

Page 6: A slice of cucumber

Re-write tests in Gherkin• That means use Cucumber-CPP?• Which means install• cmake 2.8.12 or later.• Boost 1.40 or later.• GTest 1.6 or later.• GMock 1.6 or later.• JSON Spirit• Cucumber-Ruby

Page 7: A slice of cucumber

Re-write tests in Gherkin• That means use Cucumber-CPP?• Which means install• cmake 2.8.12 or later.• Boost 1.40 or later.• GTest 1.6 or later.• GMock 1.6 or later.• JSON Spirit• Cucumber-Ruby

OUCH!

Page 8: A slice of cucumber

Re-write tests in Gherkin• That means use Cucumber-CPP?• Or just write a Python script to produce stub code…

OOH!

Page 9: A slice of cucumber

Re-write tests in Gherkin• That means use Cucumber-CPP?• Or just write a Python script to produce stub code from…

Page 10: A slice of cucumber

Stub code

Page 11: A slice of cucumber

Stub code

Page 12: A slice of cucumber

Stub code

Page 13: A slice of cucumber

Further reading• http://www.codeproject.com/Articles/1084071/A-Slice-of-Cucumber • http://www.codeproject.com/Tips/1107751/Redirecting-std-clog-to-T

est-Framework-Output • The Cucumber Book