diff options
Diffstat (limited to 'source')
-rw-r--r-- | source/genCases_writeTestsTotal.c | 3 | ||||
-rw-r--r-- | source/verCases.h | 1 | ||||
-rw-r--r-- | source/verCases_common.c | 32 |
3 files changed, 22 insertions, 14 deletions
diff --git a/source/genCases_writeTestsTotal.c b/source/genCases_writeTestsTotal.c index 8ad6f91..10d8398 100644 --- a/source/genCases_writeTestsTotal.c +++ b/source/genCases_writeTestsTotal.c @@ -38,13 +38,14 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include <stdio.h> #include "platform.h" #include "genCases.h" +#include "verCases.h" void genCases_writeTestsTotal( bool forever ) { if ( forever ) { fputs( "Unbounded tests.\n", stderr ); - } else { + } else if (verCases_verbosity) { if ( 2000000000 <= genCases_total ) { fprintf( stderr, diff --git a/source/verCases.h b/source/verCases.h index 27ed1c9..07761f5 100644 --- a/source/verCases.h +++ b/source/verCases.h @@ -53,6 +53,7 @@ extern bool verCases_usesExact, verCases_exact; extern bool verCases_checkNaNs, verCases_checkInvInts; extern uint_fast32_t verCases_maxErrorCount; extern bool verCases_errorStop; +extern int verCases_verbosity; void verCases_writeFunctionName( FILE * ); 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 ) |