aboutsummaryrefslogtreecommitdiff
path: root/tests/recipe/buildscript
diff options
context:
space:
mode:
authorKaren Arutyunov <karen@codesynthesis.com>2020-11-30 22:42:40 +0300
committerKaren Arutyunov <karen@codesynthesis.com>2020-12-08 14:26:22 +0300
commitfb34688841668e6e4c939395c8387feabe8ddfdf (patch)
tree5e0da2e74cee981337f9cd19d148e9824d7d3c36 /tests/recipe/buildscript
parent121a075bc2558003990377843393ca27d784f50f (diff)
Add support for config.test.runner
Diffstat (limited to 'tests/recipe/buildscript')
-rw-r--r--tests/recipe/buildscript/testscript51
1 files changed, 49 insertions, 2 deletions
diff --git a/tests/recipe/buildscript/testscript b/tests/recipe/buildscript/testscript
index 2603f62..6bdbd32 100644
--- a/tests/recipe/buildscript/testscript
+++ b/tests/recipe/buildscript/testscript
@@ -406,7 +406,7 @@
}}
% [diag=test] test
{{
- cat <$path($<) >?$path($>)
+ cat <$path($>) >?$path($<)
}}
EOI
@@ -431,7 +431,7 @@
% [diag=test] test
{{
depdb clear
- cat <$path($<) >?$path($>)
+ cat <$path($>) >?$path($<)
}}
EOI
@@ -439,6 +439,53 @@
buildfile:7:3: error: 'depdb' builtin cannot be used to perform test
EOE
}
+
+ : runner
+ :
+ if ($cxx.target.class != 'windows')
+ {
+ echo 'bar' >=bar;
+
+ cat <<EOI >=run;
+ #!/bin/sh
+ if test "$1" = "--trace"; then
+ shift
+ echo "$*"
+ fi
+ "$@"
+ EOI
+
+ chmod u+x run;
+
+ cat <<EOI >=buildfile;
+ foo: bar
+ {{
+ cp $path($<) $path($>)
+ }}
+ % [diag=test] test
+ {{
+ if ($test.runner.path != [null])
+ $test.runner.path $test.runner.options cat <$path($>)
+ else
+ cat <$path($>)
+ end
+ }}
+ EOI
+
+ $* test 2>>EOE;
+ cp file{foo}
+ test file{foo}
+ bar
+ EOE
+
+ $* test config.test.runner="./run --trace" 2>>EOE;
+ test file{foo}
+ cat
+ bar
+ EOE
+
+ $* clean 2>-
+ }
}
: diff-label