Debian Codegraph @

3rdparty/catch2/examples/020-TestCase-1.cpp

raw
1 // 020-TestCase-1.cpp
2
3 #include <catch2/catch_test_macros.hpp>
4
5 TEST_CASE( "1: All test cases reside in other .cpp files (empty)", "[multi-file:1]" ) {
6 }
7
8 // ^^^
9 // Normally no TEST_CASEs in this file.
10 // Here just to show there are two source files via option --list-tests.
11
12 // Compile & run:
13 // - g++ -std=c++14 -Wall -I$(CATCH_SINGLE_INCLUDE) -c 020-TestCase-1.cpp
14 // - g++ -std=c++14 -Wall -I$(CATCH_SINGLE_INCLUDE) -o 020-TestCase TestCase-1.o 020-TestCase-2.cpp && 020-TestCase --success
15 //
16 // - cl -EHsc -I%CATCH_SINGLE_INCLUDE% -c 020-TestCase-1.cpp
17 // - cl -EHsc -I%CATCH_SINGLE_INCLUDE% -Fe020-TestCase.exe 020-TestCase-1.obj 020-TestCase-2.cpp && 020-TestCase --success
18
19 // Expected test case listing:
20 //
21 // prompt> 020-TestCase --list-tests *
22 // Matching test cases:
23 // 1: All test cases reside in other .cpp files (empty)
24 // [multi-file:1]
25 // 2: Factorial of 0 is computed (fail)
26 // [multi-file:2]
27 // 2: Factorials of 1 and higher are computed (pass)
28 // [multi-file:2]
29 // 3 matching test cases