mirror of
https://github.com/catchorg/Catch2.git
synced 2025-06-01 01:18:02 +00:00
Added className to TestCaseInfo
className is passed through from class based test methods and held in the TestCaseInfo. For free-function based test cases it is set to "global". The JUnit reporter uses the className value to populate he class attribute.
This commit is contained in:
parent
81cb69ef18
commit
78fba28c4b
7 changed files with 64 additions and 31 deletions
|
@ -31,8 +31,8 @@ namespace
|
|||
}
|
||||
|
||||
|
||||
METHOD_AS_TEST_CASE( TestClass::succeedingCase, "./succeeding/TestClass/succeedingCase", "A method based test run that succeeds" )
|
||||
METHOD_AS_TEST_CASE( TestClass::failingCase, "./failing/TestClass/failingCase", "A method based test run that fails" )
|
||||
METHOD_AS_TEST_CASE( TestClass::succeedingCase, "./succeeding/TestClass/succeedingCase", "A method based test run that succeeds [class]" )
|
||||
METHOD_AS_TEST_CASE( TestClass::failingCase, "./failing/TestClass/failingCase", "A method based test run that fails [class]" )
|
||||
|
||||
|
||||
struct Fixture
|
||||
|
@ -42,7 +42,7 @@ struct Fixture
|
|||
int m_a;
|
||||
};
|
||||
|
||||
TEST_CASE_METHOD( Fixture, "./succeeding/Fixture/succeedingCase", "A method based test run that succeeds" )
|
||||
TEST_CASE_METHOD( Fixture, "./succeeding/Fixture/succeedingCase", "A method based test run that succeeds [class]" )
|
||||
{
|
||||
REQUIRE( m_a == 1 );
|
||||
}
|
||||
|
@ -50,7 +50,7 @@ TEST_CASE_METHOD( Fixture, "./succeeding/Fixture/succeedingCase", "A method base
|
|||
// We should be able to write our tests within a different namespace
|
||||
namespace Inner
|
||||
{
|
||||
TEST_CASE_METHOD( Fixture, "./failing/Fixture/failingCase", "A method based test run that fails" )
|
||||
TEST_CASE_METHOD( Fixture, "./failing/Fixture/failingCase", "A method based test run that fails [class]" )
|
||||
{
|
||||
REQUIRE( m_a == 2 );
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue