mirror of
https://github.com/catchorg/Catch2.git
synced 2024-11-25 23:06:10 +01:00
Use TestCaseInfo in tests directly
This commit is contained in:
parent
aee31d0620
commit
816f69416b
@ -2263,8 +2263,8 @@ Generators.tests.cpp:<line number>: passed: strlen(std::get<0>(data)) == static_
|
|||||||
Generators.tests.cpp:<line number>: passed: strlen(std::get<0>(data)) == static_cast<size_t>(std::get<1>(data)) for: 6 == 6
|
Generators.tests.cpp:<line number>: passed: strlen(std::get<0>(data)) == static_cast<size_t>(std::get<1>(data)) for: 6 == 6
|
||||||
Generators.tests.cpp:<line number>: passed: strlen(std::get<0>(data)) == static_cast<size_t>(std::get<1>(data)) for: 5 == 5
|
Generators.tests.cpp:<line number>: passed: strlen(std::get<0>(data)) == static_cast<size_t>(std::get<1>(data)) for: 5 == 5
|
||||||
Generators.tests.cpp:<line number>: passed: strlen(std::get<0>(data)) == static_cast<size_t>(std::get<1>(data)) for: 6 == 6
|
Generators.tests.cpp:<line number>: passed: strlen(std::get<0>(data)) == static_cast<size_t>(std::get<1>(data)) for: 6 == 6
|
||||||
Tag.tests.cpp:<line number>: passed: testcase->tags.size() == 1 for: 1 == 1
|
Tag.tests.cpp:<line number>: passed: testcase.tags.size() == 1 for: 1 == 1
|
||||||
Tag.tests.cpp:<line number>: passed: testcase->tags[0].original == "magic.tag"_catch_sr for: magic.tag == magic.tag
|
Tag.tests.cpp:<line number>: passed: testcase.tags[0].original == "magic.tag"_catch_sr for: magic.tag == magic.tag
|
||||||
Exception.tests.cpp:<line number>: failed: unexpected exception with message: 'Why would you throw a std::string?'
|
Exception.tests.cpp:<line number>: failed: unexpected exception with message: 'Why would you throw a std::string?'
|
||||||
Misc.tests.cpp:<line number>: passed: result == "\"wide load\"" for: ""wide load"" == ""wide load""
|
Misc.tests.cpp:<line number>: passed: result == "\"wide load\"" for: ""wide load"" == ""wide load""
|
||||||
Misc.tests.cpp:<line number>: passed: result == "\"wide load\"" for: ""wide load"" == ""wide load""
|
Misc.tests.cpp:<line number>: passed: result == "\"wide load\"" for: ""wide load"" == ""wide load""
|
||||||
|
@ -16123,12 +16123,12 @@ Tag.tests.cpp:<line number>
|
|||||||
...............................................................................
|
...............................................................................
|
||||||
|
|
||||||
Tag.tests.cpp:<line number>: PASSED:
|
Tag.tests.cpp:<line number>: PASSED:
|
||||||
REQUIRE( testcase->tags.size() == 1 )
|
REQUIRE( testcase.tags.size() == 1 )
|
||||||
with expansion:
|
with expansion:
|
||||||
1 == 1
|
1 == 1
|
||||||
|
|
||||||
Tag.tests.cpp:<line number>: PASSED:
|
Tag.tests.cpp:<line number>: PASSED:
|
||||||
REQUIRE( testcase->tags[0].original == "magic.tag"_catch_sr )
|
REQUIRE( testcase.tags[0].original == "magic.tag"_catch_sr )
|
||||||
with expansion:
|
with expansion:
|
||||||
magic.tag == magic.tag
|
magic.tag == magic.tag
|
||||||
|
|
||||||
|
@ -4043,9 +4043,9 @@ ok {test-number} - strlen(std::get<0>(data)) == static_cast<size_t>(std::get<1>(
|
|||||||
# tables
|
# tables
|
||||||
ok {test-number} - strlen(std::get<0>(data)) == static_cast<size_t>(std::get<1>(data)) for: 6 == 6
|
ok {test-number} - strlen(std::get<0>(data)) == static_cast<size_t>(std::get<1>(data)) for: 6 == 6
|
||||||
# tags with dots in later positions are not parsed as hidden
|
# tags with dots in later positions are not parsed as hidden
|
||||||
ok {test-number} - testcase->tags.size() == 1 for: 1 == 1
|
ok {test-number} - testcase.tags.size() == 1 for: 1 == 1
|
||||||
# tags with dots in later positions are not parsed as hidden
|
# tags with dots in later positions are not parsed as hidden
|
||||||
ok {test-number} - testcase->tags[0].original == "magic.tag"_catch_sr for: magic.tag == magic.tag
|
ok {test-number} - testcase.tags[0].original == "magic.tag"_catch_sr for: magic.tag == magic.tag
|
||||||
# thrown std::strings are translated
|
# thrown std::strings are translated
|
||||||
not ok {test-number} - unexpected exception with message: 'Why would you throw a std::string?'
|
not ok {test-number} - unexpected exception with message: 'Why would you throw a std::string?'
|
||||||
# toString on const wchar_t const pointer returns the string contents
|
# toString on const wchar_t const pointer returns the string contents
|
||||||
|
@ -18997,7 +18997,7 @@ loose text artifact
|
|||||||
<TestCase name="tags with dots in later positions are not parsed as hidden" tags="[tags]" filename="tests/<exe-name>/IntrospectiveTests/Tag.tests.cpp" >
|
<TestCase name="tags with dots in later positions are not parsed as hidden" tags="[tags]" filename="tests/<exe-name>/IntrospectiveTests/Tag.tests.cpp" >
|
||||||
<Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/Tag.tests.cpp" >
|
<Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/Tag.tests.cpp" >
|
||||||
<Original>
|
<Original>
|
||||||
testcase->tags.size() == 1
|
testcase.tags.size() == 1
|
||||||
</Original>
|
</Original>
|
||||||
<Expanded>
|
<Expanded>
|
||||||
1 == 1
|
1 == 1
|
||||||
@ -19005,7 +19005,7 @@ loose text artifact
|
|||||||
</Expression>
|
</Expression>
|
||||||
<Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/Tag.tests.cpp" >
|
<Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/Tag.tests.cpp" >
|
||||||
<Original>
|
<Original>
|
||||||
testcase->tags[0].original == "magic.tag"_catch_sr
|
testcase.tags[0].original == "magic.tag"_catch_sr
|
||||||
</Original>
|
</Original>
|
||||||
<Expanded>
|
<Expanded>
|
||||||
magic.tag == magic.tag
|
magic.tag == magic.tag
|
||||||
|
@ -45,11 +45,11 @@ constexpr Catch::SourceLineInfo dummySourceLineInfo = CATCH_INTERNAL_LINEINFO;
|
|||||||
TEST_CASE("shortened hide tags are split apart", "[tags]") {
|
TEST_CASE("shortened hide tags are split apart", "[tags]") {
|
||||||
using Catch::StringRef;
|
using Catch::StringRef;
|
||||||
using Catch::Matchers::VectorContains;
|
using Catch::Matchers::VectorContains;
|
||||||
auto testcase = Catch::makeTestCaseInfo("", {"fake test name", "[.magic-tag]"}, CATCH_INTERNAL_LINEINFO);
|
Catch::TestCaseInfo testcase("", {"fake test name", "[.magic-tag]"}, dummySourceLineInfo);
|
||||||
|
|
||||||
// Extract parsed tags into strings
|
// Extract parsed tags into strings
|
||||||
std::vector<StringRef> tags;
|
std::vector<StringRef> tags;
|
||||||
for (auto const& tag : testcase->tags) {
|
for (auto const& tag : testcase.tags) {
|
||||||
tags.push_back(tag.lowerCased);
|
tags.push_back(tag.lowerCased);
|
||||||
}
|
}
|
||||||
REQUIRE_THAT(tags, VectorContains("magic-tag"_catch_sr) && VectorContains("."_catch_sr));
|
REQUIRE_THAT(tags, VectorContains("magic-tag"_catch_sr) && VectorContains("."_catch_sr));
|
||||||
@ -58,10 +58,10 @@ TEST_CASE("shortened hide tags are split apart", "[tags]") {
|
|||||||
TEST_CASE("tags with dots in later positions are not parsed as hidden", "[tags]") {
|
TEST_CASE("tags with dots in later positions are not parsed as hidden", "[tags]") {
|
||||||
using Catch::StringRef;
|
using Catch::StringRef;
|
||||||
using Catch::Matchers::VectorContains;
|
using Catch::Matchers::VectorContains;
|
||||||
auto testcase = Catch::makeTestCaseInfo("", { "fake test name", "[magic.tag]" }, CATCH_INTERNAL_LINEINFO);
|
Catch::TestCaseInfo testcase("", { "fake test name", "[magic.tag]" }, dummySourceLineInfo);
|
||||||
|
|
||||||
REQUIRE(testcase->tags.size() == 1);
|
REQUIRE(testcase.tags.size() == 1);
|
||||||
REQUIRE(testcase->tags[0].original == "magic.tag"_catch_sr);
|
REQUIRE(testcase.tags[0].original == "magic.tag"_catch_sr);
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST_CASE( "empty tags are not allowed", "[tags]" ) {
|
TEST_CASE( "empty tags are not allowed", "[tags]" ) {
|
||||||
|
Loading…
Reference in New Issue
Block a user