btrfs-progs: tests: common: add helper run_check_stdout
authorDavid Sterba <dsterba@suse.cz>
Tue, 2 Jun 2015 13:57:51 +0000 (15:57 +0200)
committerDavid Sterba <dsterba@suse.cz>
Tue, 2 Jun 2015 13:57:51 +0000 (15:57 +0200)
Sometimes we need to process the output of the command, but run_check
captures all the output into results file.

Signed-off-by: David Sterba <dsterba@suse.cz>
tests/common

index e690c85..899ec7b 100644 (file)
@@ -21,6 +21,14 @@ run_check()
        "$@" >> $RESULTS 2>&1 || _fail "failed: $@"
 }
 
+# same as run_check but the stderr+stdout output is duplicated on stdout and
+# can be processed further
+run_check_stdout()
+{
+       echo "############### $@" >> $RESULTS 2>&1
+       "$@" 2>&1 | tee -a $RESULTS || _fail "failed: $@"
+}
+
 check_prereq()
 {
        if ! [ -f $TOP/$1 ]; then