aboutsummaryrefslogtreecommitdiff
path: root/tests/test/script/runner/env.testscript
diff options
context:
space:
mode:
authorKaren Arutyunov <karen@codesynthesis.com>2020-10-10 17:22:46 +0300
committerKaren Arutyunov <karen@codesynthesis.com>2020-11-06 19:32:09 +0300
commitf41599c8e9435f3dfec60b872c2b4ae31177efdd (patch)
tree088f8d9bf906e4a2ed734e034699163c9ccc7306 /tests/test/script/runner/env.testscript
parentac76a4fd2afff48a0d5db84592babe5cabef3a2c (diff)
Add support for test timeouts
Diffstat (limited to 'tests/test/script/runner/env.testscript')
-rw-r--r--tests/test/script/runner/env.testscript29
1 files changed, 27 insertions, 2 deletions
diff --git a/tests/test/script/runner/env.testscript b/tests/test/script/runner/env.testscript
index 6fcedfa..ef90c3b 100644
--- a/tests/test/script/runner/env.testscript
+++ b/tests/test/script/runner/env.testscript
@@ -3,5 +3,30 @@
.include ../common.testscript
-$c <'env abc=xyz -- $* -v abc >xyz' && $b : set
-$c <'env --unset=abc -- $* -v abc >"<none>"' && env abc=xyz -- $b : unset
+: variables
+:
+{
+ $c <'env abc=xyz -- $* -v abc >xyz' && $b : set
+ $c <'env --unset=abc -- $* -v abc >"<none>"' && env abc=xyz -- $b : unset
+}
+
+: timeout
+:
+{
+ : expired
+ :
+ $c <'env --timeout 1 -- $* -l 5' && $b 2>>~%EOE% != 0
+ %testscript:1:1: error: .+ terminated: execution timeout expired%
+ info: test id: 1
+ EOE
+
+ : not-expired
+ :
+ $c <'env --timeout 5 -- $* -l 1' && $b
+
+ : invalid
+ :
+ $c <'env --timeout a -- $*' && $b 2>>EOE != 0
+ testscript:1:15: error: env: invalid value 'a' for option '--timeout'
+ EOE
+}