[pygobject/pygobject-2-28] [tests] Separate processes for GI and static binding tests.
- From: Laszlo Pandy <lpandy src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [pygobject/pygobject-2-28] [tests] Separate processes for GI and static binding tests.
- Date: Tue, 15 Feb 2011 20:03:21 +0000 (UTC)
commit 888675f85c895a60d4432b992961ec3067da6e20
Author: Laszlo Pandy <lpandy src gnome org>
Date: Tue Feb 15 20:07:42 2011 +0100
[tests] Separate processes for GI and static binding tests.
Importing and using both static gobject bindings and
introspection GObject bindings in the same process can cause
conflicts with types which otherwise wouldn't be there.
This patch changes "make check" to call runtests.py twice -- once
for each set of tests.
In the case of a test failure, runtests.py now sets the exit code
so that make does not continue. Otherwise you might miss the
failures from the first batch of tests in the scrollback.
tests/Makefile.am | 29 ++++++++++++-----------------
tests/runtests.py | 4 +++-
2 files changed, 15 insertions(+), 18 deletions(-)
---
diff --git a/tests/Makefile.am b/tests/Makefile.am
index fb3d8e7..e5c2a68 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -68,7 +68,7 @@ testhelper.la: $(testhelper_la_OBJECTS) $(testhelper_la_DEPENDENCIES)
all: $(LTLIBRARIES:.la=.so)
-TEST_FILES = \
+TEST_FILES_STATIC = \
test_gobject.py \
test_interface.py \
test_mainloop.py \
@@ -81,7 +81,7 @@ TEST_FILES = \
test_uris.py
if BUILD_GIO
-GIO_TEST_FILES = \
+TEST_FILES_GIO = \
test_gio.py \
test_gresolver.py \
test_gsocket.py \
@@ -90,7 +90,7 @@ GIO_TEST_FILES = \
endif
if ENABLE_INTROSPECTION
-TEST_FILES += \
+TEST_FILES_GI = \
test_everything.py \
test_gi.py \
test_gdbus.py \
@@ -106,30 +106,25 @@ EXTRA_DIST = \
test-unknown.h \
org.gnome.test.gschema.xml
-EXTRA_DIST += $(TEST_FILES)
+EXTRA_DIST += $(TEST_FILES_STATIC) $(TEST_FILES_GI) $(TEST_FILES_GIO)
clean-local:
rm -f $(LTLIBRARIES:.la=.so) file.txt~
DBUS_LAUNCH=$(shell which dbus-launch)
-
-# need to run the gio tests separately to avoid loading gi.repository.Gio and
-# gio at the same time
-check-local: $(LTLIBRARIES:.la=.so) Regress-1.0.typelib GIMarshallingTests-1.0.typelib gschemas.compiled
- TEST_FILES="$(TEST_FILES)" \
+RUN_TESTS_ENV_VARS= \
PYTHONPATH=$(top_builddir):$(top_builddir)/tests:$${PYTHONPATH:+:$$PYTHONPATH} \
LD_LIBRARY_PATH=$(builddir)/.libs:$$LD_LIBRARY_PATH \
GI_TYPELIB_PATH=$(builddir):$$GI_TYPELIB_PATH \
- XDG_DATA_DIRS=$$XDG_DATA_DIRS:/usr/share \
- $(DBUS_LAUNCH) $(EXEC_NAME) $(PYTHON) $(srcdir)/runtests.py
+ XDG_DATA_DIRS=$$XDG_DATA_DIRS:/usr/share
+RUN_TESTS_LAUNCH=$(RUN_TESTS_ENV_VARS) $(DBUS_LAUNCH) $(EXEC_NAME) $(PYTHON) $(srcdir)/runtests.py
+# run tests in separately to avoid loading static and introspection bindings in the same process
+check-local: $(LTLIBRARIES:.la=.so) Regress-1.0.typelib GIMarshallingTests-1.0.typelib gschemas.compiled
+ TEST_FILES="$(TEST_FILES_STATIC)" $(RUN_TESTS_LAUNCH)
+ TEST_FILES="$(TEST_FILES_GI)" $(RUN_TESTS_LAUNCH)
if BUILD_GIO
- TEST_FILES="$(GIO_TEST_FILES)" \
- PYTHONPATH=$(top_builddir):$(top_builddir)/tests:$${PYTHONPATH:+:$$PYTHONPATH} \
- LD_LIBRARY_PATH=$(builddir)/.libs:$$LD_LIBRARY_PATH \
- GI_TYPELIB_PATH=$(builddir):$$GI_TYPELIB_PATH \
- XDG_DATA_DIRS=$$XDG_DATA_DIRS:/usr/share \
- $(EXEC_NAME) $(PYTHON) $(srcdir)/runtests.py
+ TEST_FILES="$(TEST_FILES_GIO)" $(RUN_TESTS_LAUNCH)
endif
check.gdb:
diff --git a/tests/runtests.py b/tests/runtests.py
index 54c65aa..2dc17e0 100644
--- a/tests/runtests.py
+++ b/tests/runtests.py
@@ -25,5 +25,7 @@ suite = loader.loadTestsFromNames(names)
# Run tests.
runner = unittest.TextTestRunner(verbosity=2)
-runner.run(suite)
+result = runner.run(suite)
+if not result.wasSuccessful():
+ sys.exit(1) # exit code so "make check" reports error
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]