Ejemplo n.º 1
0
    def test_deps(self):
        ns = get_namespace("DBus", "1.0")
        deps = ns.dependencies
        self.assertTrue(("GObject", "2.0") in deps)

        ns = get_namespace("GLib", "2.0")
        deps = ns.dependencies
        self.assertFalse(deps)

        ns = get_namespace("GObject", "2.0")
        deps = ns.dependencies
        self.assertEqual(deps, [("GLib", "2.0")])
Ejemplo n.º 2
0
    def test_deps(self):
        ns = get_namespace("DBus", "1.0")
        deps = ns.dependencies
        self.assertTrue(("GObject", "2.0") in deps)

        ns = get_namespace("GLib", "2.0")
        deps = ns.dependencies
        self.assertFalse(deps)

        ns = get_namespace("GObject", "2.0")
        deps = ns.dependencies
        self.assertEqual(deps, [("GLib", "2.0")])
Ejemplo n.º 3
0
 def test_atk(self):
     ns = get_namespace("Atk", "1.0")
     ns.types
     docs = ns.docs
     versions = get_versions(docs)
     self.assertTrue("ATK-0.7" not in versions)
     self.assertTrue("0.7" in versions)
     self.assertTrue("2.16" in versions)
Ejemplo n.º 4
0
 def test_atk(self):
     ns = get_namespace("Atk", "1.0")
     ns.types
     docs = ns.docs
     versions = get_versions(docs)
     self.assertTrue("ATK-0.7" not in versions)
     self.assertTrue("0.7" in versions)
     self.assertTrue("2.16" in versions)
Ejemplo n.º 5
0
    def test_gobject(self):
        ns = get_namespace("GObject", "2.0")
        types = ns.types
        ns.docs

        self.assertEqual(types["GTypeCValue"], ["GObject.TypeCValue"])
        self.assertEqual(types["GBoxed"], ["GObject.GBoxed"])

        self.assertEqual(types["G_MAXSSIZE"], ["GObject.G_MAXSSIZE"])
        self.assertEqual(types["GType"], ["GObject.GType"])
Ejemplo n.º 6
0
    def test_gobject(self):
        ns = get_namespace("GObject", "2.0")
        types = ns.types
        ns.docs

        self.assertEqual(types["GTypeCValue"], ["GObject.TypeCValue"])
        self.assertEqual(types["GBoxed"], ["GObject.GBoxed"])

        self.assertEqual(types["G_MAXSSIZE"], ["GObject.G_MAXSSIZE"])
        self.assertEqual(types["GType"], ["GObject.GType"])
Ejemplo n.º 7
0
    def test_gdk(self):
        ns = get_namespace("Gdk", "3.0")
        types = ns.types
        docs = ns.docs
        versions = get_versions(docs)
        self.assertTrue("2.0" in versions)
        self.assertTrue("3.0" in versions)

        self.assertEqual(types["GdkModifierType"], ["Gdk.ModifierType"])
        self.assertEqual(
            ns.instance_params["Gdk.Window.begin_paint_region"], "window")
Ejemplo n.º 8
0
    def test_gdk(self):
        ns = get_namespace("Gdk", "3.0")
        types = ns.types
        docs = ns.docs
        versions = get_versions(docs)
        self.assertTrue("2.0" in versions)
        self.assertTrue("3.0" in versions)

        self.assertEqual(types["GdkModifierType"], ["Gdk.ModifierType"])
        self.assertEqual(
            ns.instance_params["Gdk.Window.begin_paint_region"], "window")
Ejemplo n.º 9
0
    def test_soup(self):
        ns = get_namespace("Soup", "2.4")
        types = ns.types
        ns.docs

        self.assertEqual(types["SOUP_STATUS_CANCELLED"],
                         ["Soup.Status.CANCELLED"])

        self.assertEqual(types["SoupContentDecoder"], ["Soup.ContentDecoder"])

        self.assertEqual(types["SoupContentDecoder"], ["Soup.ContentDecoder"])

        self.assertEqual(types["soup_cookie_parse"],
                         [u'Soup.Cookie.parse', u'Soup.cookie_parse'])
