Example #1
0
 def setUp(self):
     self.save = os.getcwd()
     self.d = tempfile.mkdtemp()
     os.chdir(self.d)
     try:
         self.top_node = create_first_node(self.d)
     except Exception:
         os.chdir(self.save)
         raise
Example #2
0
 def _test_compiled_library(self, tree, clib, spkg, sources, include_dirs):
     d = tempfile.mkdtemp()
     try:
         top = create_first_node(d)
         create_fake_tree(top, tree)
         clibs = subpackage.flatten_subpackage_compiled_libraries(
                 spkg, top)
         self.failUnless("bar.clib" in clibs)
         clib = clibs["bar.clib"]
         self.assertEqual(clib.sources, sources)
         self.assertEqual(clib.include_dirs, include_dirs)
     finally:
         shutil.rmtree(d)
Example #3
0
    def setUp(self):
        self.run_node = create_first_node(os.getcwd())

        registry = bento.commands.registries.CommandRegistry()

        # help command assumes those always exist
        registry.register("configure", Command)
        registry.register("build", Command)
        registry.register("install", Command)
        registry.register("sdist", Command)
        registry.register("build_wininst", Command)
        registry.register("build_egg", Command)
        self.registry = registry

        self.options_registry = bento.commands.registries.OptionsRegistry()
        self.options_registry.register("configure", OptionsContext())
Example #4
0
    def test_extension(self):
        tree = [
            "foo/src/hellomodule.c",
            "foo/bento.info",
            "bento.info"]
        extension = pkg_objects.Extension("_hello",
                        sources=["src/hellomodule.c"],
                        include_dirs=["."])
        spkg = package.SubPackageDescription(
                        rdir="foo",
                        extensions={"_hello": extension})

        d = tempfile.mkdtemp()
        try:
            top = create_first_node(d)
            create_fake_tree(top, tree)
            extensions = subpackage.flatten_subpackage_extensions(
                    spkg, top)
            self.failUnless("foo._hello" in extensions)
            extension = extensions["foo._hello"]
            self.assertEqual(extension.sources, ["foo/src/hellomodule.c"])
            self.assertEqual(extension.include_dirs, ["foo"])
        finally:
            shutil.rmtree(d)