MCPcopy Create free account
hub / github.com/boostorg/build / test_multiple_conditions

Function test_multiple_conditions

v2/test/conditionals_multiple.py:21–118  ·  view source on GitHub ↗

Basic tests for properties conditioned on multiple other properties.

()

Source from the content-addressed store, hash-verified

19###############################################################################
20
21def test_multiple_conditions():
22 """Basic tests for properties conditioned on multiple other properties."""
23
24 t = BoostBuild.Tester(["--user-config=", "--ignore-site-config",
25 "toolset=testToolset"], pass_toolset=False, use_test_config=False)
26
27 t.write("testToolset.jam", """\
28import feature ;
29feature.extend toolset : testToolset ;
30rule init ( ) { }
31""")
32
33 t.write("testToolset.py", """\
34from b2.build import feature
35feature.extend('toolset', ["testToolset"])
36def init ( ): pass
37""")
38
39 t.write("jamroot.jam", """\
40import feature ;
41import notfile ;
42import toolset ;
43
44feature.feature description : : free incidental ;
45feature.feature aaa : 1 0 : incidental ;
46feature.feature bbb : 1 0 : incidental ;
47feature.feature ccc : 1 0 : incidental ;
48
49rule buildRule ( name : targets ? : properties * )
50{
51 for local description in [ feature.get-values description : $(properties) ]
52 {
53 ECHO "description:" /$(description)/ ;
54 }
55}
56
57notfile testTarget1 : @buildRule : :
58 <description>d
59 <aaa>0:<description>a0
60 <aaa>1:<description>a1
61 <aaa>0,<bbb>0:<description>a0-b0
62 <aaa>0,<bbb>1:<description>a0-b1
63 <aaa>1,<bbb>0:<description>a1-b0
64 <aaa>1,<bbb>1:<description>a1-b1
65 <aaa>0,<bbb>0,<ccc>0:<description>a0-b0-c0
66 <aaa>0,<bbb>0,<ccc>1:<description>a0-b0-c1
67 <aaa>0,<bbb>1,<ccc>1:<description>a0-b1-c1
68 <aaa>1,<bbb>0,<ccc>1:<description>a1-b0-c1
69 <aaa>1,<bbb>1,<ccc>0:<description>a1-b1-c0
70 <aaa>1,<bbb>1,<ccc>1:<description>a1-b1-c1 ;
71""")
72
73 t.run_build_system(["aaa=1", "bbb=1", "ccc=1"])
74 t.expect_output_lines("description: /d/" )
75 t.expect_output_lines("description: /a0/" , False)
76 t.expect_output_lines("description: /a1/" )
77 t.expect_output_lines("description: /a0-b0/" , False)
78 t.expect_output_lines("description: /a0-b1/" , False)

Callers 1

Calls 4

writeMethod · 0.95
run_build_systemMethod · 0.95
expect_output_linesMethod · 0.95
cleanupMethod · 0.95

Tested by

no test coverage detected