|
11 | 11 | from zorg.buildbot.builders import UnifiedTreeBuilder
|
12 | 12 | from zorg.buildbot.process.factory import LLVMBuildFactory
|
13 | 13 |
|
| 14 | +#Note: |
| 15 | +# - this function currently supports only %(kw:*)s formatting for the Interpolates. |
| 16 | +# - this function does not support the substitutions for arguments (such as '%(kw:arg:-)s' & etc). |
| 17 | +# - this function does not support the other types of the renderables except Interpolate |
| 18 | +# (such as WithProperties and os on). |
14 | 19 | def partly_rendered(r):
|
15 | 20 | if isinstance(r, buildbot.process.properties.Interpolate):
|
16 | 21 | interpolations = {}
|
17 | 22 | for k, v in r.kwargs.items():
|
18 |
| - interpolations[f"kw:{k}"] = v |
| 23 | + interpolations[f"kw:{k}"] = v if v else "" |
19 | 24 | return r.fmtstring % interpolations
|
20 | 25 | elif type(r) == str:
|
21 | 26 | return r
|
@@ -90,7 +95,7 @@ def factory_has_step(f, name, hasarg=None, contains=None):
|
90 | 95 | assert factory_has_step(f, "set-props")
|
91 | 96 | assert factory_has_step(f, "clean-src-dir")
|
92 | 97 | assert factory_has_step(f, "clean-obj-dir")
|
93 |
| -assert factory_has_step(f, "Checkout the source code") |
| 98 | +assert factory_has_step(f, "checkout") |
94 | 99 |
|
95 | 100 | assert factory_has_step(f, "cmake-configure")
|
96 | 101 | assert factory_has_step(f, "cmake-configure", hasarg = "generator", contains = "Ninja")
|
@@ -193,7 +198,7 @@ def factory_has_step(f, name, hasarg=None, contains=None):
|
193 | 198 | assert factory_has_step(f, "set-props")
|
194 | 199 | assert factory_has_step(f, "clean-src-dir")
|
195 | 200 | assert factory_has_step(f, "clean-obj-dir")
|
196 |
| -assert factory_has_step(f, "Checkout the source code") |
| 201 | +assert factory_has_step(f, "checkout") |
197 | 202 |
|
198 | 203 | assert factory_has_step(f, "clean-install-dir")
|
199 | 204 | assert factory_has_step(f, "cmake-configure")
|
@@ -231,13 +236,13 @@ def factory_has_step(f, name, hasarg=None, contains=None):
|
231 | 236 | print(f"factory with VS environment autodetect: {f}\n")
|
232 | 237 |
|
233 | 238 | assert factory_has_num_steps(f, 8)
|
234 |
| -assert factory_has_step(f, "set-pros.vs_env") |
| 239 | +assert factory_has_step(f, "set-props.vs_env") |
235 | 240 |
|
236 | 241 | f = UnifiedTreeBuilder.getCmakeExBuildFactory(vs = "manual", vs_arch = "amd64")
|
237 | 242 | print(f"factory with VS environment manual: {f}\n")
|
238 | 243 |
|
239 | 244 | assert factory_has_num_steps(f, 8)
|
240 |
| -assert factory_has_step(f, "set-pros.vs_env") |
| 245 | +assert factory_has_step(f, "set-props.vs_env") |
241 | 246 |
|
242 | 247 | # Check custom CMake generator
|
243 | 248 | f = UnifiedTreeBuilder.getCmakeExBuildFactory(generator = "Unix Makefiles")
|
@@ -350,3 +355,13 @@ def factory_has_step(f, name, hasarg=None, contains=None):
|
350 | 355 | assert factory_has_step(f, "post_build_step2", hasarg = "command", contains = ["ls"])
|
351 | 356 | assert factory_has_step(f, "pre_install_step", hasarg = "property", contains = "SomeProperty")
|
352 | 357 | assert factory_has_step(f, "post_finalize_step", hasarg = "property", contains = "SomeProperty")
|
| 358 | + |
| 359 | + |
| 360 | +# Hint |
| 361 | +f = UnifiedTreeBuilder.getCmakeExBuildFactory( |
| 362 | + hint = "stage-hint" |
| 363 | + ) |
| 364 | +print(f"Hint option: {f}\n") |
| 365 | + |
| 366 | +assert factory_has_step(f, "cmake-configure-stage-hint") |
| 367 | +assert factory_has_step(f, "build-default-stage-hint") |
0 commit comments