@@ -153,11 +153,13 @@ static zuint search_path_count = 0;
153
153
154
154
/*-----------------------------------------------------------------------------.
155
155
| `verbosity` contains the verbosity level specified by using the `-v` option; |
156
- | `show_test_output` indicates whether to print the text output of the tests. |
156
+ | `show_test_output` indicates whether to print the text output of the tests; |
157
+ | `test_spacing` points to the string to print beetween each test: "\n" or "". |
157
158
'=============================================================================*/
158
159
159
- static zuint8 verbosity = 4 ;
160
- static zboolean show_test_output ;
160
+ static zuint8 verbosity = 4 ;
161
+ static zboolean show_test_output ;
162
+ static const char * test_spacing ;
161
163
162
164
/*-----------------------------------------------------------------------------.
163
165
| [0]: The byte read from even I/O ports (specified by using the `-0` option). |
@@ -543,10 +545,7 @@ static zuint8 run_test(int test_index)
543
545
)
544
546
{
545
547
error_loading_file :
546
- if (verbosity ) puts (show_test_output
547
- ? "error, test skipped\n"
548
- : "error, test skipped" );
549
-
548
+ if (verbosity ) printf ("error, test skipped\n%s" , test_spacing );
550
549
return Z_FALSE ;
551
550
}
552
551
@@ -690,14 +689,14 @@ static zuint8 run_test(int test_index)
690
689
if (failure == Z_NULL ) puts (& new_line [has_final_new_line ]);
691
690
692
691
else printf (
693
- "%s>>> Test failed: %s.\n\n" ,
692
+ "%s> Test failed: %s.\n\n" ,
694
693
& new_line [!lines || (completed && has_final_new_line )],
695
694
failure );
696
695
}
697
696
698
697
else {
699
- if (failure == Z_NULL ) puts ("passed" );
700
- else printf ("failed: %s\n" , failure );
698
+ if (failure == Z_NULL ) printf ("passed\n%s" , test_spacing );
699
+ else printf ("failed: %s\n%s " , failure , test_spacing );
701
700
}
702
701
}
703
702
@@ -915,12 +914,14 @@ int main(int argc, char **argv)
915
914
goto exit_with_error ;
916
915
}
917
916
917
+ show_test_output = verbosity == 4 ;
918
+ test_spacing = & new_line [verbosity < 3 ];
919
+
918
920
/*---------------------------------------------------------------.
919
921
| Disable output buffering if verbosity is enabled, so that the |
920
922
| messages are visible immediately rather than after each ENTER. |
921
923
'===============================================================*/
922
924
if (verbosity ) setvbuf (stdout , Z_NULL , _IONBF , 0 );
923
- show_test_output = verbosity == 4 ;
924
925
925
926
/* Configure the Z80 CPU emulator. */
926
927
@@ -978,7 +979,7 @@ int main(int argc, char **argv)
978
979
| Print the results summary. |
979
980
'===========================*/
980
981
printf ( "%sResults%s: %u test%s passed, %u failed.\n" ,
981
- & new_line [!verbosity || show_test_output ],
982
+ & new_line [!verbosity || * test_spacing ],
982
983
show_test_output ? " summary" : "" ,
983
984
results [1 ],
984
985
results [1 ] == 1 ? "" : "s" ,
0 commit comments