summaryrefslogtreecommitdiff
path: root/tests/tools
diff options
context:
space:
mode:
Diffstat (limited to 'tests/tools')
-rw-r--r--tests/tools/Makefile.am16
-rw-r--r--tests/tools/expected-ginterface-foo.h16
-rw-r--r--tests/tools/expected-gobject-foo.h21
-rw-r--r--tests/tools/test-gobject-foo.sh18
4 files changed, 71 insertions, 0 deletions
diff --git a/tests/tools/Makefile.am b/tests/tools/Makefile.am
index e69de29bb..df9ad4801 100644
--- a/tests/tools/Makefile.am
+++ b/tests/tools/Makefile.am
@@ -0,0 +1,16 @@
+dist_noinst_SCRIPTS = \
+ test-gobject-foo.sh
+
+EXTRA_DIST = \
+ expected-gobject-foo.h \
+ expected-ginterface-foo.h
+
+all-local:
+ chmod +x $(dist_noinst_SCRIPTS)
+
+TESTS = $(dist_noinst_SCRIPTS)
+
+TESTS_ENVIRONMENT = \
+ PYTHON=$(PYTHON) \
+ srcdir=$(srcdir) \
+ top_srcdir=$(top_srcdir)
diff --git a/tests/tools/expected-ginterface-foo.h b/tests/tools/expected-ginterface-foo.h
new file mode 100644
index 000000000..03761b229
--- /dev/null
+++ b/tests/tools/expected-ginterface-foo.h
@@ -0,0 +1,16 @@
+typedef struct _XyzBadgerMushroomSnake XyzBadgerMushroomSnake;
+typedef struct _XyzBadgerMushroomSnakeClass XyzBadgerMushroomSnakeClass;
+typedef struct _XyzBadgerMushroomSnakePrivate XyzBadgerMushroomSnakePrivate;
+
+GType xyz_badger_mushroom_snake_get_type (void);
+
+#define XYZ_BADGER_TYPE_MUSHROOM_SNAKE \
+ (xyz_badger_mushroom_snake_get_type ())
+#define XYZ_BADGER_MUSHROOM_SNAKE(obj) \
+ (G_TYPE_CHECK_INSTANCE_CAST ((obj), XYZ_BADGER_TYPE_MUSHROOM_SNAKE, \
+ XyzBadgerMushroomSnake))
+#define XYZ_BADGER_IS_MUSHROOM_SNAKE(obj) \
+ (G_TYPE_CHECK_INSTANCE_TYPE ((obj), XYZ_BADGER_TYPE_MUSHROOM_SNAKE))
+#define XYZ_BADGER_MUSHROOM_SNAKE_GET_CLASS(obj) \
+ (G_TYPE_INSTANCE_GET_CLASS ((obj), XYZ_BADGER_TYPE_MUSHROOM_SNAKE, \
+ XyzBadgerMushroomSnakeClass))
diff --git a/tests/tools/expected-gobject-foo.h b/tests/tools/expected-gobject-foo.h
new file mode 100644
index 000000000..528ff5a50
--- /dev/null
+++ b/tests/tools/expected-gobject-foo.h
@@ -0,0 +1,21 @@
+typedef struct _XyzBadgerMushroomSnake XyzBadgerMushroomSnake;
+typedef struct _XyzBadgerMushroomSnakeClass XyzBadgerMushroomSnakeClass;
+typedef struct _XyzBadgerMushroomSnakePrivate XyzBadgerMushroomSnakePrivate;
+
+GType xyz_badger_mushroom_snake_get_type (void);
+
+#define XYZ_BADGER_TYPE_MUSHROOM_SNAKE \
+ (xyz_badger_mushroom_snake_get_type ())
+#define XYZ_BADGER_MUSHROOM_SNAKE(obj) \
+ (G_TYPE_CHECK_INSTANCE_CAST ((obj), XYZ_BADGER_TYPE_MUSHROOM_SNAKE, \
+ XyzBadgerMushroomSnake))
+#define XYZ_BADGER_MUSHROOM_SNAKE_CLASS(klass) \
+ (G_TYPE_CHECK_CLASS_CAST ((klass), XYZ_BADGER_TYPE_MUSHROOM_SNAKE, \
+ XyzBadgerMushroomSnakeClass))
+#define XYZ_BADGER_IS_MUSHROOM_SNAKE(obj) \
+ (G_TYPE_CHECK_INSTANCE_TYPE ((obj), XYZ_BADGER_TYPE_MUSHROOM_SNAKE))
+#define XYZ_BADGER_IS_MUSHROOM_SNAKE_CLASS(klass) \
+ (G_TYPE_CHECK_CLASS_TYPE ((klass), XYZ_BADGER_TYPE_MUSHROOM_SNAKE))
+#define XYZ_BADGER_MUSHROOM_SNAKE_GET_CLASS(obj) \
+ (G_TYPE_INSTANCE_GET_CLASS ((obj), XYZ_BADGER_TYPE_MUSHROOM_SNAKE, \
+ XyzBadgerMushroomSnakeClass))
diff --git a/tests/tools/test-gobject-foo.sh b/tests/tools/test-gobject-foo.sh
new file mode 100644
index 000000000..465678102
--- /dev/null
+++ b/tests/tools/test-gobject-foo.sh
@@ -0,0 +1,18 @@
+#!/bin/sh
+
+set -e
+
+${PYTHON} ${top_srcdir}/tools/gobject-foo.py Xyz_Badger Mushroom_Snake \
+ > gobject-foo.h
+${PYTHON} ${top_srcdir}/tools/gobject-foo.py --interface \
+ Xyz_Badger Mushroom_Snake > ginterface-foo.h
+
+e=0
+# We assume POSIX diff, until someone complains
+diff -b -c ${srcdir}/expected-gobject-foo.h gobject-foo.h || e=$?
+diff -b -c ${srcdir}/expected-ginterface-foo.h ginterface-foo.h || e=$?
+
+rm -f gobject-foo.h
+rm -f ginterface-foo.h
+
+exit $e