]> sourceware.org Git - lvm2.git/commitdiff
Add a VERBOSE option to make check (make check VERBOSE=1).
authorPetr Rockai <prokai@redhat.com>
Thu, 14 Oct 2010 14:36:26 +0000 (14:36 +0000)
committerPetr Rockai <prokai@redhat.com>
Thu, 14 Oct 2010 14:36:26 +0000 (14:36 +0000)
test/Makefile.in
test/harness.c

index 48f6d4191ec492542e8251c5f7d047770c12f0dd..789e0f44367551e7e753eca745cbdb05dc4b77b8 100644 (file)
@@ -27,6 +27,7 @@ abs_top_srcdir = @abs_top_srcdir@
 
 T ?= .
 S ?= @ # never match anything by default
+VERBOSE ?= 0
 RUN = $(shell find -regextype posix-egrep -name t-\*.sh -and -regex ".*($(T)).*" -and -not -regex ".*($(S)).*" | sort)
 
 # Shell quote;
@@ -49,17 +50,17 @@ endif
 
 all check: init.sh
        @echo Testing with locking_type 1
-       ./bin/harness $(RUN)
+       VERBOSE=$(VERBOSE) ./bin/harness $(RUN)
        @echo Testing with locking_type 3
-       LVM_TEST_LOCKING=3 ./bin/harness $(RUN)
+       VERBOSE=$(VERBOSE) LVM_TEST_LOCKING=3 ./bin/harness $(RUN)
 
 check_cluster: init.sh
        @echo Testing with locking_type 3
-       LVM_TEST_LOCKING=3 ./bin/harness $(RUN)
+       VERBOSE=$(VERBOSE) LVM_TEST_LOCKING=3 ./bin/harness $(RUN)
 
 check_local: init.sh
        @echo Testing with locking_type 1
-       LVM_TEST_LOCKING=1 ./bin/harness $(RUN)
+       VERBOSE=$(VERBOSE) LVM_TEST_LOCKING=1 ./bin/harness $(RUN)
 
 bin/not: $(srcdir)/not.c .bin-dir-stamp
        $(CC) -o bin/not $<
index 2f924f63434b04dfa8a2da648030feabadce3132..0162278b0251d28ebe7d50fb262a51eadb04295c 100644 (file)
@@ -39,6 +39,7 @@ char *readbuf = NULL;
 int readbuf_sz = 0, readbuf_used = 0;
 
 int die = 0;
+int verbose = 0;
 
 #define PASSED 0
 #define SKIPPED 1
@@ -64,6 +65,8 @@ void drain() {
        char buf[2048];
        while (1) {
                sz = read(fds[1], buf, 2048);
+               if (verbose)
+                       write(1, buf, sz);
                if (sz <= 0)
                        return;
                if (readbuf_used + sz >= readbuf_sz) {
@@ -164,7 +167,10 @@ int main(int argc, char **argv) {
        s.nwarned = s.nfailed = s.npassed = s.nskipped = 0;
 
        char *config = getenv("LVM_TEST_CONFIG"),
-            *config_debug;
+               *config_debug,
+               *be_verbose = getenv("VERBOSE");
+       if (be_verbose && atoi(be_verbose))
+               verbose = 1; // XXX
        config = config ? config : "";
        asprintf(&config_debug, "%s\n%s\n", config, "log { verbose=4 }");
 
This page took 0.039927 seconds and 5 git commands to generate.