mirror of
https://github.com/catchorg/Catch2.git
synced 2024-11-22 13:26:10 +01:00
Fixed NoAssertions warning
This commit is contained in:
parent
42213d4c31
commit
ca2455e6e6
@ -321,12 +321,13 @@ namespace Catch {
|
|||||||
handleUnexpectedInflightException( m_lastAssertionInfo, translateActiveException(), dummyReaction );
|
handleUnexpectedInflightException( m_lastAssertionInfo, translateActiveException(), dummyReaction );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Counts assertions = m_totals.assertions - prevAssertions;
|
||||||
|
bool missingAssertions = testForMissingAssertions(assertions);
|
||||||
|
|
||||||
m_testCaseTracker->close();
|
m_testCaseTracker->close();
|
||||||
handleUnfinishedSections();
|
handleUnfinishedSections();
|
||||||
m_messages.clear();
|
m_messages.clear();
|
||||||
|
|
||||||
Counts assertions = m_totals.assertions - prevAssertions;
|
|
||||||
bool missingAssertions = testForMissingAssertions(assertions);
|
|
||||||
SectionStats testCaseSectionStats(testCaseSection, assertions, duration, missingAssertions);
|
SectionStats testCaseSectionStats(testCaseSection, assertions, duration, missingAssertions);
|
||||||
m_reporter->sectionEnded(testCaseSectionStats);
|
m_reporter->sectionEnded(testCaseSectionStats);
|
||||||
}
|
}
|
||||||
|
@ -1058,5 +1058,5 @@ Misc.tests.cpp:<line number>: passed: v.size() == 5 for: 5 == 5
|
|||||||
Misc.tests.cpp:<line number>: passed: v.capacity() >= 5 for: 5 >= 5
|
Misc.tests.cpp:<line number>: passed: v.capacity() >= 5 for: 5 >= 5
|
||||||
Misc.tests.cpp:<line number>: passed:
|
Misc.tests.cpp:<line number>: passed:
|
||||||
Misc.tests.cpp:<line number>: passed:
|
Misc.tests.cpp:<line number>: passed:
|
||||||
Failed 49 test cases, failed 108 assertions.
|
Failed 61 test cases, failed 120 assertions.
|
||||||
|
|
||||||
|
@ -574,6 +574,15 @@ PASSED:
|
|||||||
with expansion:
|
with expansion:
|
||||||
100.3 == Approx( 100.0 )
|
100.3 == Approx( 100.0 )
|
||||||
|
|
||||||
|
-------------------------------------------------------------------------------
|
||||||
|
An empty test with no assertions
|
||||||
|
-------------------------------------------------------------------------------
|
||||||
|
Misc.tests.cpp:<line number>
|
||||||
|
...............................................................................
|
||||||
|
|
||||||
|
|
||||||
|
No assertions in test case 'An empty test with no assertions'
|
||||||
|
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
An expression with side-effects should only be evaluated once
|
An expression with side-effects should only be evaluated once
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
@ -2118,6 +2127,9 @@ warning:
|
|||||||
this is a message
|
this is a message
|
||||||
this is a warning
|
this is a warning
|
||||||
|
|
||||||
|
|
||||||
|
No assertions in test case 'INFO and WARN do not abort tests'
|
||||||
|
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
INFO gets logged on failure
|
INFO gets logged on failure
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
@ -2530,6 +2542,9 @@ Misc.tests.cpp:<line number>:
|
|||||||
warning:
|
warning:
|
||||||
This one ran
|
This one ran
|
||||||
|
|
||||||
|
|
||||||
|
No assertions in test case 'Nice descriptive name'
|
||||||
|
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
Non-std exceptions can be translated
|
Non-std exceptions can be translated
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
@ -4662,6 +4677,15 @@ with expansion:
|
|||||||
A string sent directly to stdout
|
A string sent directly to stdout
|
||||||
A string sent directly to stderr
|
A string sent directly to stderr
|
||||||
A string sent to stderr via clog
|
A string sent to stderr via clog
|
||||||
|
-------------------------------------------------------------------------------
|
||||||
|
Sends stuff to stdout and stderr
|
||||||
|
-------------------------------------------------------------------------------
|
||||||
|
Misc.tests.cpp:<line number>
|
||||||
|
...............................................................................
|
||||||
|
|
||||||
|
|
||||||
|
No assertions in test case 'Sends stuff to stdout and stderr'
|
||||||
|
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
Some simple comparisons between doubles
|
Some simple comparisons between doubles
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
@ -5390,6 +5414,9 @@ Message.tests.cpp:<line number>:
|
|||||||
FAILED - but was ok:
|
FAILED - but was ok:
|
||||||
CHECK_NOFAIL( 1 == 2 )
|
CHECK_NOFAIL( 1 == 2 )
|
||||||
|
|
||||||
|
|
||||||
|
No assertions in test case 'The NO_FAIL macro reports a failure but does not fail the test'
|
||||||
|
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
This test 'should' fail but doesn't
|
This test 'should' fail but doesn't
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
@ -6755,6 +6782,15 @@ Exception.tests.cpp:<line number>: FAILED:
|
|||||||
due to unexpected exception with message:
|
due to unexpected exception with message:
|
||||||
unexpected exception
|
unexpected exception
|
||||||
|
|
||||||
|
-------------------------------------------------------------------------------
|
||||||
|
When unchecked exceptions are thrown, but caught, they do not affect the test
|
||||||
|
-------------------------------------------------------------------------------
|
||||||
|
Exception.tests.cpp:<line number>
|
||||||
|
...............................................................................
|
||||||
|
|
||||||
|
|
||||||
|
No assertions in test case 'When unchecked exceptions are thrown, but caught, they do not affect the test'
|
||||||
|
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
Where the LHS is not a simple value
|
Where the LHS is not a simple value
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
@ -6766,6 +6802,9 @@ warning:
|
|||||||
Uncomment the code in this test to check that it gives a sensible compiler
|
Uncomment the code in this test to check that it gives a sensible compiler
|
||||||
error
|
error
|
||||||
|
|
||||||
|
|
||||||
|
No assertions in test case 'Where the LHS is not a simple value'
|
||||||
|
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
Where there is more to the expression after the RHS
|
Where there is more to the expression after the RHS
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
@ -6777,6 +6816,9 @@ warning:
|
|||||||
Uncomment the code in this test to check that it gives a sensible compiler
|
Uncomment the code in this test to check that it gives a sensible compiler
|
||||||
error
|
error
|
||||||
|
|
||||||
|
|
||||||
|
No assertions in test case 'Where there is more to the expression after the RHS'
|
||||||
|
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
X/level/0/a
|
X/level/0/a
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
@ -7143,7 +7185,25 @@ Misc.tests.cpp:<line number>
|
|||||||
Misc.tests.cpp:<line number>:
|
Misc.tests.cpp:<line number>:
|
||||||
PASSED:
|
PASSED:
|
||||||
|
|
||||||
|
-------------------------------------------------------------------------------
|
||||||
|
first tag
|
||||||
|
-------------------------------------------------------------------------------
|
||||||
|
Misc.tests.cpp:<line number>
|
||||||
|
...............................................................................
|
||||||
|
|
||||||
|
|
||||||
|
No assertions in test case 'first tag'
|
||||||
|
|
||||||
loose text artifact
|
loose text artifact
|
||||||
|
-------------------------------------------------------------------------------
|
||||||
|
has printf
|
||||||
|
-------------------------------------------------------------------------------
|
||||||
|
Tricky.tests.cpp:<line number>
|
||||||
|
...............................................................................
|
||||||
|
|
||||||
|
|
||||||
|
No assertions in test case 'has printf'
|
||||||
|
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
just failure
|
just failure
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
@ -7154,6 +7214,15 @@ Message.tests.cpp:<line number>: FAILED:
|
|||||||
explicitly with message:
|
explicitly with message:
|
||||||
Previous info should not be seen
|
Previous info should not be seen
|
||||||
|
|
||||||
|
-------------------------------------------------------------------------------
|
||||||
|
just info
|
||||||
|
-------------------------------------------------------------------------------
|
||||||
|
Message.tests.cpp:<line number>
|
||||||
|
...............................................................................
|
||||||
|
|
||||||
|
|
||||||
|
No assertions in test case 'just info'
|
||||||
|
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
long long
|
long long
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
@ -7572,6 +7641,15 @@ PASSED:
|
|||||||
with expansion:
|
with expansion:
|
||||||
"didn|'t" == "didn|'t"
|
"didn|'t" == "didn|'t"
|
||||||
|
|
||||||
|
-------------------------------------------------------------------------------
|
||||||
|
second tag
|
||||||
|
-------------------------------------------------------------------------------
|
||||||
|
Misc.tests.cpp:<line number>
|
||||||
|
...............................................................................
|
||||||
|
|
||||||
|
|
||||||
|
No assertions in test case 'second tag'
|
||||||
|
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
send a single char to INFO
|
send a single char to INFO
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
@ -8329,6 +8407,6 @@ Misc.tests.cpp:<line number>:
|
|||||||
PASSED:
|
PASSED:
|
||||||
|
|
||||||
===============================================================================
|
===============================================================================
|
||||||
test cases: 197 | 144 passed | 49 failed | 4 failed as expected
|
test cases: 197 | 132 passed | 61 failed | 4 failed as expected
|
||||||
assertions: 991 | 862 passed | 108 failed | 21 failed as expected
|
assertions: 1003 | 862 passed | 120 failed | 21 failed as expected
|
||||||
|
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<testsuitesloose text artifact
|
<testsuitesloose text artifact
|
||||||
>
|
>
|
||||||
<testsuite name="<exe-name>" errors="15" failures="94" tests="992" hostname="tbd" time="{duration}" timestamp="{iso8601-timestamp}">
|
<testsuite name="<exe-name>" errors="15" failures="106" tests="1004" hostname="tbd" time="{duration}" timestamp="{iso8601-timestamp}">
|
||||||
<testcase classname="<exe-name>.global" name="# A test name that starts with a #" time="{duration}"/>
|
<testcase classname="<exe-name>.global" name="# A test name that starts with a #" time="{duration}"/>
|
||||||
<testcase classname="<exe-name>.global" name="#1005: Comparing pointer to int and long (NULL can be either on various systems)" time="{duration}"/>
|
<testcase classname="<exe-name>.global" name="#1005: Comparing pointer to int and long (NULL can be either on various systems)" time="{duration}"/>
|
||||||
<testcase classname="<exe-name>.global" name="#1027" time="{duration}"/>
|
<testcase classname="<exe-name>.global" name="#1027" time="{duration}"/>
|
||||||
|
@ -600,7 +600,7 @@
|
|||||||
<OverallResult success="true"/>
|
<OverallResult success="true"/>
|
||||||
</TestCase>
|
</TestCase>
|
||||||
<TestCase name="An empty test with no assertions" tags="[empty]" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" >
|
<TestCase name="An empty test with no assertions" tags="[empty]" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" >
|
||||||
<OverallResult success="true"/>
|
<OverallResult success="false"/>
|
||||||
</TestCase>
|
</TestCase>
|
||||||
<TestCase name="An expression with side-effects should only be evaluated once" tags="[Tricky]" filename="projects/<exe-name>/UsageTests/Tricky.tests.cpp" >
|
<TestCase name="An expression with side-effects should only be evaluated once" tags="[Tricky]" filename="projects/<exe-name>/UsageTests/Tricky.tests.cpp" >
|
||||||
<Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Tricky.tests.cpp" >
|
<Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Tricky.tests.cpp" >
|
||||||
@ -2447,7 +2447,7 @@
|
|||||||
<Warning>
|
<Warning>
|
||||||
this is a warning
|
this is a warning
|
||||||
</Warning>
|
</Warning>
|
||||||
<OverallResult success="true"/>
|
<OverallResult success="false"/>
|
||||||
</TestCase>
|
</TestCase>
|
||||||
<TestCase name="INFO gets logged on failure" tags="[.][failing][messages]" filename="projects/<exe-name>/UsageTests/Message.tests.cpp" >
|
<TestCase name="INFO gets logged on failure" tags="[.][failing][messages]" filename="projects/<exe-name>/UsageTests/Message.tests.cpp" >
|
||||||
<Info>
|
<Info>
|
||||||
@ -2957,7 +2957,7 @@
|
|||||||
<Warning>
|
<Warning>
|
||||||
This one ran
|
This one ran
|
||||||
</Warning>
|
</Warning>
|
||||||
<OverallResult success="true"/>
|
<OverallResult success="false"/>
|
||||||
</TestCase>
|
</TestCase>
|
||||||
<TestCase name="Non-std exceptions can be translated" tags="[!throws][.][failing]" filename="projects/<exe-name>/UsageTests/Exception.tests.cpp" >
|
<TestCase name="Non-std exceptions can be translated" tags="[!throws][.][failing]" filename="projects/<exe-name>/UsageTests/Exception.tests.cpp" >
|
||||||
<Exception filename="projects/<exe-name>/UsageTests/Exception.tests.cpp" >
|
<Exception filename="projects/<exe-name>/UsageTests/Exception.tests.cpp" >
|
||||||
@ -5375,7 +5375,7 @@
|
|||||||
<OverallResult success="true"/>
|
<OverallResult success="true"/>
|
||||||
</TestCase>
|
</TestCase>
|
||||||
<TestCase name="Sends stuff to stdout and stderr" tags="[.]" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" >
|
<TestCase name="Sends stuff to stdout and stderr" tags="[.]" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" >
|
||||||
<OverallResult success="true">
|
<OverallResult success="false">
|
||||||
<StdOut>
|
<StdOut>
|
||||||
A string sent directly to stdout
|
A string sent directly to stdout
|
||||||
</StdOut>
|
</StdOut>
|
||||||
@ -6183,7 +6183,7 @@ Message from section two
|
|||||||
1 == 2
|
1 == 2
|
||||||
</Expanded>
|
</Expanded>
|
||||||
</Expression>
|
</Expression>
|
||||||
<OverallResult success="true"/>
|
<OverallResult success="false"/>
|
||||||
</TestCase>
|
</TestCase>
|
||||||
<TestCase name="This test 'should' fail but doesn't" tags="[!shouldfail][.][failing]" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" >
|
<TestCase name="This test 'should' fail but doesn't" tags="[!shouldfail][.][failing]" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" >
|
||||||
<OverallResult success="false"/>
|
<OverallResult success="false"/>
|
||||||
@ -7699,19 +7699,19 @@ Message from section two
|
|||||||
<OverallResult success="false"/>
|
<OverallResult success="false"/>
|
||||||
</TestCase>
|
</TestCase>
|
||||||
<TestCase name="When unchecked exceptions are thrown, but caught, they do not affect the test" tags="[!throws]" filename="projects/<exe-name>/UsageTests/Exception.tests.cpp" >
|
<TestCase name="When unchecked exceptions are thrown, but caught, they do not affect the test" tags="[!throws]" filename="projects/<exe-name>/UsageTests/Exception.tests.cpp" >
|
||||||
<OverallResult success="true"/>
|
<OverallResult success="false"/>
|
||||||
</TestCase>
|
</TestCase>
|
||||||
<TestCase name="Where the LHS is not a simple value" tags="[.][Tricky][failing]" filename="projects/<exe-name>/UsageTests/Tricky.tests.cpp" >
|
<TestCase name="Where the LHS is not a simple value" tags="[.][Tricky][failing]" filename="projects/<exe-name>/UsageTests/Tricky.tests.cpp" >
|
||||||
<Warning>
|
<Warning>
|
||||||
Uncomment the code in this test to check that it gives a sensible compiler error
|
Uncomment the code in this test to check that it gives a sensible compiler error
|
||||||
</Warning>
|
</Warning>
|
||||||
<OverallResult success="true"/>
|
<OverallResult success="false"/>
|
||||||
</TestCase>
|
</TestCase>
|
||||||
<TestCase name="Where there is more to the expression after the RHS" tags="[.][Tricky][failing]" filename="projects/<exe-name>/UsageTests/Tricky.tests.cpp" >
|
<TestCase name="Where there is more to the expression after the RHS" tags="[.][Tricky][failing]" filename="projects/<exe-name>/UsageTests/Tricky.tests.cpp" >
|
||||||
<Warning>
|
<Warning>
|
||||||
Uncomment the code in this test to check that it gives a sensible compiler error
|
Uncomment the code in this test to check that it gives a sensible compiler error
|
||||||
</Warning>
|
</Warning>
|
||||||
<OverallResult success="true"/>
|
<OverallResult success="false"/>
|
||||||
</TestCase>
|
</TestCase>
|
||||||
<TestCase name="X/level/0/a" tags="[Tricky]" filename="projects/<exe-name>/UsageTests/Tricky.tests.cpp" >
|
<TestCase name="X/level/0/a" tags="[Tricky]" filename="projects/<exe-name>/UsageTests/Tricky.tests.cpp" >
|
||||||
<OverallResult success="true"/>
|
<OverallResult success="true"/>
|
||||||
@ -8052,11 +8052,11 @@ Message from section two
|
|||||||
<OverallResult success="true"/>
|
<OverallResult success="true"/>
|
||||||
</TestCase>
|
</TestCase>
|
||||||
<TestCase name="first tag" tags="[tag1]" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" >
|
<TestCase name="first tag" tags="[tag1]" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" >
|
||||||
<OverallResult success="true"/>
|
<OverallResult success="false"/>
|
||||||
</TestCase>
|
</TestCase>
|
||||||
<TestCase name="has printf" filename="projects/<exe-name>/UsageTests/Tricky.tests.cpp" >
|
<TestCase name="has printf" filename="projects/<exe-name>/UsageTests/Tricky.tests.cpp" >
|
||||||
loose text artifact
|
loose text artifact
|
||||||
<OverallResult success="true"/>
|
<OverallResult success="false"/>
|
||||||
</TestCase>
|
</TestCase>
|
||||||
<TestCase name="just failure" tags="[.][fail][isolated info][messages]" filename="projects/<exe-name>/UsageTests/Message.tests.cpp" >
|
<TestCase name="just failure" tags="[.][fail][isolated info][messages]" filename="projects/<exe-name>/UsageTests/Message.tests.cpp" >
|
||||||
<Failure filename="projects/<exe-name>/UsageTests/Message.tests.cpp" >
|
<Failure filename="projects/<exe-name>/UsageTests/Message.tests.cpp" >
|
||||||
@ -8065,7 +8065,7 @@ loose text artifact
|
|||||||
<OverallResult success="false"/>
|
<OverallResult success="false"/>
|
||||||
</TestCase>
|
</TestCase>
|
||||||
<TestCase name="just info" tags="[info][isolated info][messages]" filename="projects/<exe-name>/UsageTests/Message.tests.cpp" >
|
<TestCase name="just info" tags="[info][isolated info][messages]" filename="projects/<exe-name>/UsageTests/Message.tests.cpp" >
|
||||||
<OverallResult success="true"/>
|
<OverallResult success="false"/>
|
||||||
</TestCase>
|
</TestCase>
|
||||||
<TestCase name="long long" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" >
|
<TestCase name="long long" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" >
|
||||||
<Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" >
|
<Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" >
|
||||||
@ -8512,7 +8512,7 @@ loose text artifact
|
|||||||
<OverallResult success="true"/>
|
<OverallResult success="true"/>
|
||||||
</TestCase>
|
</TestCase>
|
||||||
<TestCase name="second tag" tags="[tag2]" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" >
|
<TestCase name="second tag" tags="[tag2]" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" >
|
||||||
<OverallResult success="true"/>
|
<OverallResult success="false"/>
|
||||||
</TestCase>
|
</TestCase>
|
||||||
<TestCase name="send a single char to INFO" tags="[.][failing]" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" >
|
<TestCase name="send a single char to INFO" tags="[.][failing]" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" >
|
||||||
<Info>
|
<Info>
|
||||||
@ -9257,7 +9257,7 @@ loose text artifact
|
|||||||
</Section>
|
</Section>
|
||||||
<OverallResult success="true"/>
|
<OverallResult success="true"/>
|
||||||
</TestCase>
|
</TestCase>
|
||||||
<OverallResults successes="862" failures="109" expectedFailures="21"/>
|
<OverallResults successes="862" failures="121" expectedFailures="21"/>
|
||||||
</Group>
|
</Group>
|
||||||
<OverallResults successes="862" failures="108" expectedFailures="21"/>
|
<OverallResults successes="862" failures="120" expectedFailures="21"/>
|
||||||
</Catch>
|
</Catch>
|
||||||
|
Loading…
Reference in New Issue
Block a user