mirror of
				https://github.com/catchorg/Catch2.git
				synced 2025-10-31 20:27:11 +01:00 
			
		
		
		
	Add --force-colour option to force colour output.
Adding a --force-colour option to force colour output on POSIX systems, provided a debugger is not attached. This allows for Catch to output colours even if STDOUT is not a tty, which can be the case when the test executable is being spawned by a parent process (e.g. CMake's ctest).
This commit is contained in:
		| @@ -182,7 +182,23 @@ TEST_CASE( "Process can be configured on command line", "[config][command-line]" | ||||
|             CHECK( config.shouldDebugBreak ); | ||||
|             CHECK( config.noThrow == true ); | ||||
|         } | ||||
|     }         | ||||
|     } | ||||
|  | ||||
|     SECTION( "force-colour", "") { | ||||
|         SECTION( "--force-colour", "" ) { | ||||
|             const char* argv[] = { "test", "--force-colour" }; | ||||
|             CHECK_NOTHROW( parseIntoConfig( argv, config ) ); | ||||
|  | ||||
|             REQUIRE( config.forceColour ); | ||||
|         } | ||||
|  | ||||
|         SECTION( "without --force-colour", "" ) { | ||||
|             const char* argv[] = { "test" }; | ||||
|             CHECK_NOTHROW( parseIntoConfig( argv, config ) ); | ||||
|  | ||||
|             REQUIRE( !config.forceColour ); | ||||
|         } | ||||
|     } | ||||
| } | ||||
|  | ||||
|  | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 Peter Huene
					Peter Huene