Updated sample to use new main config style

philsquared
2011-06-24 00:20:35 -07:00
parent b5e745cf79
commit 5c0923fd62

@@ -17,7 +17,8 @@ The rest of this tutorial will assume that the CATCH single header or root folde
Let's start with a really simple example. Say you have written a function to calculate factorials and now you want to test it (let's leave aside TDD for now). To keep things simple we'll put everything in a single file. Let's start with a really simple example. Say you have written a function to calculate factorials and now you want to test it (let's leave aside TDD for now). To keep things simple we'll put everything in a single file.
```c++ ```c++
#include "catch_with_main.hpp" // This brings in a default implementation for main() #define CATCH_CONFIG_MAIN // This tell CATCH to provide a main() - only do this in one cpp file
#include "catch.hpp"
unsigned int Factorial( unsigned int number ) unsigned int Factorial( unsigned int number )
{ {