mirror of
				https://github.com/catchorg/Catch2.git
				synced 2025-11-03 21:49:32 +01:00 
			
		
		
		
	Force flush streams in tests for #1514
This avoids the problem where writes to stderr/stdout stop being line-buffered when stderr/stdout is redirected to a file, which led to different order of outputs between Linux and Windows in our tests.
This commit is contained in:
		@@ -429,8 +429,8 @@ TEST_CASE( "Bitfields can be captured (#1027)" ) {
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
TEST_CASE("#1514: stderr/stdout is not captured in tests aborted by an exception", "[output-capture][regression][.]") {
 | 
			
		||||
    std::cout << "This would not be caught previously\n";
 | 
			
		||||
    std::clog << "Nor would this\n";
 | 
			
		||||
    std::cout << "This would not be caught previously\n" << std::flush;
 | 
			
		||||
    std::clog << "Nor would this\n" << std::flush;
 | 
			
		||||
    // FAIL aborts the test by throwing a Catch exception
 | 
			
		||||
    FAIL("1514");
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user