Skip to content

ctest: Add env var "CLICOLOR_FORCE" to force color

Niram7777 requested to merge Niram7777/cmake:clicolor_force_ctest into master

Based on "Source/kwsys/Terminal.c:kwsysTerminalStreamIsVT100".

The main purpose is to pipe in logs with colors.

Before :

ctest -R MockGSRender.* \
     |& tee "$BUILD_PATH/bin/ctest.log"
0% tests passed, 5 tests failed out of 5

Total Test time (real) =   8.74 sec

The following tests FAILED:
	 77 - MockGSRender.OnInitRsx (Failed)
	 78 - MockGSRender.OnInitThread (Failed)
	 79 - MockGSRender.OnExit (Failed)
	 80 - MockGSRender.Flip (Failed)
	 81 - MockGSRender.GetFrame (Failed)
Errors while running CTest

Now :

CLICOLOR_FORCE=1 $REPOS_ROOT/cmake/cmake-build/bin/ctest -R MockGSRender.* \
     |& tee "$BUILD_PATH/bin/ctest.log"
 0% tests passed^[[0;0m, ^[[0;31m5 tests failed^[[0;0m out of 5
 
 Total Test time (real) =   9.01 sec
 
 The following tests FAILED:
     ^[[0;31m 77 - MockGSRender.OnInitRsx (Failed)^[[0;0m
     ^[[0;31m 78 - MockGSRender.OnInitThread (Failed)^[[0;0m
     ^[[0;31m 79 - MockGSRender.OnExit (Failed)^[[0;0m
     ^[[0;31m 80 - MockGSRender.Flip (Failed)^[[0;0m
     ^[[0;31m 81 - MockGSRender.GetFrame (Failed)^[[0;0m
 Errors while running CTest

PS : the builder is failing in local (even before this change), I can put logs if needed.

Before :

99% tests passed, 2 tests failed out of 547

Label Time Summary:
Label1    =   0.07 sec*proc (1 test)
Label2    =   0.07 sec*proc (1 test)

Total Test time (real) = 1780.68 sec

The following tests FAILED:
	321 - RunCMake.Make (Failed)
	371 - RunCMake.MaxRecursionDepth (Failed)

Now :

99% tests passed, 2 tests failed out of 552

Label Time Summary:
Label1    =   0.07 sec*proc (1 test)
Label2    =   0.07 sec*proc (1 test)

Total Test time (real) = 1616.07 sec

The following tests FAILED:
	326 - RunCMake.Make (Failed)
	376 - RunCMake.MaxRecursionDepth (Failed)

Topic-rename: ctest-CLICOLOR_FORCE

Edited by Brad King

Merge request reports