From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 2880 invoked by alias); 15 Feb 2012 01:31:11 -0000 Received: (qmail 2842 invoked by uid 9699); 15 Feb 2012 01:31:10 -0000 Date: Wed, 15 Feb 2012 01:31:00 -0000 Message-ID: <20120215013110.2840.qmail@sourceware.org> From: mornfall@sourceware.org To: lvm-devel@redhat.com, lvm2-cvs@sourceware.org Subject: LVM2/test/lib harness.c Mailing-List: contact lvm2-cvs-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Post: List-Help: , Sender: lvm2-cvs-owner@sourceware.org X-SW-Source: 2012-02/txt/msg00093.txt.bz2 CVSROOT: /cvs/lvm2 Module name: LVM2 Changes by: mornfall@sourceware.org 2012-02-15 01:31:10 Modified files: test/lib : harness.c Log message: In the test harness, do the back-substitution (@TESTDIR@, @PREFIX@) also on the live VERBOSE output, not just the post-mortem dumps. Patches: http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/test/lib/harness.c.diff?cvsroot=lvm2&r1=1.10&r2=1.11 --- LVM2/test/lib/harness.c 2011/11/23 14:56:47 1.10 +++ LVM2/test/lib/harness.c 2012/02/15 01:31:10 1.11 @@ -119,6 +119,14 @@ } } +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 @@ 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);