From 2f1b236d8beaeed7efad36c5b1ceb654d0e72170 Mon Sep 17 00:00:00 2001 From: Ben Pfaff Date: Sun, 29 Oct 2006 22:04:09 +0000 Subject: [PATCH] Reduce verbosity of ll-test, llx-test output. --- tests/libpspp/ChangeLog | 9 +++++++++ tests/libpspp/ll-test.c | 11 ++++++++--- tests/libpspp/llx-test.c | 11 ++++++++--- 3 files changed, 25 insertions(+), 6 deletions(-) create mode 100644 tests/libpspp/ChangeLog diff --git a/tests/libpspp/ChangeLog b/tests/libpspp/ChangeLog new file mode 100644 index 00000000..2c22cc19 --- /dev/null +++ b/tests/libpspp/ChangeLog @@ -0,0 +1,9 @@ +Sun Oct 29 14:03:37 2006 Ben Pfaff + + * ll-test.c, llx-test.c: Reduce verbosity of output. + +---------------------------------------------------------------------- +Local Variables: +mode: change-log +version-control: never +End: diff --git a/tests/libpspp/ll-test.c b/tests/libpspp/ll-test.c index 1ec96ed5..b0e9bcd9 100644 --- a/tests/libpspp/ll-test.c +++ b/tests/libpspp/ll-test.c @@ -42,6 +42,9 @@ #define UNUSED #endif +/* Currently running test. */ +static const char *test_name; + /* Exit with a failure code. (Place a breakpoint on this function while debugging.) */ static void @@ -57,7 +60,8 @@ check_func (bool ok, int line) { if (!ok) { - printf ("check failed at %s, line %d\n", __FILE__, line); + printf ("Check failed in %s test at %s, line %d\n", + test_name, __FILE__, line); check_die (); } } @@ -1971,10 +1975,10 @@ test_partition (void) static void run_test (void (*test_function) (void), const char *name) { - printf ("Running %s test... ", name); + test_name = name; + putchar ('.'); fflush (stdout); test_function (); - printf ("done.\n"); } int @@ -2010,6 +2014,7 @@ main (void) run_test (test_sort_unique, "sort_unique"); run_test (test_insert_ordered, "insert_ordered"); run_test (test_partition, "partition"); + putchar ('\n'); return 0; } diff --git a/tests/libpspp/llx-test.c b/tests/libpspp/llx-test.c index 0de38b02..cbc49e2c 100644 --- a/tests/libpspp/llx-test.c +++ b/tests/libpspp/llx-test.c @@ -41,6 +41,9 @@ #define UNUSED #endif +/* Currently running test. */ +static const char *test_name; + /* Exit with a failure code. (Place a breakpoint on this function while debugging.) */ static void @@ -56,7 +59,8 @@ check_func (bool ok, int line) { if (!ok) { - printf ("check failed at %s, line %d\n", __FILE__, line); + printf ("Check failed in %s test at %s, line %d\n", + test_name, __FILE__, line); check_die (); } } @@ -2018,10 +2022,10 @@ test_allocation_failure (void) static void run_test (void (*test_function) (void), const char *name) { - printf ("Running %s test... ", name); + test_name = name; + putchar ('.'); fflush (stdout); test_function (); - printf ("done.\n"); } int @@ -2058,6 +2062,7 @@ main (void) run_test (test_insert_ordered, "insert_ordered"); run_test (test_partition, "partition"); run_test (test_allocation_failure, "allocation failure"); + putchar ('\n'); return 0; } -- 2.30.2