FAQ
Author: marvin
Date: Fri Nov 3 18:43:18 2006
New Revision: 471103

URL: http://svn.apache.org/viewvc?view=rev&rev=471103
Log:
Add an init routine to Test which unbuffers stdout. Fix a formatting bug in
the output of the PASS macro.

Modified:
lucene/lucy/trunk/charmonizer/charm_test.c
lucene/lucy/trunk/charmonizer/src/Charmonizer/Test.charm
lucene/lucy/trunk/charmonizer/src/Charmonizer/Test.harm

Modified: lucene/lucy/trunk/charmonizer/charm_test.c
URL: http://svn.apache.org/viewvc/lucene/lucy/trunk/charmonizer/charm_test.c?view=diff&rev=471103&r1=471102&r2=471103
==============================================================================
--- lucene/lucy/trunk/charmonizer/charm_test.c (original)
+++ lucene/lucy/trunk/charmonizer/charm_test.c Fri Nov 3 18:43:18 2006
@@ -27,6 +27,8 @@
int total_skipped = 0;
int i;

+ chaz_Test_init();
+
/* loop through test functions, accumulating results */
for (i = 0; tests[i].name != NULL; i++) {
t_func test_func = tests[i].func;

Modified: lucene/lucy/trunk/charmonizer/src/Charmonizer/Test.charm
URL: http://svn.apache.org/viewvc/lucene/lucy/trunk/charmonizer/src/Charmonizer/Test.charm?view=diff&rev=471103&r1=471102&r2=471103
==============================================================================
--- lucene/lucy/trunk/charmonizer/src/Charmonizer/Test.charm (original)
+++ lucene/lucy/trunk/charmonizer/src/Charmonizer/Test.charm Fri Nov 3 18:43:18 2006
@@ -9,6 +9,13 @@
static void
TestBatch_destroy(TestBatch *batch);

+void
+chaz_Test_init(void) {
+ int check_val = setvbuf(stdout, NULL, _IONBF, 0);
+ if (check_val != 0)
+ fprintf(stderr, "Failed when trying to unbuffer stdout\n");
+}
+
TestBatch*
chaz_Test_new_batch(unsigned num_tests)
{
@@ -148,7 +155,7 @@
batch->test_num++;

/* indicate pass, update pass counter */
- printf("%-4u pass:\n", batch->test_num);
+ printf("%-4u pass: ", batch->test_num);
batch->num_passed++;

/* print supplied message */

Modified: lucene/lucy/trunk/charmonizer/src/Charmonizer/Test.harm
URL: http://svn.apache.org/viewvc/lucene/lucy/trunk/charmonizer/src/Charmonizer/Test.harm?view=diff&rev=471103&r1=471102&r2=471103
==============================================================================
--- lucene/lucy/trunk/charmonizer/src/Charmonizer/Test.harm (original)
+++ lucene/lucy/trunk/charmonizer/src/Charmonizer/Test.harm Fri Nov 3 18:43:18 2006
@@ -20,7 +20,12 @@
chaz_TestBatch_destroy_t destroy;
};

-/* Constructor for TestBatch.
+/* Unbuffer stdout. Perform any other setup needed.
+ */
+void
+chaz_Test_init(void);
+
+/* Constructor for TestBatch. Will print a message to the screen.
*/
chaz_TestBatch*
chaz_Test_new_batch(unsigned num_tests);

Search Discussions

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
grouplucy-commits @
categorieslucene
postedNov 4, '06 at 2:43a
activeNov 4, '06 at 2:43a
posts1
users1
websitelucene.apache.org

1 user in discussion

Marvin: 1 post

People

Translate

site design / logo © 2019 Grokbase