You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
trompeloeil/test
Tore Martin Hagen be24ddd848 Added hook so that successful tests can be reported correctly
Catch2 has a framework to report number of assertions and list
which testcases it has ran. This does not work with REQUIRE_CALL
in trompeloeil.

Given a test in catch2 like this

SCENARIO("Foo test")
{
    WHEN("foo called"){
        THEN("call barfunc"){
            REQUIRE_CALL(bar, barfunc(5, ANY(int))).RETURN(4);
            foo.foo(5, 6);
        }
    }
}

will be reported as this:
  ===============================================================================
  test cases: 1 | 1 passed
  assertions: - none -

If you run the test with the -s option to include  successful tests in ouput
you get the same output as above

With this fix REQUIRE_CALL is counted as asserts and are included in the
successful output like this:
  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  footest is a Catch v2.8.0 host application.
  Run with -? for options

  -------------------------------------------------------------------------------
  Scenario: Foo test
         When: foo called
         Then: call barfunc
  -------------------------------------------------------------------------------
  /scratch/onetechmain/qt/test/HwModules/gpio/FooTest.cpp:50
  ...............................................................................

  /scratch/onetechmain/qt/test/TestHelpers/trompeloeil/include/catch2/trompeloeil.hpp:52: PASSED:
    REQUIRE( trompeloeil_mock_calls_done_correctly != 0 )
  with expansion:
    "bar.barfunc(5, ANY(int))" != 0

  ===============================================================================
  All tests passed (1 assertion in 1 test case)
6 years ago
..
compiling_tests.cpp Added hook so that successful tests can be reported correctly 6 years ago
compiling_tests.hpp Added hook so that successful tests can be reported correctly 6 years ago
compiling_tests_11.cpp Disable indirect null for MSVC <=14 6 years ago
compiling_tests_14.cpp Added hook so that successful tests can be reported correctly 6 years ago
thread_terror.cpp Host self test programs in cmake 8 years ago