Removed deprecated section tracking implementation and tests

This commit is contained in:
Phil Nash
2015-11-03 07:38:14 +00:00
parent 471bd2556a
commit bc8840cbb8
8 changed files with 9 additions and 614 deletions

View File

@@ -869,6 +869,6 @@ with expansion:
"first" == "second"
===============================================================================
test cases: 160 | 117 passed | 42 failed | 1 failed as expected
assertions: 927 | 827 passed | 87 failed | 13 failed as expected
test cases: 159 | 116 passed | 42 failed | 1 failed as expected
assertions: 907 | 807 passed | 87 failed | 13 failed as expected

View File

@@ -8870,179 +8870,7 @@ PASSED:
with expansion:
1 > 0
-------------------------------------------------------------------------------
section tracking
-------------------------------------------------------------------------------
SectionTrackerTests.cpp:<line number>
...............................................................................
SectionTrackerTests.cpp:<line number>:
PASSED:
CHECK_FALSE( testCaseTracker.isCompleted() )
with expansion:
!false
-------------------------------------------------------------------------------
section tracking
test case with no sections
-------------------------------------------------------------------------------
SectionTrackerTests.cpp:<line number>
...............................................................................
SectionTrackerTests.cpp:<line number>:
PASSED:
CHECK_FALSE( testCaseTracker.isCompleted() )
with expansion:
!false
SectionTrackerTests.cpp:<line number>:
PASSED:
CHECK( testCaseTracker.isCompleted() )
with expansion:
true
-------------------------------------------------------------------------------
section tracking
-------------------------------------------------------------------------------
SectionTrackerTests.cpp:<line number>
...............................................................................
SectionTrackerTests.cpp:<line number>:
PASSED:
CHECK_FALSE( testCaseTracker.isCompleted() )
with expansion:
!false
-------------------------------------------------------------------------------
section tracking
test case with one section
-------------------------------------------------------------------------------
SectionTrackerTests.cpp:<line number>
...............................................................................
SectionTrackerTests.cpp:<line number>:
PASSED:
CHECK( testCaseTracker.enterSection( section1Name ) )
with expansion:
true
SectionTrackerTests.cpp:<line number>:
PASSED:
CHECK_FALSE( testCaseTracker.isCompleted() )
with expansion:
!false
SectionTrackerTests.cpp:<line number>:
PASSED:
CHECK( testCaseTracker.isCompleted() )
with expansion:
true
SectionTrackerTests.cpp:<line number>:
PASSED:
CHECK_FALSE( testCaseTracker.enterSection( section1Name ) )
with expansion:
!false
-------------------------------------------------------------------------------
section tracking
-------------------------------------------------------------------------------
SectionTrackerTests.cpp:<line number>
...............................................................................
SectionTrackerTests.cpp:<line number>:
PASSED:
CHECK_FALSE( testCaseTracker.isCompleted() )
with expansion:
!false
-------------------------------------------------------------------------------
section tracking
test case with two consecutive sections
-------------------------------------------------------------------------------
SectionTrackerTests.cpp:<line number>
...............................................................................
SectionTrackerTests.cpp:<line number>:
PASSED:
CHECK( testCaseTracker.enterSection( section1Name ) )
with expansion:
true
SectionTrackerTests.cpp:<line number>:
PASSED:
CHECK_FALSE( testCaseTracker.enterSection( section2Name ) )
with expansion:
!false
SectionTrackerTests.cpp:<line number>:
PASSED:
CHECK_FALSE( testCaseTracker.isCompleted() )
with expansion:
!false
SectionTrackerTests.cpp:<line number>:
PASSED:
CHECK_FALSE( testCaseTracker.enterSection( section1Name ) )
with expansion:
!false
SectionTrackerTests.cpp:<line number>:
PASSED:
CHECK( testCaseTracker.enterSection( section2Name ) )
with expansion:
true
SectionTrackerTests.cpp:<line number>:
PASSED:
CHECK( testCaseTracker.isCompleted() )
with expansion:
true
-------------------------------------------------------------------------------
section tracking
-------------------------------------------------------------------------------
SectionTrackerTests.cpp:<line number>
...............................................................................
SectionTrackerTests.cpp:<line number>:
PASSED:
CHECK_FALSE( testCaseTracker.isCompleted() )
with expansion:
!false
-------------------------------------------------------------------------------
section tracking
test case with one section within another
-------------------------------------------------------------------------------
SectionTrackerTests.cpp:<line number>
...............................................................................
SectionTrackerTests.cpp:<line number>:
PASSED:
CHECK( testCaseTracker.enterSection( section1Name ) )
with expansion:
true
SectionTrackerTests.cpp:<line number>:
PASSED:
CHECK( testCaseTracker.enterSection( section2Name ) )
with expansion:
true
SectionTrackerTests.cpp:<line number>:
PASSED:
CHECK_FALSE( testCaseTracker.isCompleted() )
with expansion:
!false
SectionTrackerTests.cpp:<line number>:
PASSED:
CHECK( testCaseTracker.isCompleted() )
with expansion:
true
===============================================================================
test cases: 160 | 120 passed | 39 failed | 1 failed as expected
assertions: 920 | 827 passed | 80 failed | 13 failed as expected
test cases: 159 | 119 passed | 39 failed | 1 failed as expected
assertions: 900 | 807 passed | 80 failed | 13 failed as expected

