def _create_contexts(self, bentos, bscripts=None): conf, configure, bld, build = super(TestBuildWaf, self)._create_contexts(bentos, bscripts) from bento.commands.extras.waf import make_stream_logger from cStringIO import StringIO bld.waf_context.logger = make_stream_logger("build", StringIO()) return conf, configure, bld, build
def test_simple_waf(self): from bento.commands.extras.waf import ConfigureWafContext, BuildWafContext, make_stream_logger, register_options top_node = self.top_node create_fake_package_from_bento_info(top_node, BENTO_INFO_WITH_EXT) conf, configure = prepare_configure(top_node, BENTO_INFO_WITH_EXT, ConfigureWafContext) configure.run(conf) conf.shutdown() build = BuildCommand() # opts = OptionsContext.from_command(build) opts = prepare_options("build", build, BuildWafContext) bld = BuildWafContext(None, [], opts, conf.pkg, top_node) bld.waf_context.logger = make_stream_logger("build", cStringIO()) build.run(bld)