Add Catch2 test framework. Add example test. Add tests build instructions.

This commit is contained in:
Marek Bel 2018-06-11 22:14:22 +02:00
parent 9772905ade
commit 68ce375a18
5 changed files with 13337 additions and 0 deletions

12
Tests/Example_test.cpp Normal file
View file

@ -0,0 +1,12 @@
#include "catch.hpp"
unsigned int Factorial( unsigned int number ) {
return number <= 1 ? number : Factorial(number-1)*number;
}
TEST_CASE( "Factorials are computed", "[factorial]" ) {
REQUIRE( Factorial(1) == 1 );
REQUIRE( Factorial(2) == 2 );
REQUIRE( Factorial(3) == 6 );
REQUIRE( Factorial(10) == 3628800 );
}