def test_simple_distutils(self): 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, DistutilsConfigureContext) configure.run(conf) conf.shutdown() build = BuildCommand() opts = OptionsContext.from_command(build) bld = DistutilsBuildContext([], opts, conf.pkg, top_node) build.run(bld)
def test_simple(self): root = self.root top_node = root.find_node(self.d) create_fake_package_from_bento_info(top_node, BENTO_INFO) conf, configure = prepare_configure(top_node, BENTO_INFO, ConfigureYakuContext) configure.run(conf) conf.shutdown() build = BuildCommand() opts = OptionsContext.from_command(build) bld = BuildYakuContext([], opts, conf.pkg, top_node) build.run(bld)
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([], opts, conf.pkg, top_node) bld.waf_context.logger = make_stream_logger("build", StringIO()) build.run(bld)
def _test_run(self, bento_info): top_node = self.top_node create_fake_package_from_bento_info(top_node, bento_info) install_dir = tempfile.mkdtemp() cmd_argv = ["--prefix=%s" % install_dir, "--exec-prefix=%s" % install_dir] conf, configure = prepare_configure(top_node, bento_info, ConfigureYakuContext, cmd_argv) configure.run(conf) conf.shutdown() bld, build = prepare_build(top_node, conf.pkg) build.run(bld) build.shutdown(bld) install = InstallCommand() opts = OptionsContext.from_command(install) inst = CmdContext(["--list-files"], opts, conf.pkg, top_node) try: install.run(inst) finally: shutil.rmtree(install_dir)