Test that default toolset's requirements get applied correctly.
()
| 143 | ############################################################################### |
| 144 | |
| 145 | def test_default_toolset_requirements(): |
| 146 | """Test that default toolset's requirements get applied correctly. |
| 147 | """ |
| 148 | |
| 149 | t = BoostBuild.Tester("--user-config= --ignore-site-config", |
| 150 | pass_toolset=False, use_test_config=False, |
| 151 | ignore_toolset_requirements=False) |
| 152 | |
| 153 | toolset_name = "customTestToolsetWithRequirements" |
| 154 | |
| 155 | # Custom toolset. |
| 156 | t.write(toolset_name + ".jam", """ |
| 157 | import feature ; |
| 158 | import toolset ; |
| 159 | feature.extend toolset : %(toolset_name)s ; |
| 160 | toolset.add-requirements <description>toolset-requirement ; |
| 161 | rule init ( ) { } |
| 162 | """ % {'toolset_name': toolset_name}) |
| 163 | |
| 164 | # Main Boost Build project script. |
| 165 | t.write("jamroot.jam", """ |
| 166 | import build-system ; |
| 167 | import errors ; |
| 168 | import feature ; |
| 169 | import notfile ; |
| 170 | |
| 171 | build-system.set-default-toolset %(toolset_name)s ; |
| 172 | |
| 173 | feature.feature description : : free incidental ; |
| 174 | |
| 175 | # We use a rule instead of an action to avoid problems with action output not |
| 176 | # getting piped to stdout by the testing system. |
| 177 | rule buildRule ( names : targets ? : properties * ) |
| 178 | { |
| 179 | local descriptions = [ feature.get-values description : $(properties) ] ; |
| 180 | ECHO "descriptions:" /$(descriptions)/ ; |
| 181 | local toolset = [ feature.get-values toolset : $(properties) ] ; |
| 182 | ECHO "toolset:" /$(toolset)/ ; |
| 183 | } |
| 184 | |
| 185 | notfile testTarget |
| 186 | : @buildRule |
| 187 | : |
| 188 | : |
| 189 | <description>target-requirement |
| 190 | <description>toolset-requirement:<description>conditioned-requirement |
| 191 | <description>unrelated-condition:<description>unrelated-description ; |
| 192 | """ % {'toolset_name': toolset_name}) |
| 193 | |
| 194 | t.run_build_system() |
| 195 | t.expect_output_lines(configuring_default_toolset_message % toolset_name) |
| 196 | t.expect_output_lines("descriptions: /conditioned-requirement/ " |
| 197 | "/target-requirement/ /toolset-requirement/") |
| 198 | t.expect_output_lines("toolset: /%s/" % toolset_name) |
| 199 | |
| 200 | t.cleanup() |
| 201 | |
| 202 |
no test coverage detected