View File

@@ -1,5 +1,5 @@
<testsuites>
<testsuite name="CatchSelfTest" errors="12" failures="68" tests="920" hostname="tbd" time="{duration}" timestamp="tbd">
<testsuite name="CatchSelfTest" errors="12" failures="68" tests="900" hostname="tbd" time="{duration}" timestamp="tbd">
<testcase classname="global" name="toString(enum)" time="{duration}"/>
<testcase classname="global" name="toString(enum w/operator&lt;&lt;)" time="{duration}"/>
<testcase classname="global" name="toString(enum class)" time="{duration}"/>
@@ -644,11 +644,6 @@ TrickyTests.cpp:<line number>
<testcase classname="Scenario: This is a really long scenario name to see how the list command deals with wrapping" name="Given: A section name that is so long that it cannot fit in a single console width/When: The test headers are printed as part of the normal running of the scenario/Then: The, deliberately very long and overly verbose (you see what I did there?) section names must wrap, along with an indent" time="{duration}"/>
<testcase classname="Fixture" name="Scenario: BDD tests requiring Fixtures to provide commonly-accessed data or methods/Given: No operations precede me" time="{duration}"/>
<testcase classname="Fixture" name="Scenario: BDD tests requiring Fixtures to provide commonly-accessed data or methods/Given: No operations precede me/When: We get the count/Then: Subsequently values are higher" time="{duration}"/>
<testcase classname="section tracking" name="root" time="{duration}"/>
<testcase classname="section tracking" name="test case with no sections" time="{duration}"/>
<testcase classname="section tracking" name="test case with one section" time="{duration}"/>
<testcase classname="section tracking" name="test case with two consecutive sections" time="{duration}"/>
<testcase classname="section tracking" name="test case with one section within another" time="{duration}"/>
<system-out>
Message from section one
Message from section two

View File

