[pygobject] Fix 'make distcheck'



commit f312e6a49505eca07815146cfbdb0e48e5b3b8a8
Author: Tomeu Vizoso <tomeu vizoso collabora co uk>
Date:   Wed Jun 23 15:42:29 2010 +0200

    Fix 'make distcheck'
    
     * Makefile.am: put the tests dir to the end
     * g*/Makefile.am: build the .so when running make check
     * tests/Makefile.am: Don't pass the src dir to runtests.py and
       remove (hopefully) unneeded cruft.
     * tests/common.py: Don't add the src dir to the python path
     * tests/runtests.py: Don't pass the src dir to common.py

 Makefile.am         |    4 +++-
 gi/Makefile.am      |    1 +
 gio/Makefile.am     |    1 +
 glib/Makefile.am    |    2 +-
 gobject/Makefile.am |    1 +
 tests/Makefile.am   |   17 ++---------------
 tests/common.py     |    3 +--
 tests/runtests.py   |   12 +++++-------
 8 files changed, 15 insertions(+), 26 deletions(-)
---
diff --git a/Makefile.am b/Makefile.am
index c5c6625..94bcf8e 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -1,12 +1,14 @@
 ACLOCAL_AMFLAGS = -I m4
 AUTOMAKE_OPTIONS = 1.7
 
-SUBDIRS = docs codegen glib gobject gio examples tests
+SUBDIRS = docs codegen glib gobject gio examples
 
 if ENABLE_INTROSPECTION
 SUBDIRS += gi
 endif
 
+SUBDIRS += tests
+
 PLATFORM_VERSION = 2.0
 
 CLEANFILES =
diff --git a/gi/Makefile.am b/gi/Makefile.am
index 191ee1b..1d2c0ea 100644
--- a/gi/Makefile.am
+++ b/gi/Makefile.am
@@ -62,6 +62,7 @@ _gi.so: _gi.la
 	rm -f $@ && $(LN_S) .libs/$@ $@
 
 all-local: _gi.so
+check-local: _gi.so
 clean-local:
 	rm -f _gi.so
 
diff --git a/gio/Makefile.am b/gio/Makefile.am
index a34fd19..6b3eb57 100644
--- a/gio/Makefile.am
+++ b/gio/Makefile.am
@@ -109,6 +109,7 @@ endif
 
 if BUILD_GIO
 all: $(pkgpyexec_LTLIBRARIES:.la=.so)
+check-local: $(pkgpyexec_LTLIBRARIES:.la=.so)
 clean-local:
 	rm -f $(pkgpyexec_LTLIBRARIES:.la=.so)
 .la.so:
diff --git a/glib/Makefile.am b/glib/Makefile.am
index d230da4..f1644a1 100644
--- a/glib/Makefile.am
+++ b/glib/Makefile.am
@@ -51,8 +51,8 @@ if PLATFORM_WIN32
 _glib_la_CFLAGS += -DPLATFORM_WIN32
 endif
 
-
 all: $(pyglib_LTLIBRARIES:.la=.so)
+check-local: $(pyglib_LTLIBRARIES:.la=.so)
 clean-local:
 	rm -f $(pyglib_LTLIBRARIES:.la=.so)
 .la.so:
diff --git a/gobject/Makefile.am b/gobject/Makefile.am
index aff1609..21523be 100644
--- a/gobject/Makefile.am
+++ b/gobject/Makefile.am
@@ -61,6 +61,7 @@ endif
 
 
 all: $(pygobject_LTLIBRARIES:.la=.so)
+check-local: $(pygobject_LTLIBRARIES:.la=.so)
 clean-local:
 	rm -f $(pygobject_LTLIBRARIES:.la=.so)
 .la.so:
diff --git a/tests/Makefile.am b/tests/Makefile.am
index 50770b2..d0b1ca1 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -46,21 +46,8 @@ endif
 testhelper.la: $(testhelper_la_OBJECTS) $(testhelper_la_DEPENDENCIES)
 	$(LINK) -rpath $(pkgpyexecdir) $(testhelper_la_LDFLAGS) $(testhelper_la_OBJECTS) $(testhelper_la_LIBADD) $(LIBS)
 
-check-local: $(top_srcdir)/glib/__init__.py $(top_srcdir)/gobject/__init__.py $(top_srcdir)/gio/__init__.py
-	@if test "$(top_builddir)" != "$(top_srcdir)"; then \
-	   cp $(top_srcdir)/glib/*.py $(top_builddir)/glib; \
-	   cp $(top_srcdir)/gobject/*.py $(top_builddir)/gobject; \
-	   cp $(top_srcdir)/gio/*.py $(top_builddir)/gio; \
-	fi
-	$(EXEC_NAME) $(PYTHON) $(srcdir)/runtests.py $(top_builddir) $(top_srcdir) $(tests)
-	@if test "$(top_builddir)" != "$(top_srcdir)"; then \
-	   rm -f $(top_builddir)/glib/*.py; \
-	   rm -f $(top_builddir)/gobject/*.py; \
-	   rm -f $(top_builddir)/gio/*.py; \
-	fi
-	@rm -fr $(top_builddir)/glib/*.pyc
-	@rm -fr $(top_builddir)/gobject/*.pyc
-	@rm -fr $(top_builddir)/gio/*.pyc
+check-local: $(LTLIBRARIES:.la=.so)
+	$(EXEC_NAME) $(PYTHON) $(srcdir)/runtests.py $(top_builddir) $(tests)
 
 all: $(LTLIBRARIES:.la=.so)
 
diff --git a/tests/common.py b/tests/common.py
index a6fa73d..1fbeba4 100644
--- a/tests/common.py
+++ b/tests/common.py
@@ -1,11 +1,10 @@
 import os
 import sys
 
-def importModules(buildDir, srcDir):
+def importModules(buildDir):
     # Be very careful when you change this code, it's
     # fragile and the order is really significant
 
-    sys.path.insert(0, srcDir)
     sys.path.insert(0, buildDir)
     sys.path.insert(0, os.path.join(buildDir, 'glib'))
     sys.path.insert(0, os.path.join(buildDir, 'gobject'))
diff --git a/tests/runtests.py b/tests/runtests.py
index 1c67d05..ea19df5 100644
--- a/tests/runtests.py
+++ b/tests/runtests.py
@@ -7,16 +7,14 @@ import unittest
 import common
 
 program = None
-if len(sys.argv) < 3:
-    raise ValueError('Need at least 3 parameters: runtests.py <build-dir> '
-                     '<src-dir> <test-module-1> <test-module-2> ...')
+if len(sys.argv) < 2:
+    raise ValueError('Need at least 2 parameters: runtests.py <build-dir> '
+                     '<test-module-1> <test-module-2> ...')
 
 buildDir = sys.argv[1]
-srcDir = sys.argv[2]
-files = sys.argv[3:]
+files = sys.argv[2:]
 
-common.importModules(buildDir=buildDir,
-                     srcDir=srcDir)
+common.importModules(buildDir=buildDir)
 
 dir = os.path.split(os.path.abspath(__file__))[0]
 os.chdir(dir)



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