From 40619cbb3bf32872df8c53cc457039229428a263 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alex=20Benn=C3=A9e?= Date: Fri, 17 Feb 2023 10:29:01 +0000 Subject: All verbosity reduction in the testfloat code MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit By itself this has no effect as the flag never gets altered by the original code. However QEMU's fp-test program directly include the test float code and that will shortly gain the ability to twiddle this flag. Signed-off-by: Alex Bennée --- source/verCases_common.c | 32 +++++++++++++++++++------------- 1 file changed, 19 insertions(+), 13 deletions(-) (limited to 'source/verCases_common.c') diff --git a/source/verCases_common.c b/source/verCases_common.c index f1e3385..adc25db 100644 --- a/source/verCases_common.c +++ b/source/verCases_common.c @@ -55,6 +55,7 @@ uint_fast32_t verCases_maxErrorCount = 0; bool verCases_errorStop = false; volatile sig_atomic_t verCases_stop = false; +int verCases_verbosity = 1; bool verCases_anyErrors = false; @@ -70,15 +71,17 @@ uint_fast32_t verCases_tenThousandsCount, verCases_errorCount; void verCases_writeTestsPerformed( int count ) { - if ( verCases_tenThousandsCount ) { - fprintf( - stderr, - "\r%lu%04d tests performed", - (unsigned long) verCases_tenThousandsCount, - count - ); - } else { - fprintf( stderr, "\r%d tests performed", count ); + if ( verCases_verbosity) { + if ( verCases_tenThousandsCount ) { + fprintf( + stderr, + "\r%lu%04d tests performed", + (unsigned long) verCases_tenThousandsCount, + count + ); + } else { + fprintf( stderr, "\r%d tests performed", count ); + } } if ( verCases_errorCount ) { fprintf( @@ -88,7 +91,9 @@ void verCases_writeTestsPerformed( int count ) (verCases_errorCount == 1) ? "" : "s" ); } else { - fputs( ".\n", stderr ); + if ( verCases_verbosity) { + fputs( ".\n", stderr ); + } if ( verCases_tenThousandsCount ) { fprintf( stdout, @@ -114,9 +119,10 @@ void verCases_perTenThousand( void ) verCases_writeTestsPerformed( 0 ); verCases_exitWithStatus(); } - fprintf( - stderr, "\r%3lu0000", (unsigned long) verCases_tenThousandsCount ); - + if (verCases_verbosity) { + fprintf( + stderr, "\r%3lu0000", (unsigned long) verCases_tenThousandsCount ); + } } void verCases_writeErrorFound( int count ) -- cgit v1.1