@@ -9422,182 +9422,7 @@ there"
</Section>
<OverallResult success="true"/>
</TestCase>
<TestCase name="section tracking">
<Expression success="true" type="CHECK_FALSE" filename="projects/SelfTest/SectionTrackerTests.cpp" >
<Original>
!testCaseTracker.isCompleted()
</Original>
<Expanded>
!false
</Expanded>
</Expression>
<Section name="test case with no sections">
<Expression success="true" type="CHECK_FALSE" filename="projects/SelfTest/SectionTrackerTests.cpp" >
<Original>
!testCaseTracker.isCompleted()
</Original>
<Expanded>
!false
</Expanded>
</Expression>
<Expression success="true" type="CHECK" filename="projects/SelfTest/SectionTrackerTests.cpp" >
<Original>
testCaseTracker.isCompleted()
</Original>
<Expanded>
true
</Expanded>
</Expression>
<OverallResults successes="2" failures="0" expectedFailures="0"/>
</Section>
<Expression success="true" type="CHECK_FALSE" filename="projects/SelfTest/SectionTrackerTests.cpp" >
<Original>
!testCaseTracker.isCompleted()
</Original>
<Expanded>
!false
</Expanded>
</Expression>
<Section name="test case with one section">
<Expression success="true" type="CHECK" filename="projects/SelfTest/SectionTrackerTests.cpp" >
<Original>
testCaseTracker.enterSection( section1Name )
</Original>
<Expanded>
true
</Expanded>
</Expression>
<Expression success="true" type="CHECK_FALSE" filename="projects/SelfTest/SectionTrackerTests.cpp" >
<Original>
!testCaseTracker.isCompleted()
</Original>
<Expanded>
!false
</Expanded>
</Expression>
<Expression success="true" type="CHECK" filename="projects/SelfTest/SectionTrackerTests.cpp" >
<Original>
testCaseTracker.isCompleted()
</Original>
<Expanded>
true
</Expanded>
</Expression>
<Expression success="true" type="CHECK_FALSE" filename="projects/SelfTest/SectionTrackerTests.cpp" >
<Original>
!testCaseTracker.enterSection( section1Name )
</Original>
<Expanded>
!false
</Expanded>
</Expression>
<OverallResults successes="4" failures="0" expectedFailures="0"/>
</Section>
<Expression success="true" type="CHECK_FALSE" filename="projects/SelfTest/SectionTrackerTests.cpp" >
<Original>
!testCaseTracker.isCompleted()
</Original>
<Expanded>
!false
</Expanded>
</Expression>
<Section name="test case with two consecutive sections">
<Expression success="true" type="CHECK" filename="projects/SelfTest/SectionTrackerTests.cpp" >
<Original>
testCaseTracker.enterSection( section1Name )
</Original>
<Expanded>
true
</Expanded>
</Expression>
<Expression success="true" type="CHECK_FALSE" filename="projects/SelfTest/SectionTrackerTests.cpp" >
<Original>
!testCaseTracker.enterSection( section2Name )
</Original>
<Expanded>
!false
</Expanded>
</Expression>
<Expression success="true" type="CHECK_FALSE" filename="projects/SelfTest/SectionTrackerTests.cpp" >
<Original>
!testCaseTracker.isCompleted()
</Original>
<Expanded>
!false
</Expanded>
</Expression>
<Expression success="true" type="CHECK_FALSE" filename="projects/SelfTest/SectionTrackerTests.cpp" >
<Original>
!testCaseTracker.enterSection( section1Name )
</Original>
<Expanded>
!false
</Expanded>
</Expression>
<Expression success="true" type="CHECK" filename="projects/SelfTest/SectionTrackerTests.cpp" >
<Original>
testCaseTracker.enterSection( section2Name )
</Original>
<Expanded>
true
</Expanded>
</Expression>
<Expression success="true" type="CHECK" filename="projects/SelfTest/SectionTrackerTests.cpp" >
<Original>
testCaseTracker.isCompleted()
</Original>
<Expanded>
true
</Expanded>
</Expression>
<OverallResults successes="6" failures="0" expectedFailures="0"/>
</Section>
<Expression success="true" type="CHECK_FALSE" filename="projects/SelfTest/SectionTrackerTests.cpp" >
<Original>
!testCaseTracker.isCompleted()
</Original>
<Expanded>
!false
</Expanded>
</Expression>
<Section name="test case with one section within another">
<Expression success="true" type="CHECK" filename="projects/SelfTest/SectionTrackerTests.cpp" >
<Original>
testCaseTracker.enterSection( section1Name )
</Original>
<Expanded>
true
</Expanded>
</Expression>
<Expression success="true" type="CHECK" filename="projects/SelfTest/SectionTrackerTests.cpp" >
<Original>
testCaseTracker.enterSection( section2Name )
</Original>
<Expanded>
true
</Expanded>
</Expression>
<Expression success="true" type="CHECK_FALSE" filename="projects/SelfTest/SectionTrackerTests.cpp" >
<Original>
!testCaseTracker.isCompleted()
</Original>
<Expanded>
!false
</Expanded>
</Expression>
<Expression success="true" type="CHECK" filename="projects/SelfTest/SectionTrackerTests.cpp" >
<Original>
testCaseTracker.isCompleted()
</Original>
<Expanded>
true
</Expanded>
</Expression>
<OverallResults successes="4" failures="0" expectedFailures="0"/>
</Section>
<OverallResult success="true"/>
</TestCase>
<OverallResults successes="827" failures="80" expectedFailures="13"/>
<OverallResults successes="807" failures="80" expectedFailures="13"/>
</Group>
<OverallResults successes="827" failures="80" expectedFailures="13"/>
<OverallResults successes="807" failures="80" expectedFailures="13"/>
</Catch>

