[babl] tests: Add test setup for introspection bindings in Python
- From: Jon Nordby <jonnor src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [babl] tests: Add test setup for introspection bindings in Python
- Date: Tue, 31 Jul 2012 16:43:58 +0000 (UTC)
commit 059421c56739a8630aa6c21b662841090d83c9a3
Author: Jon Nordby <jononor gmail com>
Date: Sun Jul 29 15:39:27 2012 +0200
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"'.
tests/Makefile.am | 18 +++++++++++++++---
tests/introspection.py | 18 ++++++++++++++++++
2 files changed, 33 insertions(+), 3 deletions(-)
---
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()
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]