mirror of
				https://github.com/catchorg/Catch2.git
				synced 2025-10-31 12:17:11 +01:00 
			
		
		
		
	Report used filters in the SonarQube reporter
This commit is contained in:
		| @@ -11,15 +11,22 @@ | ||||
| #include <catch2/catch_test_case_info.hpp> | ||||
| #include <catch2/internal/catch_reusable_string_stream.hpp> | ||||
| #include <catch2/interfaces/catch_interfaces_config.hpp> | ||||
| #include <catch2/catch_test_spec.hpp> | ||||
| #include <catch2/reporters/catch_reporter_helpers.hpp> | ||||
|  | ||||
| #include <map> | ||||
|  | ||||
| namespace Catch { | ||||
|  | ||||
|     namespace { | ||||
|         std::string createRngSeedString(uint32_t seed) { | ||||
|         std::string createMetadataString(IConfig const& config) { | ||||
|             ReusableStringStream sstr; | ||||
|             sstr << "rng-seed=" << seed; | ||||
|             if ( config.testSpec().hasFilters() ) { | ||||
|                 sstr << "filters='" | ||||
|                          << serializeFilters( config.getTestsOrTags() ) | ||||
|                          << "' "; | ||||
|             } | ||||
|             sstr << "rng-seed=" << config.rngSeed(); | ||||
|             return sstr.str(); | ||||
|         } | ||||
|     } | ||||
| @@ -27,7 +34,7 @@ namespace Catch { | ||||
|     void SonarQubeReporter::testRunStarting(TestRunInfo const& testRunInfo) { | ||||
|         CumulativeReporterBase::testRunStarting(testRunInfo); | ||||
|  | ||||
|         xml.writeComment( createRngSeedString( m_config->rngSeed() ) ); | ||||
|         xml.writeComment( createMetadataString( *m_config ) ); | ||||
|         xml.startElement("testExecutions"); | ||||
|         xml.writeAttribute("version"_sr, '1'); | ||||
|     } | ||||
|   | ||||
| @@ -1,5 +1,5 @@ | ||||
| <?xml version="1.0" encoding="UTF-8"?> | ||||
| <!-- rng-seed=1 --> | ||||
| <!-- filters='~[!nonportable]~[!benchmark]~[approvals] *' rng-seed=1 --> | ||||
| <testExecutions version="1"loose text artifact | ||||
| > | ||||
|   <file path="tests/<exe-name>/IntrospectiveTests/Clara.tests.cpp"> | ||||
|   | ||||
| @@ -1,5 +1,5 @@ | ||||
| <?xml version="1.0" encoding="UTF-8"?> | ||||
| <!-- rng-seed=1 --> | ||||
| <!-- filters='~[!nonportable]~[!benchmark]~[approvals] *' rng-seed=1 --> | ||||
| <testExecutions version="1"> | ||||
|   <file path="tests/<exe-name>/IntrospectiveTests/Clara.tests.cpp"> | ||||
|     <testCase name="Clara::Arg supports single-arg parse the way Opt does" duration="{duration}"/> | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 Martin Hořeňovský
					Martin Hořeňovský