blob: 512139a8442e36b5e9cdb5a248005ba1b9a77e14 (
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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
|
# file : tests/test/script/runner/env.testscript
# license : MIT; see accompanying LICENSE file
.include ../common.testscript
: cwd
:
{
: not-exist
:
$c <'env -c a -- $* -w' && $b 2>>/~%EOE% != 0
%testscript:1:1: error: specified working directory .+/a/ does not exist%
info: test id: 1
EOE
: process
:
$c <<EOI && $b
mkdir a;
env -c a -- $* -w >/~%.+/a%
EOI
: builtin
:
$c <<EOI && $b
mkdir a;
env -c a -- touch b;
test -f a/b
EOI
: absolute
:
$c <<EOI && $b
mkdir a;
env -c $~/a -- touch b;
test -f a/b
EOI
}
: 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
}
|