mirror of
git://git.code.sf.net/p/zsh/code
synced 2025-01-19 11:31:26 +01:00
moved from ./Test/51xtrace.ztst
This commit is contained in:
parent
ff5e877e4c
commit
b4da5d2fd8
1 changed files with 83 additions and 0 deletions
83
Test/E02xtrace.ztst
Normal file
83
Test/E02xtrace.ztst
Normal file
|
@ -0,0 +1,83 @@
|
|||
# Test that xtrace output is correctly generated
|
||||
|
||||
%prep
|
||||
mkdir xtrace.tmp && cd xtrace.tmp
|
||||
function xtf {
|
||||
local regression_test_dummy_variable
|
||||
print "$*"
|
||||
}
|
||||
echo 'print "$*"' > xt.in
|
||||
|
||||
%test
|
||||
|
||||
set -x
|
||||
print 'Tracing: builtin'
|
||||
print 'Tracing: builtin 2>file' 2>xtrace.err
|
||||
cat <<<'Tracing: external'
|
||||
cat <<<'Tracing: external 2>file' 2>>xtrace.err
|
||||
( print 'Tracing: ( builtin )' )
|
||||
( print 'Tracing: ( builtin ) 2>file' ) 2>>xtrace.err
|
||||
( cat <<<'Tracing: ( external )' )
|
||||
( cat <<<'Tracing: ( external ) 2>file' ) 2>>xtrace.err
|
||||
{ print 'Tracing: { builtin }' }
|
||||
{ print 'Tracing: { builtin } 2>file' } 2>>xtrace.err
|
||||
{ cat <<<'Tracing: { external }' }
|
||||
{ cat <<<'Tracing: { external } 2>file' } 2>>xtrace.err
|
||||
repeat 1 do print 'Tracing: do builtin done'; done
|
||||
repeat 1 do print 'Tracing: do builtin done 2>file'; done 2>>xtrace.err
|
||||
repeat 1 do cat <<<'Tracing: do external done'; done
|
||||
repeat 1 do cat <<<'Tracing: do external done 2>file'; done 2>>xtrace.err
|
||||
xtf 'Tracing: function'
|
||||
xtf 'Tracing: function 2>file' 2>>xtrace.err
|
||||
. ./xt.in 'Tracing: source'
|
||||
. ./xt.in 'Tracing: source 2>file' 2>>xtrace.err
|
||||
set +x
|
||||
cat xtrace.err
|
||||
0:xtrace with and without redirection
|
||||
>Tracing: builtin
|
||||
>Tracing: builtin 2>file
|
||||
>Tracing: external
|
||||
>Tracing: external 2>file
|
||||
>Tracing: ( builtin )
|
||||
>Tracing: ( builtin ) 2>file
|
||||
>Tracing: ( external )
|
||||
>Tracing: ( external ) 2>file
|
||||
>Tracing: { builtin }
|
||||
>Tracing: { builtin } 2>file
|
||||
>Tracing: { external }
|
||||
>Tracing: { external } 2>file
|
||||
>Tracing: do builtin done
|
||||
>Tracing: do builtin done 2>file
|
||||
>Tracing: do external done
|
||||
>Tracing: do external done 2>file
|
||||
>Tracing: function
|
||||
>Tracing: function 2>file
|
||||
>Tracing: source
|
||||
>Tracing: source 2>file
|
||||
>+ZTST_execchunk:2> print Tracing: ( builtin ) 2>file
|
||||
>+ZTST_execchunk:2> cat
|
||||
>+ZTST_execchunk:2> print Tracing: { builtin } 2>file
|
||||
>+ZTST_execchunk:2> cat
|
||||
>+ZTST_execchunk:2> print Tracing: do builtin done 2>file
|
||||
>+ZTST_execchunk:2> cat
|
||||
?+ZTST_execchunk:2> print Tracing: builtin
|
||||
?+ZTST_execchunk:2> print Tracing: builtin 2>file
|
||||
?+ZTST_execchunk:2> cat
|
||||
?+ZTST_execchunk:2> cat
|
||||
?+ZTST_execchunk:2> print Tracing: ( builtin )
|
||||
?+ZTST_execchunk:2> cat
|
||||
?+ZTST_execchunk:2> print Tracing: { builtin }
|
||||
?+ZTST_execchunk:2> cat
|
||||
?+ZTST_execchunk:2> print Tracing: do builtin done
|
||||
?+ZTST_execchunk:2> cat
|
||||
?+ZTST_execchunk:2> xtf Tracing: function
|
||||
?+xtf:0> local regression_test_dummy_variable
|
||||
?+xtf:0> print Tracing: function
|
||||
?+ZTST_execchunk:2> xtf Tracing: function 2>file
|
||||
?+xtf:0> local regression_test_dummy_variable
|
||||
?+xtf:0> print Tracing: function 2>file
|
||||
?+ZTST_execchunk:2> . ./xt.in Tracing: source
|
||||
?+./xt.in:1> print Tracing: source
|
||||
?+ZTST_execchunk:2> . ./xt.in Tracing: source 2>file
|
||||
?+./xt.in:1> print Tracing: source 2>file
|
||||
?+ZTST_execchunk:2> set +x
|
Loading…
Reference in a new issue