mirror of
https://github.com/kdave/btrfs-progs
synced 2025-02-16 09:46:55 +00:00
btrfs-progs: tests: print commands on terminal if requested
Set the variable TEST_LOG=tty (in the enviroment or as parameter to make) to print commands executed by 'run_check' helpers to terminal (ie. /dev/tty). This might be useful to see the test progress beside watching the results file. Signed-off-by: David Sterba <dsterba@suse.com>
This commit is contained in:
parent
982950b74b
commit
c2e85337f6
@ -24,6 +24,7 @@ _not_run()
|
||||
run_check()
|
||||
{
|
||||
echo "############### $@" >> $RESULTS 2>&1
|
||||
if [ "$TEST_LOG" = 'tty' ]; then echo "CMD: $@" > /dev/tty; fi
|
||||
"$@" >> $RESULTS 2>&1 || _fail "failed: $@"
|
||||
}
|
||||
|
||||
@ -32,6 +33,7 @@ run_check()
|
||||
run_check_stdout()
|
||||
{
|
||||
echo "############### $@" >> $RESULTS 2>&1
|
||||
if [ "$TEST_LOG" = 'tty' ]; then echo "CMD(stdout): $@" > /dev/tty; fi
|
||||
"$@" 2>&1 | tee -a $RESULTS || _fail "failed: $@"
|
||||
}
|
||||
|
||||
@ -39,6 +41,7 @@ run_check_stdout()
|
||||
run_mayfail()
|
||||
{
|
||||
echo "############### $@" >> $RESULTS 2>&1
|
||||
if [ "$TEST_LOG" = 'tty' ]; then echo "CMD(mayfail): $@" > /dev/tty; fi
|
||||
"$@" >> $RESULTS 2>&1 || _log "failed (ignored): $@"
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user