diff options
author | Simon McVittie <smcv@debian.org> | 2010-12-02 17:28:33 +0000 |
---|---|---|
committer | Simon McVittie <smcv@debian.org> | 2010-12-02 17:28:33 +0000 |
commit | 28880468dddbb0e063d80dd003145a6322238507 (patch) | |
tree | f52124e6e169f2d5b3d1ed2389ce4857045dc33c | |
parent | d3f57baf2a9e5e26e2365313abd2890239b6572a (diff) | |
download | dbus-python-28880468dddbb0e063d80dd003145a6322238507.tar.gz |
Add a regression test for fd.o #23831
-rw-r--r-- | .gitignore | 2 | ||||
-rw-r--r-- | configure.ac | 4 | ||||
-rw-r--r-- | test/Makefile.am | 8 | ||||
-rw-r--r-- | test/import-repeatedly.c | 16 |
4 files changed, 29 insertions, 1 deletions
@@ -1,5 +1,6 @@ run-with-tmp-session-bus.conf test/data +*.o *.pyc *.pyo *.orig @@ -45,3 +46,4 @@ INSTALL /m4/ltsugar.m4 /m4/ltversion.m4 /m4/lt~obsolete.m4 +/test/test-import-repeatedly diff --git a/configure.ac b/configure.ac index c6cfd07..4d50669 100644 --- a/configure.ac +++ b/configure.ac @@ -44,6 +44,7 @@ dnl (copied from libglade/configure.in) m4_define([_LT_AC_TAGCONFIG],[]) AC_PROG_LIBTOOL +AM_PROG_CC_C_O AM_PATH_PYTHON(2.4.0) @@ -52,6 +53,9 @@ AM_CHECK_PYTHON_HEADERS(,[AC_MSG_ERROR(could not find Python headers)]) PLATFORM=`$PYTHON -c "from distutils import util; print util.get_platform()"` AC_SUBST(PLATFORM) +PYTHON_LIBS=`$PYTHON-config --ldflags` +AC_SUBST([PYTHON_LIBS]) + dnl Building documentation AC_MSG_CHECKING([whether you want to build HTML docs]) diff --git a/test/Makefile.am b/test/Makefile.am index a40c3d1..345d6da 100644 --- a/test/Makefile.am +++ b/test/Makefile.am @@ -37,7 +37,13 @@ TESTS_ENVIRONMENT = DBUS_TOP_SRCDIR="$(abs_top_srcdir)" \ PYTHONPATH="$(abs_top_builddir)/test/.libs:$(abs_top_srcdir):$(abs_top_srcdir)/test:$(abs_top_builddir)/_dbus_bindings/.libs:$(abs_top_builddir)/_dbus_glib_bindings/.libs" \ PYTHON='$(PYTHON)' -TESTS = run-test.sh +TESTS = run-test.sh test-import-repeatedly + +check_PROGRAMS = test-import-repeatedly + +test_import_repeatedly_SOURCES = import-repeatedly.c +test_import_repeatedly_CPPFLAGS = $(PYTHON_INCLUDES) +test_import_repeatedly_LDFLAGS = $(PYTHON_LIBS) cross-test-server: $(TESTS_ENVIRONMENT) $(PYTHON) $(top_srcdir)/test/cross-test-server.py diff --git a/test/import-repeatedly.c b/test/import-repeatedly.c new file mode 100644 index 0000000..4d177ed --- /dev/null +++ b/test/import-repeatedly.c @@ -0,0 +1,16 @@ +/* Regression test for https://bugs.freedesktop.org/show_bug.cgi?id=23831 */ + +#include <Python.h> + +int main(void) +{ + int i; + + for (i = 0; i < 100; ++i) { + Py_Initialize(); + PyRun_SimpleString("import dbus\n"); + Py_Finalize(); + } + + return 0; +} |