aboutsummaryrefslogtreecommitdiff
path: root/tests/test/script/runner
diff options
context:
space:
mode:
authorKaren Arutyunov <karen@codesynthesis.com>2017-01-20 20:25:59 +0300
committerKaren Arutyunov <karen@codesynthesis.com>2017-01-24 14:53:00 +0300
commit28106f96de8ae5cdb3a0ee0e3a8a8185551e3b00 (patch)
tree8b912a7c9a2bd2ba1263695428d8343d022953a5 /tests/test/script/runner
parenteeed734583c2f553e71ae0bd78a4b6e7e4d9cc2b (diff)
Add support for comparison of test command output to a file
Diffstat (limited to 'tests/test/script/runner')
-rw-r--r--tests/test/script/runner/cleanup.test6
-rw-r--r--tests/test/script/runner/redirect.test50
2 files changed, 39 insertions, 17 deletions
diff --git a/tests/test/script/runner/cleanup.test b/tests/test/script/runner/cleanup.test
index ed724ee..1c3ccae 100644
--- a/tests/test/script/runner/cleanup.test
+++ b/tests/test/script/runner/cleanup.test
@@ -46,7 +46,7 @@ b += --no-column
:
$c <<EOI;
touch a &!a;
- $* -o foo >>>&a;
+ $* -o foo >+a;
rm a
EOI
$b
@@ -224,7 +224,7 @@ $b
:
: Test an implicit cleanup being overwritten with the explicit one,
:
-$c <'$* -o foo >>>a &!a';
+$c <'$* -o foo >=a &!a';
$b 2>>/EOE != 0
testscript:1: error: registered for cleanup directory test/1/ is not empty
EOE
@@ -235,7 +235,7 @@ EOE
:
$c <<EOO;
$* &!a;
-$* -o foo >>>a
+$* -o foo >=a
EOO
$b 2>>/EOE != 0
testscript:2: error: registered for cleanup directory test/1/ is not empty
diff --git a/tests/test/script/runner/redirect.test b/tests/test/script/runner/redirect.test
index e2d765c..f32492a 100644
--- a/tests/test/script/runner/redirect.test
+++ b/tests/test/script/runner/redirect.test
@@ -465,31 +465,53 @@ psr = ($cxx.target.class != 'windows' ? '/' : '\\') # Path separator in regex.
: file
:
{
- : in-out
+ : in
:
$c <<EOI;
- $* -o foo >>>out;
+ $* -o foo >=out;
$* -i 1 <<<out >foo
EOI
$b
- : append
+ : out
:
- $c <<EOI;
- $* -o foo >>>out;
- $* -e bar 2>>>&out;
- $* -i 1 <<<out >>EOO
- foo
- bar
- EOO
- EOI
- $b
+ {
+ : match
+ :
+ $c <<EOI;
+ $* -o foo >=out;
+ $* -e bar 2>+out;
+ $* -i 1 <<EOF >>>out
+ foo
+ bar
+ EOF
+ EOI
+ $b
+
+ : mismatch
+ :
+ $c <<EOI;
+ $* -o foo >=out;
+ $* -o bar >>>out
+ EOI
+ $b 2>>/~%EOE%d != 0
+ %testscript:2: error: ../../../../../driver(.exe)? stdout doesn't match the expected output%
+ info: stdout: test/1/stdout-2
+ info: expected stdout: test/1/out
+ info: stdout diff: test/1/stdout-2.diff
+ %--- \.*%
+ %\+\+\+ \.*%
+ %@@ \.*%
+ -foo
+ +bar
+ EOE
+ }
: merge
:
$c <<EOI;
- $* -o foo -e bar 2>&1 >>>out;
- $* -e baz -o biz 1>&2 2>>>&out;
+ $* -o foo -e bar 2>&1 >=out;
+ $* -e baz -o biz 1>&2 2>+out;
$* -i 1 <<<out >>EOO
foo
bar