summaryrefslogtreecommitdiff
path: root/tests/common
diff options
context:
space:
mode:
authorDavid Sterba <dsterba@suse.cz>2015-06-02 15:57:51 +0200
committerDavid Sterba <dsterba@suse.cz>2015-06-02 15:57:51 +0200
commitcf3d13132b92abd9e149f905b06d7a6b61a5d72b (patch)
tree3c52f19d1178735608215ba4adc9f81f5d836219 /tests/common
parent10b6b0b3a8288ed825d003788d9ff5d657f2e404 (diff)
btrfs-progs: tests: common: add helper run_check_stdout
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>
Diffstat (limited to 'tests/common')
-rw-r--r--tests/common8
1 files changed, 8 insertions, 0 deletions
diff --git a/tests/common b/tests/common
index e690c85a..899ec7b1 100644
--- a/tests/common
+++ b/tests/common
@@ -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