blob: d10f45d60dbbf8d403e0f06bdf4e264a2553ec28 (
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
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
|
# file : tests/directive/config.testscript
# license : MIT; see accompanying LICENSE file
buildfile = true
test.arguments =
: default-value
:
{
.include ../common.testscript
+cat <<EOI >+build/bootstrap.build
using config
EOI
+cat <<EOI >=build/root.build
config [bool] config.test.fancy ?= false
print ($defined(config.test.fancy) ? $config.test.fancy : undefined)
EOI
# This must be a single, serial test since we are sharing config.build.
#
: test
:
cat <<EOI >=buildfile;
./:
EOI
# Unconfigured.
#
$* noop >'false' ;
$* noop config.test.fancy=true >'true' ;
# Configured as default.
#
$* configure >'false' ;
cat ../build/config.build >>~/EOO/ ;
/.*
config.test.fancy = false
/.*
EOO
$* disfigure ;
# Configured as specified.
#
$* configure config.test.fancy=true >'true' ;
$* noop >'true' ;
$* noop config.test.fancy=false >'false' ;
$* configure config.test.fancy=false >'false' ;
$* noop >'false' ;
$* configure config.test.fancy=true >'true' ;
$* disfigure ;
$* noop >'false' ;
$* noop config.test.fancy=[null] >'[null]';
$* noop config.test.fancy=junk 2>>EOE != 0
error: invalid bool value 'junk' in variable config.test.fancy
EOE
}
: default-null
:
{
.include ../common.testscript
+cat <<EOI >+build/bootstrap.build
using config
EOI
+cat <<EOI >=build/root.build
config [bool] config.test.fancy ?= [null]
print ($defined(config.test.fancy) ? $config.test.fancy : undefined)
EOI
# This must be a single, serial test since we are sharing config.build.
#
: test
:
cat <<EOI >=buildfile;
./:
EOI
# Unconfigured.
#
$* noop >'[null]';
$* noop config.test.fancy=true >'true' ;
# Configured as default.
#
$* configure >'[null]';
cat ../build/config.build >>~/EOO/ ;
/.*
config.test.fancy = [null]
/.*
EOO
$* disfigure ;
# Configured as specified.
#
$* configure config.test.fancy=true >'true' ;
$* noop >'true' ;
$* noop config.test.fancy=false >'false' ;
$* noop config.test.fancy=[null] >'[null]';
$* configure config.test.fancy=false >'false' ;
$* noop >'false' ;
$* disfigure ;
$* noop >'[null]';
$* noop config.test.fancy=junk 2>>EOE != 0
error: invalid bool value 'junk' in variable config.test.fancy
EOE
}
: default-none
:
{
.include ../common.testscript
+cat <<EOI >+build/bootstrap.build
using config
EOI
+cat <<EOI >=build/root.build
config [bool] config.test.fancy
print ($defined(config.test.fancy) ? $config.test.fancy : undefined)
EOI
# This must be a single, serial test since we are sharing config.build.
#
: test
:
cat <<EOI >=buildfile;
./:
EOI
# Unconfigured.
#
$* noop >'undefined' ;
$* noop config.test.fancy=true >'true' ;
# Configured as default.
#
$* configure >'undefined' ;
sed -n -e 's/(config.test.fancy)/\1/p' ../build/config.build ;
$* disfigure ;
# Configured as specified.
#
$* configure config.test.fancy=true >'true' ;
$* noop >'true' ;
$* noop config.test.fancy=false >'false' ;
$* configure config.test.fancy=false >'false' ;
$* noop >'false' ;
$* disfigure ;
$* noop >'undefined' ;
$* noop config.test.fancy=[null] >'[null]';
$* noop config.test.fancy=junk 2>>EOE != 0
error: invalid bool value 'junk' in variable config.test.fancy
EOE
}
|