Basic tests for properties conditioned on multiple other properties.
()
| 19 | ############################################################################### |
| 20 | |
| 21 | def 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", """\ |
| 28 | import feature ; |
| 29 | feature.extend toolset : testToolset ; |
| 30 | rule init ( ) { } |
| 31 | """) |
| 32 | |
| 33 | t.write("testToolset.py", """\ |
| 34 | from b2.build import feature |
| 35 | feature.extend('toolset', ["testToolset"]) |
| 36 | def init ( ): pass |
| 37 | """) |
| 38 | |
| 39 | t.write("jamroot.jam", """\ |
| 40 | import feature ; |
| 41 | import notfile ; |
| 42 | import toolset ; |
| 43 | |
| 44 | feature.feature description : : free incidental ; |
| 45 | feature.feature aaa : 1 0 : incidental ; |
| 46 | feature.feature bbb : 1 0 : incidental ; |
| 47 | feature.feature ccc : 1 0 : incidental ; |
| 48 | |
| 49 | rule buildRule ( name : targets ? : properties * ) |
| 50 | { |
| 51 | for local description in [ feature.get-values description : $(properties) ] |
| 52 | { |
| 53 | ECHO "description:" /$(description)/ ; |
| 54 | } |
| 55 | } |
| 56 | |
| 57 | notfile 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) |
no test coverage detected