summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNed Deily <nad@acm.org>2011-06-28 07:53:54 (GMT)
committerNed Deily <nad@acm.org>2011-06-28 07:53:54 (GMT)
commit4a1ec129996c730556ad9fe9d92062b4ba5dadfc (patch)
tree8301eb1425136fac8b657b816ef61316a13b6528
parent8b56c4b1b82898ffd7e6337c39068c93e21e8d31 (diff)
parent58f27b203c34ec81a14a8d73ce1d5fc5350946a9 (diff)
downloadcpython-4a1ec129996c730556ad9fe9d92062b4ba5dadfc.zip
cpython-4a1ec129996c730556ad9fe9d92062b4ba5dadfc.tar.gz
cpython-4a1ec129996c730556ad9fe9d92062b4ba5dadfc.tar.bz2
Issue #12141: Install copies of template C module file so that
test_build_ext of test_distutils and test_command_build_ext of test_packaging are no longer silently skipped when run outside of a build directory.
-rw-r--r--Lib/distutils/tests/test_build_ext.py5
-rw-r--r--Lib/packaging/tests/test_command_build_ext.py5
-rw-r--r--Makefile.pre.in10
-rw-r--r--Misc/NEWS5
4 files changed, 24 insertions, 1 deletions
diff --git a/Lib/distutils/tests/test_build_ext.py b/Lib/distutils/tests/test_build_ext.py
index a5b9700..d924f58 100644
--- a/Lib/distutils/tests/test_build_ext.py
+++ b/Lib/distutils/tests/test_build_ext.py
@@ -22,6 +22,11 @@ from test.support import run_unittest
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')
return os.path.join(srcdir, 'Modules', 'xxmodule.c')
diff --git a/Lib/packaging/tests/test_command_build_ext.py b/Lib/packaging/tests/test_command_build_ext.py
index 8f61ce4..ddf168f 100644
--- a/Lib/packaging/tests/test_command_build_ext.py
+++ b/Lib/packaging/tests/test_command_build_ext.py
@@ -14,6 +14,11 @@ from packaging.tests import support, unittest, verbose, unload
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')
return os.path.join(srcdir, 'Modules', 'xxmodule.c')
diff --git a/Makefile.pre.in b/Makefile.pre.in
index 8ed1590..99df1c1 100644
--- a/Makefile.pre.in
+++ b/Makefile.pre.in
@@ -982,7 +982,7 @@ LIBSUBDIRS= tkinter tkinter/test tkinter/test/test_tkinter \
multiprocessing multiprocessing/dummy \
unittest unittest/test \
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 \
@@ -1038,6 +1038,14 @@ 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
+ if test -d $(DESTDIR)$(LIBDEST)/packaging/tests; then \
+ $(INSTALL_DATA) $(srcdir)/Modules/xxmodule.c \
+ $(DESTDIR)$(LIBDEST)/packaging/tests ; \
+ fi
-PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
./$(BUILDPYTHON) -Wi $(DESTDIR)$(LIBDEST)/compileall.py \
-d $(LIBDEST) -f \
diff --git a/Misc/NEWS b/Misc/NEWS
index 7c97884..ae17169 100644
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -913,6 +913,11 @@ Extension Modules
Tests
-----
+- Issue #12141: Install copies of template C module file so that
+ test_build_ext of test_distutils and test_command_build_ext of
+ test_packaging are 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.