From 52a29dd64479e9313848941078a2619b47f2c61b Mon Sep 17 00:00:00 2001 From: Karen Arutyunov Date: Wed, 8 Mar 2017 00:39:30 +0300 Subject: Add support for config.test.output variable --- tests/test/script/runner/buildfile | 2 +- tests/test/script/runner/output.test | 87 ++++++++++++++++++++++++++++++++++++ 2 files changed, 88 insertions(+), 1 deletion(-) create mode 100644 tests/test/script/runner/output.test (limited to 'tests') diff --git a/tests/test/script/runner/buildfile b/tests/test/script/runner/buildfile index c3df228..a990405 100644 --- a/tests/test/script/runner/buildfile +++ b/tests/test/script/runner/buildfile @@ -2,7 +2,7 @@ # copyright : Copyright (c) 2014-2017 Code Synthesis Ltd # license : MIT; see accompanying LICENSE file -./: test{cleanup expr if pipe redirect regex set status} exe{driver} $b +./: test{cleanup expr if output pipe redirect regex set status} exe{driver} $b test{*}: target = exe{driver} diff --git a/tests/test/script/runner/output.test b/tests/test/script/runner/output.test new file mode 100644 index 0000000..f46b6ec --- /dev/null +++ b/tests/test/script/runner/output.test @@ -0,0 +1,87 @@ +# file : tests/test/script/runner/output.test +# copyright : Copyright (c) 2014-2017 Code Synthesis Ltd +# license : MIT; see accompanying LICENSE file + +# Some of the tests below (*/script-wd, before/*) are probably more appropriate +# for tests/test/script/script-integration/testscript. Nevertheless let's not +# spread the feature tests among several places. +# + +.include ../common.test + +: after +: +{ + : keep + : + { + : cleanup + : + $c <'touch a' && $b config.test.output=keep; + test -f test/1/a + + : teardown + : + $c <>/EOE != 0 + error: working directory test/ exists at the beginning of the test + EOE + + : warn + : + mkdir test &!test/; + $c <'true' && $b config.test.output=warn@clean 2>>/EOE + warning: working directory test/ exists at the beginning of the test + EOE + + : clean + : + mkdir test &!test/; + $c <'true' && $b config.test.output=clean@clean +} -- cgit v1.1