Skip to content

Commit

Permalink
clutter-gtk test: don't run if typelib doesn't exist
Browse files Browse the repository at this point in the history
  • Loading branch information
kou committed May 2, 2015
1 parent 8c85f73 commit 6e6f3e6
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
8 changes: 7 additions & 1 deletion clutter-gtk/lib/clutter-gtk.rb
Expand Up @@ -45,7 +45,7 @@ class << self
end
Gtk.init if Gtk.respond_to?(:init)
loader = Loader.new(self, argv)
loader.load("GtkClutter")
loader.load
Clutter.init(argv) if Clutter.respond_to?(:init)
end
end
Expand All @@ -54,11 +54,17 @@ class Loader < GObjectIntrospection::Loader
class InitError < StandardError
end

NAMESPACE = "GtkClutter"

def initialize(base_module, init_arguments)
super(base_module)
@init_arguments = init_arguments
end

def load
super(NAMESPACE)
end

private
def pre_load(repository, namespace)
init = repository.find(namespace, "init")
Expand Down
8 changes: 8 additions & 0 deletions clutter-gtk/test/run-test.rb
Expand Up @@ -68,6 +68,14 @@

require "clutter-gtk"

repository = GObjectIntrospection::Repository.default
begin
repository.require(ClutterGtk::Loader::NAMESPACE)
rescue GLib::Error
puts("Omit because typelib file doesn't exist: #{$!.message}")
exit(true)
end

# exclude sample/test-*
clutter_gtk_test_base = File.join(clutter_gtk_base, "test")
exit Test::Unit::AutoRunner.run(true, clutter_gtk_test_base)

0 comments on commit 6e6f3e6

Please sign in to comment.