summaryrefslogtreecommitdiffstats
path: root/test/lib
diff options
context:
space:
mode:
authorPetr Rockai <prockai@redhat.com>2012-02-15 01:31:10 +0000
committerPetr Rockai <prockai@redhat.com>2012-02-15 01:31:10 +0000
commita635143d62a11c9993225e6c2f4d563c29d7b639 (patch)
tree96950a99eb12d40ad7d6b5a8239c365be64ca7f0 /test/lib
parentad48a46fc9df2ad75510a975c5b15535fc7da825 (diff)
downloadlvm2-a635143d62a11c9993225e6c2f4d563c29d7b639.tar.gz
lvm2-a635143d62a11c9993225e6c2f4d563c29d7b639.tar.xz
lvm2-a635143d62a11c9993225e6c2f4d563c29d7b639.zip
In the test harness, do the back-substitution (@TESTDIR@, @PREFIX@) also on the
live VERBOSE output, not just the post-mortem dumps.
Diffstat (limited to 'test/lib')
-rw-r--r--test/lib/harness.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/test/lib/harness.c b/test/lib/harness.c
index 43975be5..5c17e747 100644
--- a/test/lib/harness.c
+++ b/test/lib/harness.c
@@ -119,6 +119,14 @@ static void dump(void) {
}
}
+static void trickle() {
+ static int counter_last = -1, counter = 0;
+ while ( counter < readbuf_used && counter != counter_last ) {
+ counter_last = counter;
+ counter = outline( readbuf, counter, 1 );
+ }
+}
+
static void clear(void) {
readbuf_used = 0;
}
@@ -131,12 +139,12 @@ static void drain(void) {
sz = read(fds[1], buf, sizeof(buf));
if (sz <= 0)
return;
- if (verbose)
- write(1, buf, sz);
if (readbuf_used + sz >= readbuf_sz) {
readbuf_sz = readbuf_sz ? 2 * readbuf_sz : 4096;
readbuf = realloc(readbuf, readbuf_sz);
}
+ if (verbose)
+ trickle();
if (!readbuf)
exit(205);
memcpy(readbuf + readbuf_used, buf, sz);