From: Jon Nordby Date: Sun, 29 Jul 2012 13:39:27 +0000 (+0200) Subject: tests: Add test setup for introspection bindings in Python X-Git-Tag: archive/raspbian/1%0.1.106-3+rpi1^2~15^2~21^2~566 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=059421c56739a8630aa6c21b662841090d83c9a3;p=babl.git tests: Add test setup for introspection bindings in Python This is essentially all we can test for now, as the methods using the Babl type are show up with 'introspectable="1"'. --- diff --git a/tests/Makefile.am b/tests/Makefile.am index a13270d..27e8bbd 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -2,7 +2,7 @@ if OS_UNIX CONCURRENCY_STRESS_TEST = concurrency-stress-test endif -TESTS = \ +C_TESTS = \ grayscale_to_rgb \ rgb_to_bgr \ rgb_to_ycbcr \ @@ -21,7 +21,16 @@ TESTS = \ cairo-RGB24 \ $(CONCURRENCY_STRESS_TEST) -TESTS_ENVIRONMENT = BABL_PATH=$(top_builddir)/extensions/.libs +if HAVE_INTROSPECTION +INTROSPECTION_TESTS = \ + introspection.py +endif + +TESTS = \ + $(C_TESTS) \ + $(INTROSPECTION_TESTS) + +TESTS_ENVIRONMENT = LD_LIBRARY_PATH=$(top_builddir)/babl:$LD_LIBRARY_PATH GI_TYPELIB_PATH=$(top_builddir)/babl BABL_PATH=$(top_builddir)/extensions/.libs AM_CPPFLAGS = -I$(top_srcdir) -I$(top_srcdir)/babl if OS_UNIX @@ -33,6 +42,9 @@ LDADD = $(top_builddir)/babl/libbabl-@BABL_API_VERSION@.la \ EXTRA_DIST=common.inc +noinst_SCRIPTS = \ + introspection.py + noinst_PROGRAMS = \ introspect \ babl_fish_path_fitness \ @@ -40,4 +52,4 @@ noinst_PROGRAMS = \ babl-html-dump \ conversions \ formats \ - $(TESTS) + $(C_TESTS) diff --git a/tests/introspection.py b/tests/introspection.py new file mode 100755 index 0000000..1e855aa --- /dev/null +++ b/tests/introspection.py @@ -0,0 +1,18 @@ +#!/usr/bin/env python + +import unittest + +class TestSanity(unittest.TestCase): + + def test_import(self): + import gi + from gi.repository import Babl + + def test_init(self): + import gi + from gi.repository import Babl + Babl.init() + Babl.exit() + +if __name__ == '__main__': + unittest.main()