[pygobject] Do not run tests in two phases any more



commit 65762243a34af014950527c323a51a29d40fb3e1
Author: Martin Pitt <martin pitt ubuntu com>
Date:   Thu Mar 22 10:15:16 2012 +0100

    Do not run tests in two phases any more
    
    As we dropped the static bindings a while ago, there is no need any more to run
    the tests in two phases (static/GI). Now just run them all in one go,
    simplifying tests/Makefile.am.
    
    As this changes the order of the tests, defining $GSETTINGS_SCHEMA_DIR now
    needs to happen even further, so move it from tests/test_overrides.py to
    tests/runtests.py.

 tests/Makefile.am       |   33 ++++++++++++---------------------
 tests/runtests.py       |    7 +++++++
 tests/test_overrides.py |    6 ------
 3 files changed, 19 insertions(+), 27 deletions(-)
---
diff --git a/tests/Makefile.am b/tests/Makefile.am
index 4924a87..3e00abd 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -65,7 +65,16 @@ testhelper.la: $(testhelper_la_OBJECTS) $(testhelper_la_DEPENDENCIES)
 
 all: $(LTLIBRARIES:.la=.so)
 
-TEST_FILES_STATIC = \
+EXTRA_DIST = \
+	compathelper.py \
+	runtests.py \
+	runtests-windows.py \
+	testmodule.py \
+	test-floating.h \
+	test-thread.h \
+	test-unknown.h \
+	te_ST nouppera \
+	org.gnome.test.gschema.xml \
 	test_gobject.py \
 	test_interface.py \
 	test_mainloop.py \
@@ -75,29 +84,13 @@ TEST_FILES_STATIC = \
 	test_source.py \
 	test_subprocess.py \
 	test_thread.py \
-	test_uris.py
-
-
-TEST_FILES_GI = \
+	test_uris.py \
 	test_everything.py \
 	test_gi.py \
 	test_gdbus.py \
 	test_overrides.py \
 	test_pygtkcompat.py
 
-EXTRA_DIST = \
-	compathelper.py \
-	runtests.py \
-	runtests-windows.py \
-	testmodule.py \
-	test-floating.h \
-	test-thread.h \
-	test-unknown.h \
-	te_ST nouppera \
-	org.gnome.test.gschema.xml
-
-EXTRA_DIST += $(TEST_FILES_STATIC) $(TEST_FILES_GI)
-
 clean-local:
 	rm -f $(LTLIBRARIES:.la=.so) file.txt~
 
@@ -108,12 +101,10 @@ RUN_TESTS_ENV_VARS= \
 	GI_TYPELIB_PATH=$(builddir):$$GI_TYPELIB_PATH \
 	XDG_DATA_DIRS=$$XDG_DATA_DIRS:/usr/share \
 	TESTS_BUILDDIR=$(builddir)
-RUN_TESTS_LAUNCH=$(RUN_TESTS_ENV_VARS) $(DBUS_LAUNCH) $(EXEC_NAME) $(PYTHON) $(srcdir)/runtests.py
 
 check-local: check-pyflakes
 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)
+	$(RUN_TESTS_ENV_VARS) $(DBUS_LAUNCH) $(EXEC_NAME) $(PYTHON) $(srcdir)/runtests.py
 
 check-pyflakes:
 	@echo "  CHECK Pyflakes"
diff --git a/tests/runtests.py b/tests/runtests.py
index fa58ede..28d5909 100755
--- a/tests/runtests.py
+++ b/tests/runtests.py
@@ -15,6 +15,13 @@ if '--help' in sys.argv:
 os.environ['LC_MESSAGES'] = 'C'
 os.environ['G_DEBUG'] = 'fatal-warnings fatal-criticals'
 
+# make Gio able to find our gschemas.compiled in tests/. This needs to be set
+# before importing Gio. Support a separate build tree, so look in build dir
+# first.
+os.environ['GSETTINGS_BACKEND'] = 'memory'
+os.environ['GSETTINGS_SCHEMA_DIR'] = os.environ.get('TESTS_BUILDDIR', 
+        os.path.dirname(__file__))
+
 # Load tests.
 if 'TEST_NAMES' in os.environ:
 	names = os.environ['TEST_NAMES'].split()
diff --git a/tests/test_overrides.py b/tests/test_overrides.py
index cec4d77..04d28de 100644
--- a/tests/test_overrides.py
+++ b/tests/test_overrides.py
@@ -4,16 +4,10 @@
 import unittest
 
 import sys
-import os
 sys.path.insert(0, "../")
 
 from compathelper import _long, _unicode, _bytes
 
-os.environ['GSETTINGS_BACKEND'] = 'memory'
-# support a separate build tree, so look in build dir first
-os.environ['GSETTINGS_SCHEMA_DIR'] = os.environ.get('TESTS_BUILDDIR', 
-        os.path.dirname(__file__))
-
 from gi.repository import GLib
 from gi.repository import GObject
 from gi.repository import Gdk



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]