Ejemplo n.º 10
0
    def test_glib(self):
        ns = get_namespace("GLib", "2.0")
        types = ns.types
        ns.docs

        self.assertEqual(types["GBookmarkFileError"],
                         ["GLib.BookmarkFileError"])

        self.assertEqual(types["G_MININT8"], ["GLib.MININT8"])

        self.assertEqual(types["g_idle_add_full"], ["GLib.idle_add"])

        # non-introspectable
        self.assertEqual(ns.types["GVariantIter"], [])
Ejemplo n.º 11
0
    def test_glib(self):
        ns = get_namespace("GLib", "2.0")
        types = ns.types
        ns.docs

        self.assertEqual(types["GBookmarkFileError"],
                         ["GLib.BookmarkFileError"])

        self.assertEqual(types["G_MININT8"], ["GLib.MININT8"])

        self.assertEqual(types["g_idle_add_full"], ["GLib.idle_add"])

        # non-introspectable
        self.assertEqual(ns.types["GVariantIter"], [])
Ejemplo n.º 12
0
    def test_soup(self):
        ns = get_namespace("Soup", "2.4")
        types = ns.types
        ns.docs

        self.assertEqual(types["SOUP_STATUS_CANCELLED"],
                         ["Soup.Status.CANCELLED"])

        self.assertEqual(types["SoupContentDecoder"],
                         ["Soup.ContentDecoder"])

        self.assertEqual(types["SoupContentDecoder"],
                         ["Soup.ContentDecoder"])

        self.assertEqual(types["soup_cookie_parse"],
                         [u'Soup.Cookie.parse', u'Soup.cookie_parse'])
Ejemplo n.º 13
0
    def test_gtk(self):
        ns = get_namespace("Gtk", "3.0")
        types = ns.types
        ns.docs

        for key, values in types.items():
            for v in values:
                self.assertTrue(v.startswith("Gtk."), msg=v)

        self.assertEqual(types["GtkWindow"], ["Gtk.Window"])
        self.assertEqual(types["GtkAppChooser"], ["Gtk.AppChooser"])
        self.assertEqual(types["GtkArrowType"], ["Gtk.ArrowType"])

        type_structs = ns.type_structs
        self.assertEqual(type_structs["GtkTreeStoreClass"], "Gtk.TreeStore")

        self.assertEqual(types["gtk_list_store_newv"], ["Gtk.ListStore.new"])
        self.assertEqual(types["gtk_list_store_new"], [])
Ejemplo n.º 14
0
    def test_gtk(self):
        ns = get_namespace("Gtk", "3.0")
        types = ns.types
        ns.docs

        for key, values in types.items():
            for v in values:
                self.assertTrue(v.startswith("Gtk."), msg=v)

        self.assertEqual(types["GtkWindow"], ["Gtk.Window"])
        self.assertEqual(types["GtkAppChooser"], ["Gtk.AppChooser"])
        self.assertEqual(types["GtkArrowType"], ["Gtk.ArrowType"])

        type_structs = ns.type_structs
        self.assertEqual(type_structs["GtkTreeStoreClass"], "Gtk.TreeStore")

        self.assertEqual(types["gtk_list_store_newv"], ["Gtk.ListStore.new"])
        self.assertEqual(types["gtk_list_store_new"], [])
