Commit f312e6a4 authored by Tomeu Vizoso's avatar Tomeu Vizoso

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
parent 5f82e7d2
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 =
......
......@@ -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
......@@ -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:
......
......@@ -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:
......
......@@ -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:
......
......@@ -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)
......
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'))
......
......@@ -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)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment