From 7f01250d5a113f96ad0f3efcf4bf14d7b1796ccc Mon Sep 17 00:00:00 2001 From: Peter Verthez Date: Sat, 19 Jan 2002 16:53:07 +0000 Subject: [PATCH] Avoid output to stdout on 'make check'. --- standalone.c | 11 ++++++++--- t/test_script | 3 +-- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/standalone.c b/standalone.c index a4d4477..e8f94b7 100644 --- a/standalone.c +++ b/standalone.c @@ -32,6 +32,7 @@ #define OUTFILE "testgedcom.out" FILE* outfile = NULL; +int quiet = 0; void output(int to_stdout_too, char* format, ...) { @@ -40,7 +41,7 @@ void output(int to_stdout_too, char* format, ...) if (outfile) { vfprintf(outfile, format, ap); } - if (to_stdout_too) { + if (to_stdout_too && !quiet) { vprintf(format, ap); } va_end(ap); @@ -60,6 +61,7 @@ void show_help () printf(" -da Debug setting: libgedcom + yacc debug messages\n"); printf(" -2 Run the test parse 2 times instead of once\n"); printf(" -3 Run the test parse 3 times instead of once\n"); + printf(" -q No output to standard output\n"); } Gedcom_ctxt header_start(int level, Gedcom_val xref, char *tag, @@ -241,6 +243,9 @@ int main(int argc, char* argv[]) else if (!strncmp(argv[i], "-3", 3)) { run_times = 3; } + else if (!strncmp(argv[i], "-q", 3)) { + quiet = 1; + } else if (strncmp(argv[i], "-", 1)) { file_name = argv[i]; break; @@ -277,11 +282,11 @@ int main(int argc, char* argv[]) } fclose(outfile); if (result == 0) { - printf("Parse succeeded\n"); + output(1, "Parse succeeded\n"); return 0; } else { - printf("Parse failed\n"); + output(1, "Parse failed\n"); return 1; } } diff --git a/t/test_script b/t/test_script index cec9792..6ca9aa6 100755 --- a/t/test_script +++ b/t/test_script @@ -9,8 +9,7 @@ cd $srcdir/.. export GCONV_PATH=$GCONV_PATH:./ansel export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$builddir/../gedcom/.libs cp $builddir/../ansel/.libs/ANSI_Z39.47.so ansel -echo "=== testing $file" -$builddir/../testgedcom -2 t/$file +$builddir/../testgedcom -2 -q t/$file result=$? rm ansel/ANSI_Z39.47.so exit $result -- 2.30.2