Ejemplo n.º 15
0
def print_missing():
    """print modules that are present but not included in the build list
    or the blacklist
    """

    print "Searching for missing modules.."

    girs = get_gir_files()

    missing = set(BUILD) - set(girs.keys())
    if missing:
        print "Missing girs: %r" % missing

    bl_depend = set()

    if "check" in sys.argv[1:]:
        blacklist = set(BLACKLIST)
        missing = set()
        for key, path in girs.items():
            if key not in BUILD and key not in BLACKLIST:
                ns = get_namespace(*key.split("-"))
                deps = set(["-".join(d) for d in ns.get_all_dependencies()])
                if deps & blacklist:
                    bl_depend.add(key)
                    continue
                missing.add(key)

    if bl_depend:
        print "Depending on blacklisted modules:"
        for key in bl_depend:
            print "\"%s\"," % key

    if missing:
        print "..missing:"
    else:
        print "..none missing."
    for key in sorted(missing):
        print "\"%s\"," % key

    if missing or bl_depend:
        raise SystemExit(1)
Ejemplo n.º 16
0
def print_missing():
    """print modules that are present but not included in the build list
    or the blacklist
    """

    print "Searching for missing modules.."

    girs = get_gir_files()

    missing = set(BUILD) - set(girs.keys())
    if missing:
        print "Missing girs: %r" % missing

    bl_depend = set()

    if "check" in sys.argv[1:]:
        blacklist = set(BLACKLIST)
        missing = set()
        for key, path in girs.items():
            if key not in BUILD and key not in BLACKLIST:
                ns = get_namespace(*key.split("-"))
                deps = set(["-".join(d) for d in ns.get_all_dependencies()])
                if deps & blacklist:
                    bl_depend.add(key)
                    continue
                missing.add(key)

    if bl_depend:
        print "Depending on blacklisted modules:"
        for key in bl_depend:
            print "\"%s\"," % key

    if missing:
        print "..missing:"
    else:
        print "..none missing."
    for key in sorted(missing):
        print "\"%s\"," % key

    if missing or bl_depend:
        raise SystemExit(1)
Ejemplo n.º 17
0
    def test_cairo(self):
        ns = get_namespace("cairo", "1.0")
        types = ns.types
        ns.docs

        self.assertEqual(types["cairo_t"], ["cairo.Context"])
Ejemplo n.º 18
0
    def test_gdkpixbuf(self):
        ns = get_namespace("GdkPixbuf", "2.0")

        self.assertEqual(ns.types["gdk_pixbuf_animation_ref"], [])
Ejemplo n.º 19
0
    def test_pango(self):
        ns = get_namespace("Pango", "1.0")
        types = ns.types
        ns.docs

        self.assertEqual(types["pango_break"], ["Pango.break_"])
Ejemplo n.º 20
0
 def test_all_deps(self):
     ns = get_namespace("DBus", "1.0")
     deps = ns.all_dependencies
     self.assertTrue(("GObject", "2.0") in deps)
     self.assertTrue(("GLib", "2.0") in deps)
Ejemplo n.º 21
0
 def test_ges(self):
     ns = get_namespace("GES", "1.0")
     ns.docs
     types = ns.types
     self.assertTrue("position" not in types)
Ejemplo n.º 22
0
    def test_gdkpixbuf(self):
        ns = get_namespace("GdkPixbuf", "2.0")

        self.assertEqual(ns.types["gdk_pixbuf_animation_ref"], [])
Ejemplo n.º 23
0
 def test_all_deps(self):
     ns = get_namespace("DBus", "1.0")
     deps = ns.all_dependencies
     self.assertTrue(("GObject", "2.0") in deps)
     self.assertTrue(("GLib", "2.0") in deps)
Ejemplo n.º 24
0
    def test_cairo(self):
        ns = get_namespace("cairo", "1.0")
        types = ns.types
        ns.docs

        self.assertEqual(types["cairo_t"], ["cairo.Context"])
Ejemplo n.º 25
0
 def test_ges(self):
     ns = get_namespace("GES", "1.0")
     ns.docs
     types = ns.types
     self.assertTrue("position" not in types)
Ejemplo n.º 26
0
    def test_pango(self):
        ns = get_namespace("Pango", "1.0")
        types = ns.types
        ns.docs

        self.assertEqual(types["pango_break"], ["Pango.break_"])