blob: 93ce08a2827d81ce0ef4305a74f016ea51a424cd (
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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
|
# file : tests/test/script/integration/testscript
# copyright : Copyright (c) 2014-2016 Code Synthesis Ltd
# license : MIT; see accompanying LICENSE file
+mkdir build
+cat <<EOI >>>build/bootstrap.build
project = test
amalgamation =
using test
EOI
test.options += -q --buildfile -
test.arguments = test
: scrip-files
:
{
+touch testscript foo.test bar.test
: testscript-and-other
:
$* <<EOI 2>>EOE != 0
./: test{../testscript ../foo}
EOI
error: both 'testscript' and other names specified for dir{./}
EOE
: other-and-testscript
:
$* <<EOI 2>>EOE != 0
./: test{../foo ../testscript}
EOI
error: both 'testscript' and other names specified for dir{./}
EOE
: others
:
$* <<EOI
./: test{../foo ../bar}
EOI
}
: wd-is-file
:
touch foo.test;
touch test;
$* <<EOI 2>>EOE != 0
./: test{foo}
EOI
error: working directory test/ is a file/symlink
EOE
: wd-exists-before
:
touch foo.test;
mkdir test &!test/;
$* <<EOI 2>>EOE
./: test{foo}
EOI
warning: working directory test/ exists at the beginning of the test
EOE
: wd-not-empty-before
:
touch foo.test;
mkdir test &!test/;
touch test/dummy &!test/dummy;
$* <<EOI 2>>EOE
./: test{foo}
EOI
warning: working directory test/ exists and is not empty at the beginning of the test
EOE
: wd-not-empty-after
:
: The idea here is to run a nested testscript that creates (but does not
: clean up) a file in our working directory. Note that an implicit cleanup
: cancelation is not required as the file is out of the test root directory
: scope. Also note that we still have to remove everything after detecting the
: failure.
:
cat <<EOI >>>foo.test;
touch ../../dummy
EOI
$* <<EOI 2>>EOE &test/*** != 0
./: test{foo}
EOI
error: working directory test/ is not empty at the end of the test
EOE
|