mirror of
https://github.com/catchorg/Catch2.git
synced 2025-09-19 19:25:38 +02:00
Do not copy around TestCaseInfo
Now a `TEST_CASE` macro should create a single TestCaseInfo and then it should never be copied around. This, together with latter changes, should significantly decrease the number of allocations made before `main` is even entered.
This commit is contained in:
@@ -76,7 +76,7 @@ namespace Catch {
|
||||
std::string const& _stdOut,
|
||||
std::string const& _stdErr,
|
||||
bool _aborting )
|
||||
: testInfo( _testInfo ),
|
||||
: testInfo( &_testInfo ),
|
||||
totals( _totals ),
|
||||
stdOut( _stdOut ),
|
||||
stdErr( _stdErr ),
|
||||
@@ -141,14 +141,15 @@ namespace Catch {
|
||||
Catch::cout() << std::endl;
|
||||
}
|
||||
|
||||
void IStreamingReporter::listTests(std::vector<TestCase> const& tests, Config const& config) {
|
||||
void IStreamingReporter::listTests(std::vector<TestCaseHandle> const& tests, Config const& config) {
|
||||
if (config.hasTestFilters())
|
||||
Catch::cout() << "Matching test cases:\n";
|
||||
else {
|
||||
Catch::cout() << "All available test cases:\n";
|
||||
}
|
||||
|
||||
for (auto const& testCaseInfo : tests) {
|
||||
for (auto const& test : tests) {
|
||||
auto const& testCaseInfo = test.getTestCaseInfo();
|
||||
Colour::Code colour = testCaseInfo.isHidden()
|
||||
? Colour::SecondaryText
|
||||
: Colour::None;
|
||||
|
Reference in New Issue
Block a user