mercredi 24 août 2016

Changing google test framework default print pattern

Google test framework default print

 [==========] Running 4 tests from 1 test case.   
 [----------] Global test environment set-up.   
 [----------] 4 tests from gcc_tests   
 [ RUN      ]gcc_tests.functionality_test  
 [       OK ] gcc_tests.functionality_test (0 ms)    
 [ RUN      ] gcc_tests.functionality_test_1    
 [       OK ] gcc_tests.functionality_test_2 (0 ms)     
 [ RUN      ] gcc_tests.functionality_test_3    
 [       OK ] gcc_tests.functionality_test_3 (0 ms)    
 [ RUN      ] gcc_tests.functionality_test_4    
 [       OK ] gcc_tests.functionality_test_4(471 ms)   
 [----------] 4 tests from gcc_tests (471 ms total)  

 [----------] Global test environment tear-down   
 [==========] 4 tests from 1 test case ran. (471 ms total)    
 [  PASSED  ] 4 tests.   

How to replace millisecond with second inside the bracket as shown above.

And if time will be more than 60 seconds then it should be replaced with minute.
For example, as shown in bracket 471 ms, it should be replaced with 0.475 second and if time is 76 second.
It should be replaced with 1 minute 16 second.

Aucun commentaire:

Enregistrer un commentaire