summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorColin Walters <walters@verbum.org>2010-08-19 17:36:38 -0400
committerColin Walters <walters@verbum.org>2010-08-31 17:24:23 -0400
commit7c5a7dba08839fbb093ecdbcee4877e21a004c2a (patch)
tree660d6c1ea6c4f2bfccc7a62868be1b1d0221a870
parent7d9651997d8bc949bca018ce93a0ae77faea55be (diff)
downloadgjs-7c5a7dba08839fbb093ecdbcee4877e21a004c2a.tar.gz
Port to new gobject-introspection tests
Everything is now Regress, and both it and GIMarshallingTests come in .c form. Disable the g_utf8_get_char test until gunichar becomes introspectable. https://bugzilla.gnome.org/show_bug.cgi?id=627435
-rw-r--r--Makefile-test.am38
-rw-r--r--configure.ac3
-rw-r--r--test/js/testEverythingBasic.js3
-rw-r--r--test/js/testEverythingEncapsulated.js3
-rw-r--r--test/js/testGI.js3
5 files changed, 46 insertions, 4 deletions
diff --git a/Makefile-test.am b/Makefile-test.am
index ff3cc425..f8ac7677 100644
--- a/Makefile-test.am
+++ b/Makefile-test.am
@@ -62,6 +62,41 @@ CLEANFILES += \
EXTRA_DIST += \
scripts/make-tests
+# noinst_ always builds a static library
+testlib_LTLIBRARIES = libregress.la libgimarshallingtests.la
+testlibdir = $(prefix)/unused
+install-testlibLTLIBRARIES: # prevent it from being installed
+
+libregress_la_SOURCES = $(GI_DATADIR)/tests/regress.c $(GI_DATADIR)/tests/regress.h
+libregress_la_CFLAGS = $(GJS_CFLAGS) $(GJS_CAIRO_CFLAGS)
+libregress_la_LDFLAGS = -avoid-version $(GJS_LIBS) $(GJS_CAIRO_LIBS)
+libgimarshallingtests_la_SOURCES = $(GI_DATADIR)/tests/gimarshallingtests.c $(GI_DATADIR)/tests/gimarshallingtests.h
+libgimarshallingtests_la_CFLAGS = $(GJS_CFLAGS)
+libgimarshallingtests_la_LDFLAGS = -avoid-version $(GJS_LIBS)
+
+# g-i doesn't ship these as shared libraries anymore; we build them here
+Regress-1.0.gir: libregress.la Makefile
+ $(AM_V_GEN) g-ir-scanner --include=cairo-1.0 --include=Gio-2.0 \
+ --namespace=Regress --nsversion=1.0 \
+ --warn-all --warn-error \
+ --library=libregress.la \
+ --libtool="$(top_builddir)/libtool" \
+ --output $@ \
+ $(libregress_la_SOURCES)
+Regress-1.0.typelib: Regress-1.0.gir Makefile
+ $(AM_V_GEN) g-ir-compiler $< -o $@
+
+GIMarshallingTests-1.0.gir: libgimarshallingtests.la Makefile
+ $(AM_V_GEN) g-ir-scanner --include=Gio-2.0 \
+ --namespace=GIMarshallingTests --nsversion=1.0 --symbol-prefix=gi_marshalling_tests \
+ --warn-all --warn-error \
+ --library=libgimarshallingtests.la \
+ --libtool="$(top_builddir)/libtool" \
+ --output $@ \
+ $(libgimarshallingtests_la_SOURCES)
+GIMarshallingTests-1.0.typelib: GIMarshallingTests-1.0.gir Makefile
+ $(AM_V_GEN) g-ir-compiler $< -o $@
+
########################################################################
TESTS_ENVIRONMENT = \
TOP_SRCDIR=$(top_srcdir) \
@@ -70,10 +105,11 @@ TESTS_ENVIRONMENT = \
GJS_DEBUG_OUTPUT=test_user_data/logs/gjs.log \
BUILDDIR=. \
GJS_USE_UNINSTALLED_FILES=1 \
+ GI_TYPELIB_PATH=$(builddir) \
LD_LIBRARY_PATH="$(LD_LIBRARY_PATH):$(FIREFOX_JS_LIBDIR)" \
G_FILENAME_ENCODING=latin1 # ensure filenames are not utf8
-test: $(gjsnative_LTLIBRARIES) ${TEST_PROGS}
+test: $(gjsnative_LTLIBRARIES) ${TEST_PROGS} Regress-1.0.typelib GIMarshallingTests-1.0.typelib
@test -z "${TEST_PROGS}" || ${GTESTER} --verbose ${TEST_PROGS} ${TEST_PROGS_OPTIONS}
check: test
diff --git a/configure.ac b/configure.ac
index e0dd7333..9996309b 100644
--- a/configure.ac
+++ b/configure.ac
@@ -192,6 +192,9 @@ CFLAGS=$saved_CFLAGS
LIBS=$saved_LIBS
PKG_CHECK_MODULES([GJSTESTS], [$gjstests_packages])
+GI_DATADIR=$($PKG_CONFIG --variable=gidatadir gobject-introspection-1.0)
+AC_SUBST(GI_DATADIR)
+
if test x"$JS_PACKAGE" = x; then
# if JS_PACKAGE is undefined, pkg-config modules don't include
# SpiderMonkey and we need to deal with it ourselves
diff --git a/test/js/testEverythingBasic.js b/test/js/testEverythingBasic.js
index 03e0de03..a45a6da4 100644
--- a/test/js/testEverythingBasic.js
+++ b/test/js/testEverythingBasic.js
@@ -1,4 +1,5 @@
-const Everything = imports.gi.Everything;
+// This used to be called "Everything"
+const Everything = imports.gi.Regress;
if (!('assertEquals' in this)) { /* allow running this test standalone */
imports.lang.copyPublicProperties(imports.jsUnit, this);
gjstestRun = function() { return imports.jsUnit.gjstestRun(window); };
diff --git a/test/js/testEverythingEncapsulated.js b/test/js/testEverythingEncapsulated.js
index 76d59912..30008ce2 100644
--- a/test/js/testEverythingEncapsulated.js
+++ b/test/js/testEverythingEncapsulated.js
@@ -1,4 +1,5 @@
-const Everything = imports.gi.Everything;
+// This used to be called "Everything"
+const Everything = imports.gi.Regress;
if (!('assertEquals' in this)) { /* allow running this test standalone */
imports.lang.copyPublicProperties(imports.jsUnit, this);
gjstestRun = function() { return imports.jsUnit.gjstestRun(window); };
diff --git a/test/js/testGI.js b/test/js/testGI.js
index a800c419..08852ee5 100644
--- a/test/js/testGI.js
+++ b/test/js/testGI.js
@@ -1,7 +1,8 @@
function testUTF8() {
const GLib = imports.gi.GLib;
- assertEquals(0x2664, GLib.utf8_get_char("\u2664 utf8"));
+ // gunichar is temporarily not-introspectable
+ //assertEquals(0x2664, GLib.utf8_get_char("\u2664 utf8"));
}
function testThrows() {