All verbosity reduction in the testfloat code
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 <alex.bennee@linaro.org>
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 @@
#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_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 @@
bool verCases_errorStop = false;
volatile sig_atomic_t verCases_stop = false;
+int verCases_verbosity = 1;
bool verCases_anyErrors = false;
@@ -70,15 +71,17 @@
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 @@
(verCases_errorCount == 1) ? "" : "s"
);
} else {
- fputs( ".\n", stderr );
+ if ( verCases_verbosity) {
+ fputs( ".\n", stderr );
+ }
if ( verCases_tenThousandsCount ) {
fprintf(
stdout,
@@ -114,9 +119,10 @@
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 )