From b808c255b6a9ddba085bf5646e7d20ec344f2e2d Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Tue, 28 Apr 2020 08:48:53 +0200 Subject: Initial support for ad hoc recipes (still work in progress) --- tests/test/script/runner/redirect.testscript | 195 ++++++++++++++++++++++++--- 1 file changed, 173 insertions(+), 22 deletions(-) (limited to 'tests/test/script/runner/redirect.testscript') diff --git a/tests/test/script/runner/redirect.testscript b/tests/test/script/runner/redirect.testscript index b8fe74d..0fe3aa3 100644 --- a/tests/test/script/runner/redirect.testscript +++ b/tests/test/script/runner/redirect.testscript @@ -80,10 +80,14 @@ psr = ($cxx.target.class != 'windows' ? '/' : '\\') # Path separator in regex. : literal : { - $c <'$* -i 0 foo' && $b : out - $c <'$* -e foo 2>foo' && $b : err - $c <'$* -i 1 foo' && $b : inout + $c <'$* -i 0 <<<=foo' && $b : in + $c <'$* -i 0 >>?foo' && $b : out + $c <'$* -o foo >foo' && $b : out-alias + $c <'$* -e foo 2>>>?foo' && $b : err + $c <'$* -e foo 2>foo' && $b : err-alias + $c <'$* -i 1 <<<=foo >>>?foo' && $b : inout + $c <'$* -i 1 foo' && $b : inout-alias : inout-fail : @@ -101,11 +105,16 @@ psr = ($cxx.target.class != 'windows' ? '/' : '\\') # Path separator in regex. info: test id: 1 EOE - $c <'$* -i 2 foo' && $b : inerr - $c <'$* -i 1 -e bar foo 2>bar' && $b : inout-err - $c <'$* -o "" >""' && $b : empty - $c <'$* -i 1 <:"foo" >:"foo"' && $b : no-newline - $c <'$* -i 1 <:"" >:""' && $b : no-newline-empty + $c <'$* -i 2 <<<=foo 2>>>?foo' && $b : inerr + $c <'$* -i 2 foo' && $b : inerr-alias + $c <'$* -i 1 -e bar <<<=foo 1>>>?foo 2>>>?bar' && $b : inout-err + $c <'$* -i 1 -e bar foo 2>bar' && $b : inout-err-alias + $c <'$* -o "" >>>?""' && $b : empty + $c <'$* -o "" >""' && $b : empty-alias + $c <'$* -i 1 <<<=:"foo" >>>?:"foo"' && $b : no-newline + $c <'$* -i 1 <:"foo" >:"foo"' && $b : no-newline-alias + $c <'$* -i 1 <<<=:"" >>>?:""' && $b : no-newline-empty + $c <'$* -i 1 <:"" >:""' && $b : no-newline-empty-alias : no-newline-fail1 : @@ -132,6 +141,15 @@ psr = ($cxx.target.class != 'windows' ? '/' : '\\') # Path separator in regex. : merge : $c <>?EOE 1>&2 + foo + bar + EOE + EOI + + : merge-alias + : + $c <>EOE 1>&2 foo bar @@ -155,6 +173,10 @@ psr = ($cxx.target.class != 'windows' ? '/' : '\\') # Path separator in regex. { : match : + $c <'$* -o foo >>>?~/Foo?/i' && $b + + : match-alias + : $c <'$* -o foo >~/Foo?/i' && $b : mismatch @@ -209,6 +231,15 @@ psr = ($cxx.target.class != 'windows' ? '/' : '\\') # Path separator in regex. : in : $c <>?EOO + foo + bar + EOO + EOI + + : out-alias + : + $c <>EOO foo bar @@ -227,6 +267,15 @@ psr = ($cxx.target.class != 'windows' ? '/' : '\\') # Path separator in regex. : err : $c <>?EOO + foo + bar + EOO + EOI + + : err-alias + : + $c <>EOO foo bar @@ -236,6 +285,18 @@ psr = ($cxx.target.class != 'windows' ? '/' : '\\') # Path separator in regex. : inout : $c <>?EOO + foo + bar + EOF + foo + bar + EOO + EOI + + : inout-alias + : + $c <>EOO foo bar @@ -248,6 +309,19 @@ psr = ($cxx.target.class != 'windows' ? '/' : '\\') # Path separator in regex. : inerr : $c <>?EOE + foo + bar + EOF + foo + bar + EOE + EOI + + + : inerr-alias + : + $c <>EOE foo bar @@ -260,6 +334,14 @@ psr = ($cxx.target.class != 'windows' ? '/' : '\\') # Path separator in regex. : empty : $c <>?EOO + EOF + EOO + EOI + + : empty-alias + : + $c <>EOO EOF EOO @@ -268,16 +350,43 @@ psr = ($cxx.target.class != 'windows' ? '/' : '\\') # Path separator in regex. : shared : $c <>?EOF + foo + bar + EOF + EOI + + : shared-alias + : + $c <>EOF foo bar EOF EOI + : shared-in-alias + : + $c <>?EOF + foo + bar + EOF + EOI + + : shared-out-alias + : + $c <>EOF + foo + bar + EOF + EOI + : extra-newline : $c <>EOO + $* -i 1 <<=EOF >>?EOO EOF @@ -287,7 +396,7 @@ psr = ($cxx.target.class != 'windows' ? '/' : '\\') # Path separator in regex. : no-newline : $c <>:EOO + $* -i 1 <<=:EOF >>?:EOO foo EOF foo @@ -297,7 +406,7 @@ psr = ($cxx.target.class != 'windows' ? '/' : '\\') # Path separator in regex. : no-newline-fail1 : $c <>~/EOE/ != 0 - $* -i 1 <<:EOF >>EOO + $* -i 1 <<=:EOF >>?EOO foo EOF foo @@ -314,7 +423,7 @@ psr = ($cxx.target.class != 'windows' ? '/' : '\\') # Path separator in regex. : no-newline-fail2 : $c <>~/EOE/ != 0 - $* -i 1 <>:EOO + $* -i 1 <<=EOF >>?:EOO foo EOF foo @@ -331,7 +440,7 @@ psr = ($cxx.target.class != 'windows' ? '/' : '\\') # Path separator in regex. : no-newline-empty : $c <>:EOO + $* -i 1 <<=:EOF >>?:EOO EOF EOO EOI @@ -339,7 +448,7 @@ psr = ($cxx.target.class != 'windows' ? '/' : '\\') # Path separator in regex. : no-newline-extra-newline : $c <>:EOO + $* -i 1 <<=:EOF >>?:EOO EOF @@ -349,7 +458,7 @@ psr = ($cxx.target.class != 'windows' ? '/' : '\\') # Path separator in regex. : merge : $c <>EOO 2>&1 + $* -i 1 <<=EOF -e baz >>?EOO 2>&1 foo bar EOF @@ -387,6 +496,14 @@ psr = ($cxx.target.class != 'windows' ? '/' : '\\') # Path separator in regex. : in : $c <<"EOI" && $b + \$* -i 1 <<=/EOF >>>?'foo$ps' + foo/ + EOF + EOI + + : in-alias + : + $c <<"EOI" && $b \$* -i 1 <'foo$ps' foo/ EOF @@ -395,6 +512,14 @@ psr = ($cxx.target.class != 'windows' ? '/' : '\\') # Path separator in regex. : out : $c <<"EOI" && $b + \$* -i 1 <<<='foo$ps' >>?/EOO + foo/ + EOO + EOI + + : out-alias + : + $c <<"EOI" && $b \$* -i 1 <'foo$ps' >>/EOO foo/ EOO @@ -403,6 +528,14 @@ psr = ($cxx.target.class != 'windows' ? '/' : '\\') # Path separator in regex. : err : $c <<"EOI" && $b + \$* -i 2 <<<='foo$ps' 2>>?/EOE + foo/ + EOE + EOI + + : err-alias + : + $c <<"EOI" && $b \$* -i 2 <'foo$ps' 2>>/EOE foo/ EOE @@ -419,7 +552,7 @@ psr = ($cxx.target.class != 'windows' ? '/' : '\\') # Path separator in regex. : match : $c <>~/EOO/i + $* -o foo -o foo -o bar >>?~/EOO/i /FO*/* bar /* @@ -429,7 +562,7 @@ psr = ($cxx.target.class != 'windows' ? '/' : '\\') # Path separator in regex. : match-empty : $c <>:~/EOO/ + $* >>?:~/EOO/ /.{0} EOO EOI @@ -437,7 +570,7 @@ psr = ($cxx.target.class != 'windows' ? '/' : '\\') # Path separator in regex. : shared : $c <>~/EOF/ 2>>~/EOF/ + $* -o foo -e foo >>?~/EOF/ 2>>?~/EOF/ foo EOF EOI @@ -445,7 +578,7 @@ psr = ($cxx.target.class != 'windows' ? '/' : '\\') # Path separator in regex. : mismatch : $c <>/~%EOE%d != 0 - $* -o foo >>~/EOO/ + $* -o foo >>?~/EOO/ bar EOO EOI @@ -459,7 +592,7 @@ psr = ($cxx.target.class != 'windows' ? '/' : '\\') # Path separator in regex. : mismatch-icase : $c <>/~%EOE%d != 0 - $* -o foo >>~/EOO/i + $* -o foo >>?~/EOO/i bar EOO EOI @@ -479,6 +612,13 @@ psr = ($cxx.target.class != 'windows' ? '/' : '\\') # Path separator in regex. : $c <=out; + $* -i 1 <=out >foo + EOI + + : in-alias + : + $c <=out; $* -i 1 <<foo EOI @@ -490,6 +630,17 @@ psr = ($cxx.target.class != 'windows' ? '/' : '\\') # Path separator in regex. $c <=out; $* -e bar 2>+out; + $* -i 1 <?out + foo + bar + EOF + EOI + + : match-alias + : + $c <=out; + $* -e bar 2>+out; $* -i 1 <>>out foo bar @@ -500,7 +651,7 @@ psr = ($cxx.target.class != 'windows' ? '/' : '\\') # Path separator in regex. : $c <>/~%EOE%d != 0 $* -o foo >=out; - $* -o bar >>>out + $* -o bar >?out EOI %testscript:2: error: ../../../../../driver(.exe)? stdout doesn't match expected% info: stdout: test/1/stdout-2 -- cgit v1.1