]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Issue #12141: Install a copy of template C module file so that
authorNed Deily <nad@acm.org>
Tue, 28 Jun 2011 07:39:19 +0000 (00:39 -0700)
committerNed Deily <nad@acm.org>
Tue, 28 Jun 2011 07:39:19 +0000 (00:39 -0700)
test_build_ext of test_distutils is no longer silently skipped when
run outside of a build directory.

Lib/distutils/tests/test_build_ext.py
Makefile.pre.in
Misc/NEWS

index 46dcb5ed5d39274e03032995a6d15bcf89e52b58..44fc980a3055f4aeb8c42f12c15853c847407c7c 100644 (file)
@@ -19,6 +19,11 @@ from test import test_support
 ALREADY_TESTED = False
 
 def _get_source_filename():
+    # use installed copy if available
+    tests_f = os.path.join(os.path.dirname(__file__), 'xxmodule.c')
+    if os.path.exists(tests_f):
+        return tests_f
+    # otherwise try using copy from build directory
     srcdir = sysconfig.get_config_var('srcdir')
     if srcdir is None:
         return os.path.join(sysconfig.project_base, 'Modules', 'xxmodule.c')
index ed0d116489bd6565a8b92f1da4ecfdb449dccd99..059d716606036bb82159a425e5b537b9979b2703 100644 (file)
@@ -869,7 +869,7 @@ LIBSUBDIRS= lib-tk lib-tk/test lib-tk/test/test_tkinter \
                unittest unittest/test \
                lib-old \
                curses pydoc_data $(MACHDEPS)
-libinstall:    build_all $(srcdir)/Lib/$(PLATDIR)
+libinstall:    build_all $(srcdir)/Lib/$(PLATDIR) $(srcdir)/Modules/xxmodule.c
        @for i in $(SCRIPTDIR) $(LIBDEST); \
        do \
                if test ! -d $(DESTDIR)$$i; then \
@@ -925,6 +925,10 @@ libinstall:        build_all $(srcdir)/Lib/$(PLATDIR)
                done; \
        done
        $(INSTALL_DATA) $(srcdir)/LICENSE $(DESTDIR)$(LIBDEST)/LICENSE.txt
+       if test -d $(DESTDIR)$(LIBDEST)/distutils/tests; then \
+               $(INSTALL_DATA) $(srcdir)/Modules/xxmodule.c \
+                       $(DESTDIR)$(LIBDEST)/distutils/tests ; \
+       fi
        PYTHONPATH=$(DESTDIR)$(LIBDEST)  $(RUNSHARED) \
                ./$(BUILDPYTHON) -Wi -tt $(DESTDIR)$(LIBDEST)/compileall.py \
                -d $(LIBDEST) -f \
index b1742b05a3f2422740dd451956b98625abdcf1ab..31bc0cdbf109f1ff9959cbd92cade68b8e29b299 100644 (file)
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -64,6 +64,10 @@ Build
 Tests
 -----
 
+- Issue #12141: Install a copy of template C module file so that
+  test_build_ext of test_distutils is no longer silently skipped when
+  run outside of a build directory.
+
 - Issue #8746: Add additional tests for os.chflags() and os.lchflags().
   Patch by Garrett Cooper.