aboutsummaryrefslogtreecommitdiff
path: root/tests/test/script/runner/env.testscript
blob: ef90c3b31f20502f658580d9a5d94ae942ca9ad7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
# file      : tests/test/script/runner/env.testscript
# license   : MIT; see accompanying LICENSE file

.include ../common.testscript

: 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
}