View File

@@ -1,114 +0,0 @@
/*
* Created by Phil on 20/07/2013.
* Copyright 2013 Two Blue Cubes Ltd
*
* Distributed under the Boost Software License, Version 1.0. (See accompanying
* file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
*/
#include "internal/catch_suppress_warnings.h"
#include "internal/catch_test_case_tracker.hpp"
#include "catch.hpp"
TEST_CASE( "section tracking", "" ) {
using namespace Catch;
TestCaseTracker testCaseTracker( "test case" );
const std::string section1Name = "section 1";
const std::string section2Name = "section 2";
CHECK_FALSE( testCaseTracker.isCompleted() );
SECTION( "test case with no sections", "" ) {
{
TestCaseTracker::Guard guard( testCaseTracker );
CHECK_FALSE( testCaseTracker.isCompleted() );
}
CHECK( testCaseTracker.isCompleted() );
}
SECTION( "test case with one section", "" ) {
{
TestCaseTracker::Guard guard( testCaseTracker );
// Enter section? - yes
CHECK( testCaseTracker.enterSection( section1Name ) );
CHECK_FALSE( testCaseTracker.isCompleted() );
testCaseTracker.leaveSection();
// Leave test case - now complete
}
CHECK( testCaseTracker.isCompleted() );
// ...
// Enter test case again
{
TestCaseTracker::Guard guard( testCaseTracker );
// Enter section? - no - now complete
CHECK_FALSE( testCaseTracker.enterSection( section1Name ) );
}
}
SECTION( "test case with two consecutive sections", "" ) {
// Enter test case
{
TestCaseTracker::Guard guard( testCaseTracker );
// Enter section 1? - yes
CHECK( testCaseTracker.enterSection( section1Name ) );
testCaseTracker.leaveSection();
// Enter section 2? - no - we just exected section 1
CHECK_FALSE( testCaseTracker.enterSection( section2Name ) );
// Leave test case - incomplete (still need to visit section 2)
}
CHECK_FALSE( testCaseTracker.isCompleted() );
// ...
// Enter test case again
{
TestCaseTracker::Guard guard( testCaseTracker );
// Enter section 1? - no, already done now
CHECK_FALSE( testCaseTracker.enterSection( section1Name ) );
// Enter section 2? - yes
CHECK( testCaseTracker.enterSection( section2Name ) );
testCaseTracker.leaveSection();
// Leave test case - now complete
}
CHECK( testCaseTracker.isCompleted() );
}
SECTION( "test case with one section within another", "" ) {
// Enter test case again
{
TestCaseTracker::Guard guard( testCaseTracker );
// Enter section 1? - yes
CHECK( testCaseTracker.enterSection( section1Name ) );
// Enter section 2? - yes
CHECK( testCaseTracker.enterSection( section2Name ) );
CHECK_FALSE( testCaseTracker.isCompleted() );
testCaseTracker.leaveSection(); // section 2
testCaseTracker.leaveSection(); // section 1
// Leave test case - now complete
}
CHECK( testCaseTracker.isCompleted() );
}
}