mirror of
				https://github.com/catchorg/Catch2.git
				synced 2025-11-04 14:09:33 +01:00 
			
		
		
		
	Fix xml reporter crashing when a benchmark failed.
This commit is contained in:
		
				
					committed by
					
						
						Martin Hořeňovský
					
				
			
			
				
	
			
			
			
						parent
						
							425957dc63
						
					
				
				
					commit
					7e7ab0e28b
				
			@@ -220,10 +220,13 @@ namespace Catch {
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
#if defined(CATCH_CONFIG_ENABLE_BENCHMARKING)
 | 
			
		||||
    void XmlReporter::benchmarkStarting(BenchmarkInfo const &info) {
 | 
			
		||||
    void XmlReporter::benchmarkPreparing(std::string const& name) {
 | 
			
		||||
        m_xml.startElement("BenchmarkResults")
 | 
			
		||||
            .writeAttribute("name", info.name)
 | 
			
		||||
            .writeAttribute("samples", info.samples)
 | 
			
		||||
            .writeAttribute("name", name);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    void XmlReporter::benchmarkStarting(BenchmarkInfo const &info) {
 | 
			
		||||
        m_xml.writeAttribute("samples", info.samples)
 | 
			
		||||
            .writeAttribute("resamples", info.resamples)
 | 
			
		||||
            .writeAttribute("iterations", info.iterations)
 | 
			
		||||
            .writeAttribute("clockResolution", static_cast<uint64_t>(info.clockResolution))
 | 
			
		||||
 
 | 
			
		||||
@@ -51,6 +51,7 @@ namespace Catch {
 | 
			
		||||
        void testRunEnded(TestRunStats const& testRunStats) override;
 | 
			
		||||
 | 
			
		||||
#if defined(CATCH_CONFIG_ENABLE_BENCHMARKING)
 | 
			
		||||
        void benchmarkPreparing(std::string const& name) override;
 | 
			
		||||
        void benchmarkStarting(BenchmarkInfo const&) override;
 | 
			
		||||
        void benchmarkEnded(BenchmarkStats<> const&) override;
 | 
			
		||||
        void benchmarkFailed(std::string const&) override;
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user