Merged revisions 63412,63445-63447,63449-63450,63452,63454,63459,63463,63465,63470,63483-63484,63496-63497,63499-63501,63530-63531,63540,63614 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk
........
r63412 | georg.brandl | 2008-05-17 19:57:01 +0200 (Sat, 17 May 2008) | 2 lines
#961805: fix Edit.text_modified().
........
r63445 | georg.brandl | 2008-05-18 10:52:59 +0200 (Sun, 18 May 2008) | 2 lines
GHOP #180 by Michael Schneider: add examples to the socketserver documentation.
........
r63446 | georg.brandl | 2008-05-18 11:12:20 +0200 (Sun, 18 May 2008) | 2 lines
GHOP #134, #171, #137: unit tests for the three HTTPServer modules.
........
r63447 | georg.brandl | 2008-05-18 12:39:26 +0200 (Sun, 18 May 2008) | 3 lines
Take namedtuple item names only from ascii_letters (this blew up on OSX),
and make sure there are no duplicate names.
........
r63449 | georg.brandl | 2008-05-18 13:46:51 +0200 (Sun, 18 May 2008) | 2 lines
GHOP #217: add support for compiling Python with coverage checking enabled.
........
r63450 | georg.brandl | 2008-05-18 13:52:36 +0200 (Sun, 18 May 2008) | 2 lines
GHOP #257: test distutils' build_ext command, written by Josip Dzolonga.
........
r63452 | georg.brandl | 2008-05-18 15:34:06 +0200 (Sun, 18 May 2008) | 2 lines
Add GHOP students.
........
r63454 | georg.brandl | 2008-05-18 18:32:48 +0200 (Sun, 18 May 2008) | 2 lines
GHOP #121: improve test_pydoc, by Benjamin Peterson.
........
r63459 | benjamin.peterson | 2008-05-18 22:48:07 +0200 (Sun, 18 May 2008) | 2 lines
bring test_pydoc up to my high standards (now that I have them)
........
r63463 | georg.brandl | 2008-05-18 23:10:19 +0200 (Sun, 18 May 2008) | 2 lines
Fix test_pyclbr after another platform-dependent function was added to urllib.
........
r63465 | benjamin.peterson | 2008-05-19 01:07:07 +0200 (Mon, 19 May 2008) | 2 lines
change some imports in tests so they will not be skipped in 3.0
........
r63470 | georg.brandl | 2008-05-19 18:47:25 +0200 (Mon, 19 May 2008) | 2 lines
test_httpservers has unpredictable refcount behavior.
........
r63483 | georg.brandl | 2008-05-20 08:15:36 +0200 (Tue, 20 May 2008) | 2 lines
Activate two more test cases in test_httpservers.
........
r63484 | georg.brandl | 2008-05-20 08:47:31 +0200 (Tue, 20 May 2008) | 2 lines
Argh, this is the *actual* test that works under Windows.
........
r63496 | georg.brandl | 2008-05-20 10:07:36 +0200 (Tue, 20 May 2008) | 2 lines
Improve diffing logic and output for test_pydoc.
........
r63497 | georg.brandl | 2008-05-20 10:10:03 +0200 (Tue, 20 May 2008) | 2 lines
Use inspect.getabsfile() to get the documented module's filename.
........
r63499 | georg.brandl | 2008-05-20 10:25:48 +0200 (Tue, 20 May 2008) | 3 lines
Patch #1775025: allow opening zipfile members via ZipInfo instances.
Patch by Graham Horler.
........
r63500 | georg.brandl | 2008-05-20 10:40:43 +0200 (Tue, 20 May 2008) | 2 lines
#2592: delegate nb_index and the floor/truediv slots in weakref.proxy.
........
r63501 | georg.brandl | 2008-05-20 10:48:34 +0200 (Tue, 20 May 2008) | 2 lines
#615772: raise a more explicit error from Tkinter.Misc.__contains__.
........
r63530 | benjamin.peterson | 2008-05-22 02:57:02 +0200 (Thu, 22 May 2008) | 2 lines
use more specific asserts in test_opcode
........
r63531 | benjamin.peterson | 2008-05-22 03:02:23 +0200 (Thu, 22 May 2008) | 2 lines
remove redundant invocation of json doctests
........
r63540 | benjamin.peterson | 2008-05-23 01:09:26 +0200 (Fri, 23 May 2008) | 3 lines
fix test_pydoc so it works on make installed Python installations
Also let it pass when invoked directly
........
r63614 | georg.brandl | 2008-05-25 10:07:37 +0200 (Sun, 25 May 2008) | 2 lines
#2959: allow multiple close() calls for GzipFile.
........
2008-05-25 15:19:30 -03:00
|
|
|
import sys
|
|
|
|
import os
|
|
|
|
from io import StringIO
|
2011-05-15 11:46:11 -03:00
|
|
|
import textwrap
|
Merged revisions 63412,63445-63447,63449-63450,63452,63454,63459,63463,63465,63470,63483-63484,63496-63497,63499-63501,63530-63531,63540,63614 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk
........
r63412 | georg.brandl | 2008-05-17 19:57:01 +0200 (Sat, 17 May 2008) | 2 lines
#961805: fix Edit.text_modified().
........
r63445 | georg.brandl | 2008-05-18 10:52:59 +0200 (Sun, 18 May 2008) | 2 lines
GHOP #180 by Michael Schneider: add examples to the socketserver documentation.
........
r63446 | georg.brandl | 2008-05-18 11:12:20 +0200 (Sun, 18 May 2008) | 2 lines
GHOP #134, #171, #137: unit tests for the three HTTPServer modules.
........
r63447 | georg.brandl | 2008-05-18 12:39:26 +0200 (Sun, 18 May 2008) | 3 lines
Take namedtuple item names only from ascii_letters (this blew up on OSX),
and make sure there are no duplicate names.
........
r63449 | georg.brandl | 2008-05-18 13:46:51 +0200 (Sun, 18 May 2008) | 2 lines
GHOP #217: add support for compiling Python with coverage checking enabled.
........
r63450 | georg.brandl | 2008-05-18 13:52:36 +0200 (Sun, 18 May 2008) | 2 lines
GHOP #257: test distutils' build_ext command, written by Josip Dzolonga.
........
r63452 | georg.brandl | 2008-05-18 15:34:06 +0200 (Sun, 18 May 2008) | 2 lines
Add GHOP students.
........
r63454 | georg.brandl | 2008-05-18 18:32:48 +0200 (Sun, 18 May 2008) | 2 lines
GHOP #121: improve test_pydoc, by Benjamin Peterson.
........
r63459 | benjamin.peterson | 2008-05-18 22:48:07 +0200 (Sun, 18 May 2008) | 2 lines
bring test_pydoc up to my high standards (now that I have them)
........
r63463 | georg.brandl | 2008-05-18 23:10:19 +0200 (Sun, 18 May 2008) | 2 lines
Fix test_pyclbr after another platform-dependent function was added to urllib.
........
r63465 | benjamin.peterson | 2008-05-19 01:07:07 +0200 (Mon, 19 May 2008) | 2 lines
change some imports in tests so they will not be skipped in 3.0
........
r63470 | georg.brandl | 2008-05-19 18:47:25 +0200 (Mon, 19 May 2008) | 2 lines
test_httpservers has unpredictable refcount behavior.
........
r63483 | georg.brandl | 2008-05-20 08:15:36 +0200 (Tue, 20 May 2008) | 2 lines
Activate two more test cases in test_httpservers.
........
r63484 | georg.brandl | 2008-05-20 08:47:31 +0200 (Tue, 20 May 2008) | 2 lines
Argh, this is the *actual* test that works under Windows.
........
r63496 | georg.brandl | 2008-05-20 10:07:36 +0200 (Tue, 20 May 2008) | 2 lines
Improve diffing logic and output for test_pydoc.
........
r63497 | georg.brandl | 2008-05-20 10:10:03 +0200 (Tue, 20 May 2008) | 2 lines
Use inspect.getabsfile() to get the documented module's filename.
........
r63499 | georg.brandl | 2008-05-20 10:25:48 +0200 (Tue, 20 May 2008) | 3 lines
Patch #1775025: allow opening zipfile members via ZipInfo instances.
Patch by Graham Horler.
........
r63500 | georg.brandl | 2008-05-20 10:40:43 +0200 (Tue, 20 May 2008) | 2 lines
#2592: delegate nb_index and the floor/truediv slots in weakref.proxy.
........
r63501 | georg.brandl | 2008-05-20 10:48:34 +0200 (Tue, 20 May 2008) | 2 lines
#615772: raise a more explicit error from Tkinter.Misc.__contains__.
........
r63530 | benjamin.peterson | 2008-05-22 02:57:02 +0200 (Thu, 22 May 2008) | 2 lines
use more specific asserts in test_opcode
........
r63531 | benjamin.peterson | 2008-05-22 03:02:23 +0200 (Thu, 22 May 2008) | 2 lines
remove redundant invocation of json doctests
........
r63540 | benjamin.peterson | 2008-05-23 01:09:26 +0200 (Fri, 23 May 2008) | 3 lines
fix test_pydoc so it works on make installed Python installations
Also let it pass when invoked directly
........
r63614 | georg.brandl | 2008-05-25 10:07:37 +0200 (Sun, 25 May 2008) | 2 lines
#2959: allow multiple close() calls for GzipFile.
........
2008-05-25 15:19:30 -03:00
|
|
|
|
2010-10-15 22:04:07 -03:00
|
|
|
from distutils.core import Distribution
|
Merged revisions 63412,63445-63447,63449-63450,63452,63454,63459,63463,63465,63470,63483-63484,63496-63497,63499-63501,63530-63531,63540,63614 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk
........
r63412 | georg.brandl | 2008-05-17 19:57:01 +0200 (Sat, 17 May 2008) | 2 lines
#961805: fix Edit.text_modified().
........
r63445 | georg.brandl | 2008-05-18 10:52:59 +0200 (Sun, 18 May 2008) | 2 lines
GHOP #180 by Michael Schneider: add examples to the socketserver documentation.
........
r63446 | georg.brandl | 2008-05-18 11:12:20 +0200 (Sun, 18 May 2008) | 2 lines
GHOP #134, #171, #137: unit tests for the three HTTPServer modules.
........
r63447 | georg.brandl | 2008-05-18 12:39:26 +0200 (Sun, 18 May 2008) | 3 lines
Take namedtuple item names only from ascii_letters (this blew up on OSX),
and make sure there are no duplicate names.
........
r63449 | georg.brandl | 2008-05-18 13:46:51 +0200 (Sun, 18 May 2008) | 2 lines
GHOP #217: add support for compiling Python with coverage checking enabled.
........
r63450 | georg.brandl | 2008-05-18 13:52:36 +0200 (Sun, 18 May 2008) | 2 lines
GHOP #257: test distutils' build_ext command, written by Josip Dzolonga.
........
r63452 | georg.brandl | 2008-05-18 15:34:06 +0200 (Sun, 18 May 2008) | 2 lines
Add GHOP students.
........
r63454 | georg.brandl | 2008-05-18 18:32:48 +0200 (Sun, 18 May 2008) | 2 lines
GHOP #121: improve test_pydoc, by Benjamin Peterson.
........
r63459 | benjamin.peterson | 2008-05-18 22:48:07 +0200 (Sun, 18 May 2008) | 2 lines
bring test_pydoc up to my high standards (now that I have them)
........
r63463 | georg.brandl | 2008-05-18 23:10:19 +0200 (Sun, 18 May 2008) | 2 lines
Fix test_pyclbr after another platform-dependent function was added to urllib.
........
r63465 | benjamin.peterson | 2008-05-19 01:07:07 +0200 (Mon, 19 May 2008) | 2 lines
change some imports in tests so they will not be skipped in 3.0
........
r63470 | georg.brandl | 2008-05-19 18:47:25 +0200 (Mon, 19 May 2008) | 2 lines
test_httpservers has unpredictable refcount behavior.
........
r63483 | georg.brandl | 2008-05-20 08:15:36 +0200 (Tue, 20 May 2008) | 2 lines
Activate two more test cases in test_httpservers.
........
r63484 | georg.brandl | 2008-05-20 08:47:31 +0200 (Tue, 20 May 2008) | 2 lines
Argh, this is the *actual* test that works under Windows.
........
r63496 | georg.brandl | 2008-05-20 10:07:36 +0200 (Tue, 20 May 2008) | 2 lines
Improve diffing logic and output for test_pydoc.
........
r63497 | georg.brandl | 2008-05-20 10:10:03 +0200 (Tue, 20 May 2008) | 2 lines
Use inspect.getabsfile() to get the documented module's filename.
........
r63499 | georg.brandl | 2008-05-20 10:25:48 +0200 (Tue, 20 May 2008) | 3 lines
Patch #1775025: allow opening zipfile members via ZipInfo instances.
Patch by Graham Horler.
........
r63500 | georg.brandl | 2008-05-20 10:40:43 +0200 (Tue, 20 May 2008) | 2 lines
#2592: delegate nb_index and the floor/truediv slots in weakref.proxy.
........
r63501 | georg.brandl | 2008-05-20 10:48:34 +0200 (Tue, 20 May 2008) | 2 lines
#615772: raise a more explicit error from Tkinter.Misc.__contains__.
........
r63530 | benjamin.peterson | 2008-05-22 02:57:02 +0200 (Thu, 22 May 2008) | 2 lines
use more specific asserts in test_opcode
........
r63531 | benjamin.peterson | 2008-05-22 03:02:23 +0200 (Thu, 22 May 2008) | 2 lines
remove redundant invocation of json doctests
........
r63540 | benjamin.peterson | 2008-05-23 01:09:26 +0200 (Fri, 23 May 2008) | 3 lines
fix test_pydoc so it works on make installed Python installations
Also let it pass when invoked directly
........
r63614 | georg.brandl | 2008-05-25 10:07:37 +0200 (Sun, 25 May 2008) | 2 lines
#2959: allow multiple close() calls for GzipFile.
........
2008-05-25 15:19:30 -03:00
|
|
|
from distutils.command.build_ext import build_ext
|
2010-07-22 09:50:05 -03:00
|
|
|
from distutils import sysconfig
|
2011-08-20 01:27:18 -03:00
|
|
|
from distutils.tests.support import (TempdirManager, LoggingSilencer,
|
2011-08-21 12:02:07 -03:00
|
|
|
copy_xxmodule_c, fixup_build_ext)
|
2009-03-31 19:37:55 -03:00
|
|
|
from distutils.extension import Extension
|
2010-10-15 22:04:07 -03:00
|
|
|
from distutils.errors import (
|
2011-06-28 23:43:15 -03:00
|
|
|
CompileError, DistutilsPlatformError, DistutilsSetupError,
|
|
|
|
UnknownFileError)
|
Merged revisions 63412,63445-63447,63449-63450,63452,63454,63459,63463,63465,63470,63483-63484,63496-63497,63499-63501,63530-63531,63540,63614 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk
........
r63412 | georg.brandl | 2008-05-17 19:57:01 +0200 (Sat, 17 May 2008) | 2 lines
#961805: fix Edit.text_modified().
........
r63445 | georg.brandl | 2008-05-18 10:52:59 +0200 (Sun, 18 May 2008) | 2 lines
GHOP #180 by Michael Schneider: add examples to the socketserver documentation.
........
r63446 | georg.brandl | 2008-05-18 11:12:20 +0200 (Sun, 18 May 2008) | 2 lines
GHOP #134, #171, #137: unit tests for the three HTTPServer modules.
........
r63447 | georg.brandl | 2008-05-18 12:39:26 +0200 (Sun, 18 May 2008) | 3 lines
Take namedtuple item names only from ascii_letters (this blew up on OSX),
and make sure there are no duplicate names.
........
r63449 | georg.brandl | 2008-05-18 13:46:51 +0200 (Sun, 18 May 2008) | 2 lines
GHOP #217: add support for compiling Python with coverage checking enabled.
........
r63450 | georg.brandl | 2008-05-18 13:52:36 +0200 (Sun, 18 May 2008) | 2 lines
GHOP #257: test distutils' build_ext command, written by Josip Dzolonga.
........
r63452 | georg.brandl | 2008-05-18 15:34:06 +0200 (Sun, 18 May 2008) | 2 lines
Add GHOP students.
........
r63454 | georg.brandl | 2008-05-18 18:32:48 +0200 (Sun, 18 May 2008) | 2 lines
GHOP #121: improve test_pydoc, by Benjamin Peterson.
........
r63459 | benjamin.peterson | 2008-05-18 22:48:07 +0200 (Sun, 18 May 2008) | 2 lines
bring test_pydoc up to my high standards (now that I have them)
........
r63463 | georg.brandl | 2008-05-18 23:10:19 +0200 (Sun, 18 May 2008) | 2 lines
Fix test_pyclbr after another platform-dependent function was added to urllib.
........
r63465 | benjamin.peterson | 2008-05-19 01:07:07 +0200 (Mon, 19 May 2008) | 2 lines
change some imports in tests so they will not be skipped in 3.0
........
r63470 | georg.brandl | 2008-05-19 18:47:25 +0200 (Mon, 19 May 2008) | 2 lines
test_httpservers has unpredictable refcount behavior.
........
r63483 | georg.brandl | 2008-05-20 08:15:36 +0200 (Tue, 20 May 2008) | 2 lines
Activate two more test cases in test_httpservers.
........
r63484 | georg.brandl | 2008-05-20 08:47:31 +0200 (Tue, 20 May 2008) | 2 lines
Argh, this is the *actual* test that works under Windows.
........
r63496 | georg.brandl | 2008-05-20 10:07:36 +0200 (Tue, 20 May 2008) | 2 lines
Improve diffing logic and output for test_pydoc.
........
r63497 | georg.brandl | 2008-05-20 10:10:03 +0200 (Tue, 20 May 2008) | 2 lines
Use inspect.getabsfile() to get the documented module's filename.
........
r63499 | georg.brandl | 2008-05-20 10:25:48 +0200 (Tue, 20 May 2008) | 3 lines
Patch #1775025: allow opening zipfile members via ZipInfo instances.
Patch by Graham Horler.
........
r63500 | georg.brandl | 2008-05-20 10:40:43 +0200 (Tue, 20 May 2008) | 2 lines
#2592: delegate nb_index and the floor/truediv slots in weakref.proxy.
........
r63501 | georg.brandl | 2008-05-20 10:48:34 +0200 (Tue, 20 May 2008) | 2 lines
#615772: raise a more explicit error from Tkinter.Misc.__contains__.
........
r63530 | benjamin.peterson | 2008-05-22 02:57:02 +0200 (Thu, 22 May 2008) | 2 lines
use more specific asserts in test_opcode
........
r63531 | benjamin.peterson | 2008-05-22 03:02:23 +0200 (Thu, 22 May 2008) | 2 lines
remove redundant invocation of json doctests
........
r63540 | benjamin.peterson | 2008-05-23 01:09:26 +0200 (Fri, 23 May 2008) | 3 lines
fix test_pydoc so it works on make installed Python installations
Also let it pass when invoked directly
........
r63614 | georg.brandl | 2008-05-25 10:07:37 +0200 (Sun, 25 May 2008) | 2 lines
#2959: allow multiple close() calls for GzipFile.
........
2008-05-25 15:19:30 -03:00
|
|
|
|
|
|
|
import unittest
|
|
|
|
from test import support
|
|
|
|
|
2008-11-25 17:21:32 -04:00
|
|
|
# http://bugs.python.org/issue4373
|
|
|
|
# Don't load the xx module more than once.
|
|
|
|
ALREADY_TESTED = False
|
|
|
|
|
2009-02-06 17:42:05 -04:00
|
|
|
|
2010-07-22 09:50:05 -03:00
|
|
|
class BuildExtTestCase(TempdirManager,
|
|
|
|
LoggingSilencer,
|
|
|
|
unittest.TestCase):
|
Merged revisions 63412,63445-63447,63449-63450,63452,63454,63459,63463,63465,63470,63483-63484,63496-63497,63499-63501,63530-63531,63540,63614 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk
........
r63412 | georg.brandl | 2008-05-17 19:57:01 +0200 (Sat, 17 May 2008) | 2 lines
#961805: fix Edit.text_modified().
........
r63445 | georg.brandl | 2008-05-18 10:52:59 +0200 (Sun, 18 May 2008) | 2 lines
GHOP #180 by Michael Schneider: add examples to the socketserver documentation.
........
r63446 | georg.brandl | 2008-05-18 11:12:20 +0200 (Sun, 18 May 2008) | 2 lines
GHOP #134, #171, #137: unit tests for the three HTTPServer modules.
........
r63447 | georg.brandl | 2008-05-18 12:39:26 +0200 (Sun, 18 May 2008) | 3 lines
Take namedtuple item names only from ascii_letters (this blew up on OSX),
and make sure there are no duplicate names.
........
r63449 | georg.brandl | 2008-05-18 13:46:51 +0200 (Sun, 18 May 2008) | 2 lines
GHOP #217: add support for compiling Python with coverage checking enabled.
........
r63450 | georg.brandl | 2008-05-18 13:52:36 +0200 (Sun, 18 May 2008) | 2 lines
GHOP #257: test distutils' build_ext command, written by Josip Dzolonga.
........
r63452 | georg.brandl | 2008-05-18 15:34:06 +0200 (Sun, 18 May 2008) | 2 lines
Add GHOP students.
........
r63454 | georg.brandl | 2008-05-18 18:32:48 +0200 (Sun, 18 May 2008) | 2 lines
GHOP #121: improve test_pydoc, by Benjamin Peterson.
........
r63459 | benjamin.peterson | 2008-05-18 22:48:07 +0200 (Sun, 18 May 2008) | 2 lines
bring test_pydoc up to my high standards (now that I have them)
........
r63463 | georg.brandl | 2008-05-18 23:10:19 +0200 (Sun, 18 May 2008) | 2 lines
Fix test_pyclbr after another platform-dependent function was added to urllib.
........
r63465 | benjamin.peterson | 2008-05-19 01:07:07 +0200 (Mon, 19 May 2008) | 2 lines
change some imports in tests so they will not be skipped in 3.0
........
r63470 | georg.brandl | 2008-05-19 18:47:25 +0200 (Mon, 19 May 2008) | 2 lines
test_httpservers has unpredictable refcount behavior.
........
r63483 | georg.brandl | 2008-05-20 08:15:36 +0200 (Tue, 20 May 2008) | 2 lines
Activate two more test cases in test_httpservers.
........
r63484 | georg.brandl | 2008-05-20 08:47:31 +0200 (Tue, 20 May 2008) | 2 lines
Argh, this is the *actual* test that works under Windows.
........
r63496 | georg.brandl | 2008-05-20 10:07:36 +0200 (Tue, 20 May 2008) | 2 lines
Improve diffing logic and output for test_pydoc.
........
r63497 | georg.brandl | 2008-05-20 10:10:03 +0200 (Tue, 20 May 2008) | 2 lines
Use inspect.getabsfile() to get the documented module's filename.
........
r63499 | georg.brandl | 2008-05-20 10:25:48 +0200 (Tue, 20 May 2008) | 3 lines
Patch #1775025: allow opening zipfile members via ZipInfo instances.
Patch by Graham Horler.
........
r63500 | georg.brandl | 2008-05-20 10:40:43 +0200 (Tue, 20 May 2008) | 2 lines
#2592: delegate nb_index and the floor/truediv slots in weakref.proxy.
........
r63501 | georg.brandl | 2008-05-20 10:48:34 +0200 (Tue, 20 May 2008) | 2 lines
#615772: raise a more explicit error from Tkinter.Misc.__contains__.
........
r63530 | benjamin.peterson | 2008-05-22 02:57:02 +0200 (Thu, 22 May 2008) | 2 lines
use more specific asserts in test_opcode
........
r63531 | benjamin.peterson | 2008-05-22 03:02:23 +0200 (Thu, 22 May 2008) | 2 lines
remove redundant invocation of json doctests
........
r63540 | benjamin.peterson | 2008-05-23 01:09:26 +0200 (Fri, 23 May 2008) | 3 lines
fix test_pydoc so it works on make installed Python installations
Also let it pass when invoked directly
........
r63614 | georg.brandl | 2008-05-25 10:07:37 +0200 (Sun, 25 May 2008) | 2 lines
#2959: allow multiple close() calls for GzipFile.
........
2008-05-25 15:19:30 -03:00
|
|
|
def setUp(self):
|
|
|
|
# Create a simple test environment
|
|
|
|
# Note that we're making changes to sys.path
|
2009-02-27 08:58:56 -04:00
|
|
|
super(BuildExtTestCase, self).setUp()
|
2009-02-14 10:35:51 -04:00
|
|
|
self.tmp_dir = self.mkdtemp()
|
2010-07-22 09:50:05 -03:00
|
|
|
self.sys_path = sys.path, sys.path[:]
|
|
|
|
sys.path.append(self.tmp_dir)
|
2009-02-27 08:58:56 -04:00
|
|
|
if sys.version > "2.6":
|
|
|
|
import site
|
|
|
|
self.old_user_base = site.USER_BASE
|
|
|
|
site.USER_BASE = self.mkdtemp()
|
|
|
|
from distutils.command import build_ext
|
|
|
|
build_ext.USER_BASE = site.USER_BASE
|
Merged revisions 63412,63445-63447,63449-63450,63452,63454,63459,63463,63465,63470,63483-63484,63496-63497,63499-63501,63530-63531,63540,63614 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk
........
r63412 | georg.brandl | 2008-05-17 19:57:01 +0200 (Sat, 17 May 2008) | 2 lines
#961805: fix Edit.text_modified().
........
r63445 | georg.brandl | 2008-05-18 10:52:59 +0200 (Sun, 18 May 2008) | 2 lines
GHOP #180 by Michael Schneider: add examples to the socketserver documentation.
........
r63446 | georg.brandl | 2008-05-18 11:12:20 +0200 (Sun, 18 May 2008) | 2 lines
GHOP #134, #171, #137: unit tests for the three HTTPServer modules.
........
r63447 | georg.brandl | 2008-05-18 12:39:26 +0200 (Sun, 18 May 2008) | 3 lines
Take namedtuple item names only from ascii_letters (this blew up on OSX),
and make sure there are no duplicate names.
........
r63449 | georg.brandl | 2008-05-18 13:46:51 +0200 (Sun, 18 May 2008) | 2 lines
GHOP #217: add support for compiling Python with coverage checking enabled.
........
r63450 | georg.brandl | 2008-05-18 13:52:36 +0200 (Sun, 18 May 2008) | 2 lines
GHOP #257: test distutils' build_ext command, written by Josip Dzolonga.
........
r63452 | georg.brandl | 2008-05-18 15:34:06 +0200 (Sun, 18 May 2008) | 2 lines
Add GHOP students.
........
r63454 | georg.brandl | 2008-05-18 18:32:48 +0200 (Sun, 18 May 2008) | 2 lines
GHOP #121: improve test_pydoc, by Benjamin Peterson.
........
r63459 | benjamin.peterson | 2008-05-18 22:48:07 +0200 (Sun, 18 May 2008) | 2 lines
bring test_pydoc up to my high standards (now that I have them)
........
r63463 | georg.brandl | 2008-05-18 23:10:19 +0200 (Sun, 18 May 2008) | 2 lines
Fix test_pyclbr after another platform-dependent function was added to urllib.
........
r63465 | benjamin.peterson | 2008-05-19 01:07:07 +0200 (Mon, 19 May 2008) | 2 lines
change some imports in tests so they will not be skipped in 3.0
........
r63470 | georg.brandl | 2008-05-19 18:47:25 +0200 (Mon, 19 May 2008) | 2 lines
test_httpservers has unpredictable refcount behavior.
........
r63483 | georg.brandl | 2008-05-20 08:15:36 +0200 (Tue, 20 May 2008) | 2 lines
Activate two more test cases in test_httpservers.
........
r63484 | georg.brandl | 2008-05-20 08:47:31 +0200 (Tue, 20 May 2008) | 2 lines
Argh, this is the *actual* test that works under Windows.
........
r63496 | georg.brandl | 2008-05-20 10:07:36 +0200 (Tue, 20 May 2008) | 2 lines
Improve diffing logic and output for test_pydoc.
........
r63497 | georg.brandl | 2008-05-20 10:10:03 +0200 (Tue, 20 May 2008) | 2 lines
Use inspect.getabsfile() to get the documented module's filename.
........
r63499 | georg.brandl | 2008-05-20 10:25:48 +0200 (Tue, 20 May 2008) | 3 lines
Patch #1775025: allow opening zipfile members via ZipInfo instances.
Patch by Graham Horler.
........
r63500 | georg.brandl | 2008-05-20 10:40:43 +0200 (Tue, 20 May 2008) | 2 lines
#2592: delegate nb_index and the floor/truediv slots in weakref.proxy.
........
r63501 | georg.brandl | 2008-05-20 10:48:34 +0200 (Tue, 20 May 2008) | 2 lines
#615772: raise a more explicit error from Tkinter.Misc.__contains__.
........
r63530 | benjamin.peterson | 2008-05-22 02:57:02 +0200 (Thu, 22 May 2008) | 2 lines
use more specific asserts in test_opcode
........
r63531 | benjamin.peterson | 2008-05-22 03:02:23 +0200 (Thu, 22 May 2008) | 2 lines
remove redundant invocation of json doctests
........
r63540 | benjamin.peterson | 2008-05-23 01:09:26 +0200 (Fri, 23 May 2008) | 3 lines
fix test_pydoc so it works on make installed Python installations
Also let it pass when invoked directly
........
r63614 | georg.brandl | 2008-05-25 10:07:37 +0200 (Sun, 25 May 2008) | 2 lines
#2959: allow multiple close() calls for GzipFile.
........
2008-05-25 15:19:30 -03:00
|
|
|
|
|
|
|
def test_build_ext(self):
|
2008-11-25 17:21:32 -04:00
|
|
|
global ALREADY_TESTED
|
2011-08-20 01:27:18 -03:00
|
|
|
copy_xxmodule_c(self.tmp_dir)
|
Merged revisions 63412,63445-63447,63449-63450,63452,63454,63459,63463,63465,63470,63483-63484,63496-63497,63499-63501,63530-63531,63540,63614 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk
........
r63412 | georg.brandl | 2008-05-17 19:57:01 +0200 (Sat, 17 May 2008) | 2 lines
#961805: fix Edit.text_modified().
........
r63445 | georg.brandl | 2008-05-18 10:52:59 +0200 (Sun, 18 May 2008) | 2 lines
GHOP #180 by Michael Schneider: add examples to the socketserver documentation.
........
r63446 | georg.brandl | 2008-05-18 11:12:20 +0200 (Sun, 18 May 2008) | 2 lines
GHOP #134, #171, #137: unit tests for the three HTTPServer modules.
........
r63447 | georg.brandl | 2008-05-18 12:39:26 +0200 (Sun, 18 May 2008) | 3 lines
Take namedtuple item names only from ascii_letters (this blew up on OSX),
and make sure there are no duplicate names.
........
r63449 | georg.brandl | 2008-05-18 13:46:51 +0200 (Sun, 18 May 2008) | 2 lines
GHOP #217: add support for compiling Python with coverage checking enabled.
........
r63450 | georg.brandl | 2008-05-18 13:52:36 +0200 (Sun, 18 May 2008) | 2 lines
GHOP #257: test distutils' build_ext command, written by Josip Dzolonga.
........
r63452 | georg.brandl | 2008-05-18 15:34:06 +0200 (Sun, 18 May 2008) | 2 lines
Add GHOP students.
........
r63454 | georg.brandl | 2008-05-18 18:32:48 +0200 (Sun, 18 May 2008) | 2 lines
GHOP #121: improve test_pydoc, by Benjamin Peterson.
........
r63459 | benjamin.peterson | 2008-05-18 22:48:07 +0200 (Sun, 18 May 2008) | 2 lines
bring test_pydoc up to my high standards (now that I have them)
........
r63463 | georg.brandl | 2008-05-18 23:10:19 +0200 (Sun, 18 May 2008) | 2 lines
Fix test_pyclbr after another platform-dependent function was added to urllib.
........
r63465 | benjamin.peterson | 2008-05-19 01:07:07 +0200 (Mon, 19 May 2008) | 2 lines
change some imports in tests so they will not be skipped in 3.0
........
r63470 | georg.brandl | 2008-05-19 18:47:25 +0200 (Mon, 19 May 2008) | 2 lines
test_httpservers has unpredictable refcount behavior.
........
r63483 | georg.brandl | 2008-05-20 08:15:36 +0200 (Tue, 20 May 2008) | 2 lines
Activate two more test cases in test_httpservers.
........
r63484 | georg.brandl | 2008-05-20 08:47:31 +0200 (Tue, 20 May 2008) | 2 lines
Argh, this is the *actual* test that works under Windows.
........
r63496 | georg.brandl | 2008-05-20 10:07:36 +0200 (Tue, 20 May 2008) | 2 lines
Improve diffing logic and output for test_pydoc.
........
r63497 | georg.brandl | 2008-05-20 10:10:03 +0200 (Tue, 20 May 2008) | 2 lines
Use inspect.getabsfile() to get the documented module's filename.
........
r63499 | georg.brandl | 2008-05-20 10:25:48 +0200 (Tue, 20 May 2008) | 3 lines
Patch #1775025: allow opening zipfile members via ZipInfo instances.
Patch by Graham Horler.
........
r63500 | georg.brandl | 2008-05-20 10:40:43 +0200 (Tue, 20 May 2008) | 2 lines
#2592: delegate nb_index and the floor/truediv slots in weakref.proxy.
........
r63501 | georg.brandl | 2008-05-20 10:48:34 +0200 (Tue, 20 May 2008) | 2 lines
#615772: raise a more explicit error from Tkinter.Misc.__contains__.
........
r63530 | benjamin.peterson | 2008-05-22 02:57:02 +0200 (Thu, 22 May 2008) | 2 lines
use more specific asserts in test_opcode
........
r63531 | benjamin.peterson | 2008-05-22 03:02:23 +0200 (Thu, 22 May 2008) | 2 lines
remove redundant invocation of json doctests
........
r63540 | benjamin.peterson | 2008-05-23 01:09:26 +0200 (Fri, 23 May 2008) | 3 lines
fix test_pydoc so it works on make installed Python installations
Also let it pass when invoked directly
........
r63614 | georg.brandl | 2008-05-25 10:07:37 +0200 (Sun, 25 May 2008) | 2 lines
#2959: allow multiple close() calls for GzipFile.
........
2008-05-25 15:19:30 -03:00
|
|
|
xx_c = os.path.join(self.tmp_dir, 'xxmodule.c')
|
|
|
|
xx_ext = Extension('xx', [xx_c])
|
|
|
|
dist = Distribution({'name': 'xx', 'ext_modules': [xx_ext]})
|
|
|
|
dist.package_dir = self.tmp_dir
|
|
|
|
cmd = build_ext(dist)
|
2011-08-21 12:02:07 -03:00
|
|
|
fixup_build_ext(cmd)
|
Merged revisions 63412,63445-63447,63449-63450,63452,63454,63459,63463,63465,63470,63483-63484,63496-63497,63499-63501,63530-63531,63540,63614 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk
........
r63412 | georg.brandl | 2008-05-17 19:57:01 +0200 (Sat, 17 May 2008) | 2 lines
#961805: fix Edit.text_modified().
........
r63445 | georg.brandl | 2008-05-18 10:52:59 +0200 (Sun, 18 May 2008) | 2 lines
GHOP #180 by Michael Schneider: add examples to the socketserver documentation.
........
r63446 | georg.brandl | 2008-05-18 11:12:20 +0200 (Sun, 18 May 2008) | 2 lines
GHOP #134, #171, #137: unit tests for the three HTTPServer modules.
........
r63447 | georg.brandl | 2008-05-18 12:39:26 +0200 (Sun, 18 May 2008) | 3 lines
Take namedtuple item names only from ascii_letters (this blew up on OSX),
and make sure there are no duplicate names.
........
r63449 | georg.brandl | 2008-05-18 13:46:51 +0200 (Sun, 18 May 2008) | 2 lines
GHOP #217: add support for compiling Python with coverage checking enabled.
........
r63450 | georg.brandl | 2008-05-18 13:52:36 +0200 (Sun, 18 May 2008) | 2 lines
GHOP #257: test distutils' build_ext command, written by Josip Dzolonga.
........
r63452 | georg.brandl | 2008-05-18 15:34:06 +0200 (Sun, 18 May 2008) | 2 lines
Add GHOP students.
........
r63454 | georg.brandl | 2008-05-18 18:32:48 +0200 (Sun, 18 May 2008) | 2 lines
GHOP #121: improve test_pydoc, by Benjamin Peterson.
........
r63459 | benjamin.peterson | 2008-05-18 22:48:07 +0200 (Sun, 18 May 2008) | 2 lines
bring test_pydoc up to my high standards (now that I have them)
........
r63463 | georg.brandl | 2008-05-18 23:10:19 +0200 (Sun, 18 May 2008) | 2 lines
Fix test_pyclbr after another platform-dependent function was added to urllib.
........
r63465 | benjamin.peterson | 2008-05-19 01:07:07 +0200 (Mon, 19 May 2008) | 2 lines
change some imports in tests so they will not be skipped in 3.0
........
r63470 | georg.brandl | 2008-05-19 18:47:25 +0200 (Mon, 19 May 2008) | 2 lines
test_httpservers has unpredictable refcount behavior.
........
r63483 | georg.brandl | 2008-05-20 08:15:36 +0200 (Tue, 20 May 2008) | 2 lines
Activate two more test cases in test_httpservers.
........
r63484 | georg.brandl | 2008-05-20 08:47:31 +0200 (Tue, 20 May 2008) | 2 lines
Argh, this is the *actual* test that works under Windows.
........
r63496 | georg.brandl | 2008-05-20 10:07:36 +0200 (Tue, 20 May 2008) | 2 lines
Improve diffing logic and output for test_pydoc.
........
r63497 | georg.brandl | 2008-05-20 10:10:03 +0200 (Tue, 20 May 2008) | 2 lines
Use inspect.getabsfile() to get the documented module's filename.
........
r63499 | georg.brandl | 2008-05-20 10:25:48 +0200 (Tue, 20 May 2008) | 3 lines
Patch #1775025: allow opening zipfile members via ZipInfo instances.
Patch by Graham Horler.
........
r63500 | georg.brandl | 2008-05-20 10:40:43 +0200 (Tue, 20 May 2008) | 2 lines
#2592: delegate nb_index and the floor/truediv slots in weakref.proxy.
........
r63501 | georg.brandl | 2008-05-20 10:48:34 +0200 (Tue, 20 May 2008) | 2 lines
#615772: raise a more explicit error from Tkinter.Misc.__contains__.
........
r63530 | benjamin.peterson | 2008-05-22 02:57:02 +0200 (Thu, 22 May 2008) | 2 lines
use more specific asserts in test_opcode
........
r63531 | benjamin.peterson | 2008-05-22 03:02:23 +0200 (Thu, 22 May 2008) | 2 lines
remove redundant invocation of json doctests
........
r63540 | benjamin.peterson | 2008-05-23 01:09:26 +0200 (Fri, 23 May 2008) | 3 lines
fix test_pydoc so it works on make installed Python installations
Also let it pass when invoked directly
........
r63614 | georg.brandl | 2008-05-25 10:07:37 +0200 (Sun, 25 May 2008) | 2 lines
#2959: allow multiple close() calls for GzipFile.
........
2008-05-25 15:19:30 -03:00
|
|
|
cmd.build_lib = self.tmp_dir
|
|
|
|
cmd.build_temp = self.tmp_dir
|
|
|
|
|
|
|
|
old_stdout = sys.stdout
|
|
|
|
if not support.verbose:
|
|
|
|
# silence compiler output
|
|
|
|
sys.stdout = StringIO()
|
|
|
|
try:
|
|
|
|
cmd.ensure_finalized()
|
|
|
|
cmd.run()
|
|
|
|
finally:
|
|
|
|
sys.stdout = old_stdout
|
|
|
|
|
2008-11-25 17:21:32 -04:00
|
|
|
if ALREADY_TESTED:
|
2013-12-18 10:41:01 -04:00
|
|
|
self.skipTest('Already tested in %s' % ALREADY_TESTED)
|
2008-11-25 17:21:32 -04:00
|
|
|
else:
|
2013-12-18 10:41:01 -04:00
|
|
|
ALREADY_TESTED = type(self).__name__
|
2008-11-25 17:21:32 -04:00
|
|
|
|
Merged revisions 63412,63445-63447,63449-63450,63452,63454,63459,63463,63465,63470,63483-63484,63496-63497,63499-63501,63530-63531,63540,63614 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk
........
r63412 | georg.brandl | 2008-05-17 19:57:01 +0200 (Sat, 17 May 2008) | 2 lines
#961805: fix Edit.text_modified().
........
r63445 | georg.brandl | 2008-05-18 10:52:59 +0200 (Sun, 18 May 2008) | 2 lines
GHOP #180 by Michael Schneider: add examples to the socketserver documentation.
........
r63446 | georg.brandl | 2008-05-18 11:12:20 +0200 (Sun, 18 May 2008) | 2 lines
GHOP #134, #171, #137: unit tests for the three HTTPServer modules.
........
r63447 | georg.brandl | 2008-05-18 12:39:26 +0200 (Sun, 18 May 2008) | 3 lines
Take namedtuple item names only from ascii_letters (this blew up on OSX),
and make sure there are no duplicate names.
........
r63449 | georg.brandl | 2008-05-18 13:46:51 +0200 (Sun, 18 May 2008) | 2 lines
GHOP #217: add support for compiling Python with coverage checking enabled.
........
r63450 | georg.brandl | 2008-05-18 13:52:36 +0200 (Sun, 18 May 2008) | 2 lines
GHOP #257: test distutils' build_ext command, written by Josip Dzolonga.
........
r63452 | georg.brandl | 2008-05-18 15:34:06 +0200 (Sun, 18 May 2008) | 2 lines
Add GHOP students.
........
r63454 | georg.brandl | 2008-05-18 18:32:48 +0200 (Sun, 18 May 2008) | 2 lines
GHOP #121: improve test_pydoc, by Benjamin Peterson.
........
r63459 | benjamin.peterson | 2008-05-18 22:48:07 +0200 (Sun, 18 May 2008) | 2 lines
bring test_pydoc up to my high standards (now that I have them)
........
r63463 | georg.brandl | 2008-05-18 23:10:19 +0200 (Sun, 18 May 2008) | 2 lines
Fix test_pyclbr after another platform-dependent function was added to urllib.
........
r63465 | benjamin.peterson | 2008-05-19 01:07:07 +0200 (Mon, 19 May 2008) | 2 lines
change some imports in tests so they will not be skipped in 3.0
........
r63470 | georg.brandl | 2008-05-19 18:47:25 +0200 (Mon, 19 May 2008) | 2 lines
test_httpservers has unpredictable refcount behavior.
........
r63483 | georg.brandl | 2008-05-20 08:15:36 +0200 (Tue, 20 May 2008) | 2 lines
Activate two more test cases in test_httpservers.
........
r63484 | georg.brandl | 2008-05-20 08:47:31 +0200 (Tue, 20 May 2008) | 2 lines
Argh, this is the *actual* test that works under Windows.
........
r63496 | georg.brandl | 2008-05-20 10:07:36 +0200 (Tue, 20 May 2008) | 2 lines
Improve diffing logic and output for test_pydoc.
........
r63497 | georg.brandl | 2008-05-20 10:10:03 +0200 (Tue, 20 May 2008) | 2 lines
Use inspect.getabsfile() to get the documented module's filename.
........
r63499 | georg.brandl | 2008-05-20 10:25:48 +0200 (Tue, 20 May 2008) | 3 lines
Patch #1775025: allow opening zipfile members via ZipInfo instances.
Patch by Graham Horler.
........
r63500 | georg.brandl | 2008-05-20 10:40:43 +0200 (Tue, 20 May 2008) | 2 lines
#2592: delegate nb_index and the floor/truediv slots in weakref.proxy.
........
r63501 | georg.brandl | 2008-05-20 10:48:34 +0200 (Tue, 20 May 2008) | 2 lines
#615772: raise a more explicit error from Tkinter.Misc.__contains__.
........
r63530 | benjamin.peterson | 2008-05-22 02:57:02 +0200 (Thu, 22 May 2008) | 2 lines
use more specific asserts in test_opcode
........
r63531 | benjamin.peterson | 2008-05-22 03:02:23 +0200 (Thu, 22 May 2008) | 2 lines
remove redundant invocation of json doctests
........
r63540 | benjamin.peterson | 2008-05-23 01:09:26 +0200 (Fri, 23 May 2008) | 3 lines
fix test_pydoc so it works on make installed Python installations
Also let it pass when invoked directly
........
r63614 | georg.brandl | 2008-05-25 10:07:37 +0200 (Sun, 25 May 2008) | 2 lines
#2959: allow multiple close() calls for GzipFile.
........
2008-05-25 15:19:30 -03:00
|
|
|
import xx
|
|
|
|
|
|
|
|
for attr in ('error', 'foo', 'new', 'roj'):
|
2009-06-30 20:06:06 -03:00
|
|
|
self.assertTrue(hasattr(xx, attr))
|
Merged revisions 63412,63445-63447,63449-63450,63452,63454,63459,63463,63465,63470,63483-63484,63496-63497,63499-63501,63530-63531,63540,63614 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk
........
r63412 | georg.brandl | 2008-05-17 19:57:01 +0200 (Sat, 17 May 2008) | 2 lines
#961805: fix Edit.text_modified().
........
r63445 | georg.brandl | 2008-05-18 10:52:59 +0200 (Sun, 18 May 2008) | 2 lines
GHOP #180 by Michael Schneider: add examples to the socketserver documentation.
........
r63446 | georg.brandl | 2008-05-18 11:12:20 +0200 (Sun, 18 May 2008) | 2 lines
GHOP #134, #171, #137: unit tests for the three HTTPServer modules.
........
r63447 | georg.brandl | 2008-05-18 12:39:26 +0200 (Sun, 18 May 2008) | 3 lines
Take namedtuple item names only from ascii_letters (this blew up on OSX),
and make sure there are no duplicate names.
........
r63449 | georg.brandl | 2008-05-18 13:46:51 +0200 (Sun, 18 May 2008) | 2 lines
GHOP #217: add support for compiling Python with coverage checking enabled.
........
r63450 | georg.brandl | 2008-05-18 13:52:36 +0200 (Sun, 18 May 2008) | 2 lines
GHOP #257: test distutils' build_ext command, written by Josip Dzolonga.
........
r63452 | georg.brandl | 2008-05-18 15:34:06 +0200 (Sun, 18 May 2008) | 2 lines
Add GHOP students.
........
r63454 | georg.brandl | 2008-05-18 18:32:48 +0200 (Sun, 18 May 2008) | 2 lines
GHOP #121: improve test_pydoc, by Benjamin Peterson.
........
r63459 | benjamin.peterson | 2008-05-18 22:48:07 +0200 (Sun, 18 May 2008) | 2 lines
bring test_pydoc up to my high standards (now that I have them)
........
r63463 | georg.brandl | 2008-05-18 23:10:19 +0200 (Sun, 18 May 2008) | 2 lines
Fix test_pyclbr after another platform-dependent function was added to urllib.
........
r63465 | benjamin.peterson | 2008-05-19 01:07:07 +0200 (Mon, 19 May 2008) | 2 lines
change some imports in tests so they will not be skipped in 3.0
........
r63470 | georg.brandl | 2008-05-19 18:47:25 +0200 (Mon, 19 May 2008) | 2 lines
test_httpservers has unpredictable refcount behavior.
........
r63483 | georg.brandl | 2008-05-20 08:15:36 +0200 (Tue, 20 May 2008) | 2 lines
Activate two more test cases in test_httpservers.
........
r63484 | georg.brandl | 2008-05-20 08:47:31 +0200 (Tue, 20 May 2008) | 2 lines
Argh, this is the *actual* test that works under Windows.
........
r63496 | georg.brandl | 2008-05-20 10:07:36 +0200 (Tue, 20 May 2008) | 2 lines
Improve diffing logic and output for test_pydoc.
........
r63497 | georg.brandl | 2008-05-20 10:10:03 +0200 (Tue, 20 May 2008) | 2 lines
Use inspect.getabsfile() to get the documented module's filename.
........
r63499 | georg.brandl | 2008-05-20 10:25:48 +0200 (Tue, 20 May 2008) | 3 lines
Patch #1775025: allow opening zipfile members via ZipInfo instances.
Patch by Graham Horler.
........
r63500 | georg.brandl | 2008-05-20 10:40:43 +0200 (Tue, 20 May 2008) | 2 lines
#2592: delegate nb_index and the floor/truediv slots in weakref.proxy.
........
r63501 | georg.brandl | 2008-05-20 10:48:34 +0200 (Tue, 20 May 2008) | 2 lines
#615772: raise a more explicit error from Tkinter.Misc.__contains__.
........
r63530 | benjamin.peterson | 2008-05-22 02:57:02 +0200 (Thu, 22 May 2008) | 2 lines
use more specific asserts in test_opcode
........
r63531 | benjamin.peterson | 2008-05-22 03:02:23 +0200 (Thu, 22 May 2008) | 2 lines
remove redundant invocation of json doctests
........
r63540 | benjamin.peterson | 2008-05-23 01:09:26 +0200 (Fri, 23 May 2008) | 3 lines
fix test_pydoc so it works on make installed Python installations
Also let it pass when invoked directly
........
r63614 | georg.brandl | 2008-05-25 10:07:37 +0200 (Sun, 25 May 2008) | 2 lines
#2959: allow multiple close() calls for GzipFile.
........
2008-05-25 15:19:30 -03:00
|
|
|
|
2010-11-20 15:04:17 -04:00
|
|
|
self.assertEqual(xx.foo(2, 5), 7)
|
|
|
|
self.assertEqual(xx.foo(13,15), 28)
|
|
|
|
self.assertEqual(xx.new().demo(), None)
|
2013-01-27 13:47:45 -04:00
|
|
|
if support.HAVE_DOCSTRINGS:
|
|
|
|
doc = 'This is a template module just for instruction.'
|
|
|
|
self.assertEqual(xx.__doc__, doc)
|
2013-11-16 18:17:46 -04:00
|
|
|
self.assertIsInstance(xx.Null(), xx.Null)
|
|
|
|
self.assertIsInstance(xx.Str(), xx.Str)
|
Merged revisions 63412,63445-63447,63449-63450,63452,63454,63459,63463,63465,63470,63483-63484,63496-63497,63499-63501,63530-63531,63540,63614 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk
........
r63412 | georg.brandl | 2008-05-17 19:57:01 +0200 (Sat, 17 May 2008) | 2 lines
#961805: fix Edit.text_modified().
........
r63445 | georg.brandl | 2008-05-18 10:52:59 +0200 (Sun, 18 May 2008) | 2 lines
GHOP #180 by Michael Schneider: add examples to the socketserver documentation.
........
r63446 | georg.brandl | 2008-05-18 11:12:20 +0200 (Sun, 18 May 2008) | 2 lines
GHOP #134, #171, #137: unit tests for the three HTTPServer modules.
........
r63447 | georg.brandl | 2008-05-18 12:39:26 +0200 (Sun, 18 May 2008) | 3 lines
Take namedtuple item names only from ascii_letters (this blew up on OSX),
and make sure there are no duplicate names.
........
r63449 | georg.brandl | 2008-05-18 13:46:51 +0200 (Sun, 18 May 2008) | 2 lines
GHOP #217: add support for compiling Python with coverage checking enabled.
........
r63450 | georg.brandl | 2008-05-18 13:52:36 +0200 (Sun, 18 May 2008) | 2 lines
GHOP #257: test distutils' build_ext command, written by Josip Dzolonga.
........
r63452 | georg.brandl | 2008-05-18 15:34:06 +0200 (Sun, 18 May 2008) | 2 lines
Add GHOP students.
........
r63454 | georg.brandl | 2008-05-18 18:32:48 +0200 (Sun, 18 May 2008) | 2 lines
GHOP #121: improve test_pydoc, by Benjamin Peterson.
........
r63459 | benjamin.peterson | 2008-05-18 22:48:07 +0200 (Sun, 18 May 2008) | 2 lines
bring test_pydoc up to my high standards (now that I have them)
........
r63463 | georg.brandl | 2008-05-18 23:10:19 +0200 (Sun, 18 May 2008) | 2 lines
Fix test_pyclbr after another platform-dependent function was added to urllib.
........
r63465 | benjamin.peterson | 2008-05-19 01:07:07 +0200 (Mon, 19 May 2008) | 2 lines
change some imports in tests so they will not be skipped in 3.0
........
r63470 | georg.brandl | 2008-05-19 18:47:25 +0200 (Mon, 19 May 2008) | 2 lines
test_httpservers has unpredictable refcount behavior.
........
r63483 | georg.brandl | 2008-05-20 08:15:36 +0200 (Tue, 20 May 2008) | 2 lines
Activate two more test cases in test_httpservers.
........
r63484 | georg.brandl | 2008-05-20 08:47:31 +0200 (Tue, 20 May 2008) | 2 lines
Argh, this is the *actual* test that works under Windows.
........
r63496 | georg.brandl | 2008-05-20 10:07:36 +0200 (Tue, 20 May 2008) | 2 lines
Improve diffing logic and output for test_pydoc.
........
r63497 | georg.brandl | 2008-05-20 10:10:03 +0200 (Tue, 20 May 2008) | 2 lines
Use inspect.getabsfile() to get the documented module's filename.
........
r63499 | georg.brandl | 2008-05-20 10:25:48 +0200 (Tue, 20 May 2008) | 3 lines
Patch #1775025: allow opening zipfile members via ZipInfo instances.
Patch by Graham Horler.
........
r63500 | georg.brandl | 2008-05-20 10:40:43 +0200 (Tue, 20 May 2008) | 2 lines
#2592: delegate nb_index and the floor/truediv slots in weakref.proxy.
........
r63501 | georg.brandl | 2008-05-20 10:48:34 +0200 (Tue, 20 May 2008) | 2 lines
#615772: raise a more explicit error from Tkinter.Misc.__contains__.
........
r63530 | benjamin.peterson | 2008-05-22 02:57:02 +0200 (Thu, 22 May 2008) | 2 lines
use more specific asserts in test_opcode
........
r63531 | benjamin.peterson | 2008-05-22 03:02:23 +0200 (Thu, 22 May 2008) | 2 lines
remove redundant invocation of json doctests
........
r63540 | benjamin.peterson | 2008-05-23 01:09:26 +0200 (Fri, 23 May 2008) | 3 lines
fix test_pydoc so it works on make installed Python installations
Also let it pass when invoked directly
........
r63614 | georg.brandl | 2008-05-25 10:07:37 +0200 (Sun, 25 May 2008) | 2 lines
#2959: allow multiple close() calls for GzipFile.
........
2008-05-25 15:19:30 -03:00
|
|
|
|
2010-07-22 09:50:05 -03:00
|
|
|
def tearDown(self):
|
|
|
|
# Get everything back to normal
|
|
|
|
support.unload('xx')
|
|
|
|
sys.path = self.sys_path[0]
|
|
|
|
sys.path[:] = self.sys_path[1]
|
|
|
|
if sys.version > "2.6":
|
|
|
|
import site
|
|
|
|
site.USER_BASE = self.old_user_base
|
|
|
|
from distutils.command import build_ext
|
|
|
|
build_ext.USER_BASE = self.old_user_base
|
|
|
|
super(BuildExtTestCase, self).tearDown()
|
|
|
|
|
2009-02-05 18:56:14 -04:00
|
|
|
def test_solaris_enable_shared(self):
|
|
|
|
dist = Distribution({'name': 'xx'})
|
|
|
|
cmd = build_ext(dist)
|
|
|
|
old = sys.platform
|
|
|
|
|
|
|
|
sys.platform = 'sunos' # fooling finalize_options
|
2010-07-22 09:50:05 -03:00
|
|
|
from distutils.sysconfig import _config_vars
|
|
|
|
old_var = _config_vars.get('Py_ENABLE_SHARED')
|
|
|
|
_config_vars['Py_ENABLE_SHARED'] = 1
|
2009-02-05 18:56:14 -04:00
|
|
|
try:
|
|
|
|
cmd.ensure_finalized()
|
|
|
|
finally:
|
|
|
|
sys.platform = old
|
|
|
|
if old_var is None:
|
2010-07-22 09:50:05 -03:00
|
|
|
del _config_vars['Py_ENABLE_SHARED']
|
2009-02-05 18:56:14 -04:00
|
|
|
else:
|
2010-07-22 09:50:05 -03:00
|
|
|
_config_vars['Py_ENABLE_SHARED'] = old_var
|
2009-02-05 18:56:14 -04:00
|
|
|
|
2009-05-12 14:14:01 -03:00
|
|
|
# make sure we get some library dirs under solaris
|
2013-11-16 18:17:46 -04:00
|
|
|
self.assertGreater(len(cmd.library_dirs), 0)
|
2009-02-05 18:56:14 -04:00
|
|
|
|
2009-02-27 08:58:56 -04:00
|
|
|
def test_user_site(self):
|
|
|
|
import site
|
|
|
|
dist = Distribution({'name': 'xx'})
|
|
|
|
cmd = build_ext(dist)
|
|
|
|
|
2009-05-09 08:55:12 -03:00
|
|
|
# making sure the user option is there
|
2009-02-27 08:58:56 -04:00
|
|
|
options = [name for name, short, lable in
|
|
|
|
cmd.user_options]
|
2013-11-16 18:17:46 -04:00
|
|
|
self.assertIn('user', options)
|
2009-02-27 08:58:56 -04:00
|
|
|
|
|
|
|
# setting a value
|
|
|
|
cmd.user = 1
|
|
|
|
|
|
|
|
# setting user based lib and include
|
|
|
|
lib = os.path.join(site.USER_BASE, 'lib')
|
|
|
|
incl = os.path.join(site.USER_BASE, 'include')
|
|
|
|
os.mkdir(lib)
|
|
|
|
os.mkdir(incl)
|
|
|
|
|
|
|
|
# let's run finalize
|
|
|
|
cmd.ensure_finalized()
|
|
|
|
|
|
|
|
# see if include_dirs and library_dirs
|
|
|
|
# were set
|
2011-08-21 12:02:07 -03:00
|
|
|
self.assertIn(lib, cmd.library_dirs)
|
|
|
|
self.assertIn(lib, cmd.rpath)
|
|
|
|
self.assertIn(incl, cmd.include_dirs)
|
2009-02-27 08:58:56 -04:00
|
|
|
|
2009-03-31 19:37:55 -03:00
|
|
|
def test_optional_extension(self):
|
|
|
|
|
|
|
|
# this extension will fail, but let's ignore this failure
|
|
|
|
# with the optional argument.
|
|
|
|
modules = [Extension('foo', ['xxx'], optional=False)]
|
|
|
|
dist = Distribution({'name': 'xx', 'ext_modules': modules})
|
|
|
|
cmd = build_ext(dist)
|
|
|
|
cmd.ensure_finalized()
|
2009-03-31 19:50:54 -03:00
|
|
|
self.assertRaises((UnknownFileError, CompileError),
|
|
|
|
cmd.run) # should raise an error
|
2009-03-31 19:37:55 -03:00
|
|
|
|
|
|
|
modules = [Extension('foo', ['xxx'], optional=True)]
|
|
|
|
dist = Distribution({'name': 'xx', 'ext_modules': modules})
|
|
|
|
cmd = build_ext(dist)
|
|
|
|
cmd.ensure_finalized()
|
|
|
|
cmd.run() # should pass
|
|
|
|
|
2009-05-10 07:34:01 -03:00
|
|
|
def test_finalize_options(self):
|
|
|
|
# Make sure Python's include directories (for Python.h, pyconfig.h,
|
|
|
|
# etc.) are in the include search path.
|
|
|
|
modules = [Extension('foo', ['xxx'], optional=False)]
|
|
|
|
dist = Distribution({'name': 'xx', 'ext_modules': modules})
|
|
|
|
cmd = build_ext(dist)
|
|
|
|
cmd.finalize_options()
|
|
|
|
|
2010-07-22 09:50:05 -03:00
|
|
|
from distutils import sysconfig
|
|
|
|
py_include = sysconfig.get_python_inc()
|
2013-11-16 18:17:46 -04:00
|
|
|
self.assertIn(py_include, cmd.include_dirs)
|
2009-05-10 07:34:01 -03:00
|
|
|
|
2010-07-22 09:50:05 -03:00
|
|
|
plat_py_include = sysconfig.get_python_inc(plat_specific=1)
|
2013-11-16 18:17:46 -04:00
|
|
|
self.assertIn(plat_py_include, cmd.include_dirs)
|
2009-05-10 07:34:01 -03:00
|
|
|
|
|
|
|
# make sure cmd.libraries is turned into a list
|
|
|
|
# if it's a string
|
|
|
|
cmd = build_ext(dist)
|
2012-02-15 11:44:37 -04:00
|
|
|
cmd.libraries = 'my_lib, other_lib lastlib'
|
2009-05-10 07:34:01 -03:00
|
|
|
cmd.finalize_options()
|
2012-02-15 11:44:37 -04:00
|
|
|
self.assertEqual(cmd.libraries, ['my_lib', 'other_lib', 'lastlib'])
|
2009-05-10 07:34:01 -03:00
|
|
|
|
|
|
|
# make sure cmd.library_dirs is turned into a list
|
|
|
|
# if it's a string
|
|
|
|
cmd = build_ext(dist)
|
2012-02-15 11:44:37 -04:00
|
|
|
cmd.library_dirs = 'my_lib_dir%sother_lib_dir' % os.pathsep
|
2009-05-10 07:34:01 -03:00
|
|
|
cmd.finalize_options()
|
2012-02-15 13:12:12 -04:00
|
|
|
self.assertIn('my_lib_dir', cmd.library_dirs)
|
|
|
|
self.assertIn('other_lib_dir', cmd.library_dirs)
|
2009-05-10 07:34:01 -03:00
|
|
|
|
|
|
|
# make sure rpath is turned into a list
|
2012-02-15 11:44:37 -04:00
|
|
|
# if it's a string
|
2009-05-10 07:34:01 -03:00
|
|
|
cmd = build_ext(dist)
|
2012-02-15 11:44:37 -04:00
|
|
|
cmd.rpath = 'one%stwo' % os.pathsep
|
2009-05-10 07:34:01 -03:00
|
|
|
cmd.finalize_options()
|
2010-11-20 15:04:17 -04:00
|
|
|
self.assertEqual(cmd.rpath, ['one', 'two'])
|
2009-05-10 07:34:01 -03:00
|
|
|
|
|
|
|
# XXX more tests to perform for win32
|
|
|
|
|
|
|
|
# make sure define is turned into 2-tuples
|
|
|
|
# strings if they are ','-separated strings
|
|
|
|
cmd = build_ext(dist)
|
|
|
|
cmd.define = 'one,two'
|
|
|
|
cmd.finalize_options()
|
2010-11-20 15:04:17 -04:00
|
|
|
self.assertEqual(cmd.define, [('one', '1'), ('two', '1')])
|
2009-05-10 07:34:01 -03:00
|
|
|
|
|
|
|
# make sure undef is turned into a list of
|
|
|
|
# strings if they are ','-separated strings
|
|
|
|
cmd = build_ext(dist)
|
|
|
|
cmd.undef = 'one,two'
|
|
|
|
cmd.finalize_options()
|
2010-11-20 15:04:17 -04:00
|
|
|
self.assertEqual(cmd.undef, ['one', 'two'])
|
2009-05-10 07:34:01 -03:00
|
|
|
|
|
|
|
# make sure swig_opts is turned into a list
|
|
|
|
cmd = build_ext(dist)
|
|
|
|
cmd.swig_opts = None
|
|
|
|
cmd.finalize_options()
|
2010-11-20 15:04:17 -04:00
|
|
|
self.assertEqual(cmd.swig_opts, [])
|
2009-05-10 07:34:01 -03:00
|
|
|
|
|
|
|
cmd = build_ext(dist)
|
|
|
|
cmd.swig_opts = '1 2'
|
|
|
|
cmd.finalize_options()
|
2010-11-20 15:04:17 -04:00
|
|
|
self.assertEqual(cmd.swig_opts, ['1', '2'])
|
2009-05-10 07:34:01 -03:00
|
|
|
|
|
|
|
def test_check_extensions_list(self):
|
|
|
|
dist = Distribution()
|
|
|
|
cmd = build_ext(dist)
|
|
|
|
cmd.finalize_options()
|
|
|
|
|
|
|
|
#'extensions' option must be a list of Extension instances
|
2010-10-15 22:04:07 -03:00
|
|
|
self.assertRaises(DistutilsSetupError,
|
|
|
|
cmd.check_extensions_list, 'foo')
|
2009-05-10 07:34:01 -03:00
|
|
|
|
|
|
|
# each element of 'ext_modules' option must be an
|
|
|
|
# Extension instance or 2-tuple
|
|
|
|
exts = [('bar', 'foo', 'bar'), 'foo']
|
|
|
|
self.assertRaises(DistutilsSetupError, cmd.check_extensions_list, exts)
|
|
|
|
|
|
|
|
# first element of each tuple in 'ext_modules'
|
|
|
|
# must be the extension name (a string) and match
|
|
|
|
# a python dotted-separated name
|
|
|
|
exts = [('foo-bar', '')]
|
|
|
|
self.assertRaises(DistutilsSetupError, cmd.check_extensions_list, exts)
|
|
|
|
|
|
|
|
# second element of each tuple in 'ext_modules'
|
|
|
|
# must be a ary (build info)
|
|
|
|
exts = [('foo.bar', '')]
|
|
|
|
self.assertRaises(DistutilsSetupError, cmd.check_extensions_list, exts)
|
|
|
|
|
|
|
|
# ok this one should pass
|
|
|
|
exts = [('foo.bar', {'sources': [''], 'libraries': 'foo',
|
|
|
|
'some': 'bar'})]
|
|
|
|
cmd.check_extensions_list(exts)
|
|
|
|
ext = exts[0]
|
2013-11-16 18:17:46 -04:00
|
|
|
self.assertIsInstance(ext, Extension)
|
2009-05-10 07:34:01 -03:00
|
|
|
|
|
|
|
# check_extensions_list adds in ext the values passed
|
|
|
|
# when they are in ('include_dirs', 'library_dirs', 'libraries'
|
|
|
|
# 'extra_objects', 'extra_compile_args', 'extra_link_args')
|
2010-11-20 15:04:17 -04:00
|
|
|
self.assertEqual(ext.libraries, 'foo')
|
2013-11-16 18:17:46 -04:00
|
|
|
self.assertFalse(hasattr(ext, 'some'))
|
2009-05-10 07:34:01 -03:00
|
|
|
|
|
|
|
# 'macros' element of build info dict must be 1- or 2-tuple
|
|
|
|
exts = [('foo.bar', {'sources': [''], 'libraries': 'foo',
|
|
|
|
'some': 'bar', 'macros': [('1', '2', '3'), 'foo']})]
|
|
|
|
self.assertRaises(DistutilsSetupError, cmd.check_extensions_list, exts)
|
|
|
|
|
|
|
|
exts[0][1]['macros'] = [('1', '2'), ('3',)]
|
|
|
|
cmd.check_extensions_list(exts)
|
2010-11-20 15:04:17 -04:00
|
|
|
self.assertEqual(exts[0].undef_macros, ['3'])
|
|
|
|
self.assertEqual(exts[0].define_macros, [('1', '2')])
|
2009-05-10 07:34:01 -03:00
|
|
|
|
|
|
|
def test_get_source_files(self):
|
|
|
|
modules = [Extension('foo', ['xxx'], optional=False)]
|
|
|
|
dist = Distribution({'name': 'xx', 'ext_modules': modules})
|
|
|
|
cmd = build_ext(dist)
|
|
|
|
cmd.ensure_finalized()
|
2010-11-20 15:04:17 -04:00
|
|
|
self.assertEqual(cmd.get_source_files(), ['xxx'])
|
2009-05-10 07:34:01 -03:00
|
|
|
|
2009-05-12 14:14:01 -03:00
|
|
|
def test_compiler_option(self):
|
|
|
|
# cmd.compiler is an option and
|
|
|
|
# should not be overriden by a compiler instance
|
|
|
|
# when the command is run
|
|
|
|
dist = Distribution()
|
|
|
|
cmd = build_ext(dist)
|
|
|
|
cmd.compiler = 'unix'
|
|
|
|
cmd.ensure_finalized()
|
|
|
|
cmd.run()
|
2010-11-20 15:04:17 -04:00
|
|
|
self.assertEqual(cmd.compiler, 'unix')
|
2009-05-12 14:14:01 -03:00
|
|
|
|
2009-05-10 07:34:01 -03:00
|
|
|
def test_get_outputs(self):
|
2009-05-12 14:14:01 -03:00
|
|
|
tmp_dir = self.mkdtemp()
|
|
|
|
c_file = os.path.join(tmp_dir, 'foo.c')
|
2010-11-09 05:32:19 -04:00
|
|
|
self.write_file(c_file, 'void PyInit_foo(void) {}\n')
|
2009-05-12 14:14:01 -03:00
|
|
|
ext = Extension('foo', [c_file], optional=False)
|
|
|
|
dist = Distribution({'name': 'xx',
|
|
|
|
'ext_modules': [ext]})
|
2009-05-10 07:34:01 -03:00
|
|
|
cmd = build_ext(dist)
|
2011-08-21 12:02:07 -03:00
|
|
|
fixup_build_ext(cmd)
|
2009-05-10 07:34:01 -03:00
|
|
|
cmd.ensure_finalized()
|
2010-11-20 15:04:17 -04:00
|
|
|
self.assertEqual(len(cmd.get_outputs()), 1)
|
2009-05-10 07:34:01 -03:00
|
|
|
|
2009-05-12 14:14:01 -03:00
|
|
|
cmd.build_lib = os.path.join(self.tmp_dir, 'build')
|
|
|
|
cmd.build_temp = os.path.join(self.tmp_dir, 'tempt')
|
|
|
|
|
|
|
|
# issue #5977 : distutils build_ext.get_outputs
|
|
|
|
# returns wrong result with --inplace
|
2009-05-14 17:20:47 -03:00
|
|
|
other_tmp_dir = os.path.realpath(self.mkdtemp())
|
|
|
|
old_wd = os.getcwd()
|
|
|
|
os.chdir(other_tmp_dir)
|
|
|
|
try:
|
|
|
|
cmd.inplace = 1
|
|
|
|
cmd.run()
|
|
|
|
so_file = cmd.get_outputs()[0]
|
|
|
|
finally:
|
|
|
|
os.chdir(old_wd)
|
2009-06-30 20:06:06 -03:00
|
|
|
self.assertTrue(os.path.exists(so_file))
|
2013-03-21 17:21:49 -03:00
|
|
|
ext_suffix = sysconfig.get_config_var('EXT_SUFFIX')
|
|
|
|
self.assertTrue(so_file.endswith(ext_suffix))
|
2009-05-12 14:14:01 -03:00
|
|
|
so_dir = os.path.dirname(so_file)
|
2010-11-20 15:04:17 -04:00
|
|
|
self.assertEqual(so_dir, other_tmp_dir)
|
2009-05-12 14:14:01 -03:00
|
|
|
|
|
|
|
cmd.inplace = 0
|
2010-07-22 09:50:05 -03:00
|
|
|
cmd.compiler = None
|
2009-05-12 14:14:01 -03:00
|
|
|
cmd.run()
|
|
|
|
so_file = cmd.get_outputs()[0]
|
2009-06-30 20:06:06 -03:00
|
|
|
self.assertTrue(os.path.exists(so_file))
|
2013-03-21 17:21:49 -03:00
|
|
|
self.assertTrue(so_file.endswith(ext_suffix))
|
2009-05-12 14:14:01 -03:00
|
|
|
so_dir = os.path.dirname(so_file)
|
2010-11-20 15:04:17 -04:00
|
|
|
self.assertEqual(so_dir, cmd.build_lib)
|
2009-05-12 14:14:01 -03:00
|
|
|
|
2009-05-19 13:22:57 -03:00
|
|
|
# inplace = 0, cmd.package = 'bar'
|
2009-07-03 05:33:28 -03:00
|
|
|
build_py = cmd.get_finalized_command('build_py')
|
|
|
|
build_py.package_dir = {'': 'bar'}
|
2009-05-19 13:22:57 -03:00
|
|
|
path = cmd.get_ext_fullpath('foo')
|
2009-06-29 13:19:22 -03:00
|
|
|
# checking that the last directory is the build_dir
|
2009-05-19 13:22:57 -03:00
|
|
|
path = os.path.split(path)[0]
|
2010-11-20 15:04:17 -04:00
|
|
|
self.assertEqual(path, cmd.build_lib)
|
2009-05-19 13:22:57 -03:00
|
|
|
|
|
|
|
# inplace = 1, cmd.package = 'bar'
|
|
|
|
cmd.inplace = 1
|
|
|
|
other_tmp_dir = os.path.realpath(self.mkdtemp())
|
|
|
|
old_wd = os.getcwd()
|
|
|
|
os.chdir(other_tmp_dir)
|
|
|
|
try:
|
|
|
|
path = cmd.get_ext_fullpath('foo')
|
|
|
|
finally:
|
|
|
|
os.chdir(old_wd)
|
|
|
|
# checking that the last directory is bar
|
|
|
|
path = os.path.split(path)[0]
|
|
|
|
lastdir = os.path.split(path)[-1]
|
2010-11-20 15:04:17 -04:00
|
|
|
self.assertEqual(lastdir, 'bar')
|
2009-05-19 13:22:57 -03:00
|
|
|
|
2009-07-03 05:33:28 -03:00
|
|
|
def test_ext_fullpath(self):
|
2013-03-21 17:21:49 -03:00
|
|
|
ext = sysconfig.get_config_var('EXT_SUFFIX')
|
2009-07-03 05:33:28 -03:00
|
|
|
# building lxml.etree inplace
|
|
|
|
#etree_c = os.path.join(self.tmp_dir, 'lxml.etree.c')
|
|
|
|
#etree_ext = Extension('lxml.etree', [etree_c])
|
|
|
|
#dist = Distribution({'name': 'lxml', 'ext_modules': [etree_ext]})
|
|
|
|
dist = Distribution()
|
2009-06-29 13:19:22 -03:00
|
|
|
cmd = build_ext(dist)
|
|
|
|
cmd.inplace = 1
|
|
|
|
cmd.distribution.package_dir = {'': 'src'}
|
|
|
|
cmd.distribution.packages = ['lxml', 'lxml.html']
|
|
|
|
curdir = os.getcwd()
|
2009-07-10 06:14:31 -03:00
|
|
|
wanted = os.path.join(curdir, 'src', 'lxml', 'etree' + ext)
|
2009-06-29 13:19:22 -03:00
|
|
|
path = cmd.get_ext_fullpath('lxml.etree')
|
2010-11-20 15:04:17 -04:00
|
|
|
self.assertEqual(wanted, path)
|
2009-06-29 13:19:22 -03:00
|
|
|
|
2009-07-03 05:33:28 -03:00
|
|
|
# building lxml.etree not inplace
|
|
|
|
cmd.inplace = 0
|
|
|
|
cmd.build_lib = os.path.join(curdir, 'tmpdir')
|
2009-07-10 06:14:31 -03:00
|
|
|
wanted = os.path.join(curdir, 'tmpdir', 'lxml', 'etree' + ext)
|
2009-07-03 05:33:28 -03:00
|
|
|
path = cmd.get_ext_fullpath('lxml.etree')
|
2010-11-20 15:04:17 -04:00
|
|
|
self.assertEqual(wanted, path)
|
2009-07-03 05:33:28 -03:00
|
|
|
|
|
|
|
# building twisted.runner.portmap not inplace
|
|
|
|
build_py = cmd.get_finalized_command('build_py')
|
|
|
|
build_py.package_dir = {}
|
|
|
|
cmd.distribution.packages = ['twisted', 'twisted.runner.portmap']
|
|
|
|
path = cmd.get_ext_fullpath('twisted.runner.portmap')
|
|
|
|
wanted = os.path.join(curdir, 'tmpdir', 'twisted', 'runner',
|
2009-07-10 06:14:31 -03:00
|
|
|
'portmap' + ext)
|
2010-11-20 15:04:17 -04:00
|
|
|
self.assertEqual(wanted, path)
|
2009-07-03 05:33:28 -03:00
|
|
|
|
|
|
|
# building twisted.runner.portmap inplace
|
|
|
|
cmd.inplace = 1
|
|
|
|
path = cmd.get_ext_fullpath('twisted.runner.portmap')
|
2009-07-10 06:14:31 -03:00
|
|
|
wanted = os.path.join(curdir, 'twisted', 'runner', 'portmap' + ext)
|
2010-11-20 15:04:17 -04:00
|
|
|
self.assertEqual(wanted, path)
|
2009-07-03 05:33:28 -03:00
|
|
|
|
2011-05-15 11:46:11 -03:00
|
|
|
|
|
|
|
@unittest.skipUnless(sys.platform == 'darwin', 'test only relevant for MacOSX')
|
2011-06-28 23:43:15 -03:00
|
|
|
def test_deployment_target_default(self):
|
|
|
|
# Issue 9516: Test that, in the absence of the environment variable,
|
|
|
|
# an extension module is compiled with the same deployment target as
|
|
|
|
# the interpreter.
|
|
|
|
self._try_compile_deployment_target('==', None)
|
2011-05-15 11:46:11 -03:00
|
|
|
|
2011-06-28 23:43:15 -03:00
|
|
|
@unittest.skipUnless(sys.platform == 'darwin', 'test only relevant for MacOSX')
|
|
|
|
def test_deployment_target_too_low(self):
|
|
|
|
# Issue 9516: Test that an extension module is not allowed to be
|
|
|
|
# compiled with a deployment target less than that of the interpreter.
|
|
|
|
self.assertRaises(DistutilsPlatformError,
|
|
|
|
self._try_compile_deployment_target, '>', '10.1')
|
|
|
|
|
|
|
|
@unittest.skipUnless(sys.platform == 'darwin', 'test only relevant for MacOSX')
|
|
|
|
def test_deployment_target_higher_ok(self):
|
|
|
|
# Issue 9516: Test that an extension module can be compiled with a
|
|
|
|
# deployment target higher than that of the interpreter: the ext
|
|
|
|
# module may depend on some newer OS feature.
|
|
|
|
deptarget = sysconfig.get_config_var('MACOSX_DEPLOYMENT_TARGET')
|
|
|
|
if deptarget:
|
|
|
|
# increment the minor version number (i.e. 10.6 -> 10.7)
|
|
|
|
deptarget = [int(x) for x in deptarget.split('.')]
|
|
|
|
deptarget[-1] += 1
|
|
|
|
deptarget = '.'.join(str(i) for i in deptarget)
|
|
|
|
self._try_compile_deployment_target('<', deptarget)
|
|
|
|
|
|
|
|
def _try_compile_deployment_target(self, operator, target):
|
2011-05-15 11:46:11 -03:00
|
|
|
orig_environ = os.environ
|
|
|
|
os.environ = orig_environ.copy()
|
|
|
|
self.addCleanup(setattr, os, 'environ', orig_environ)
|
|
|
|
|
2011-06-28 23:43:15 -03:00
|
|
|
if target is None:
|
|
|
|
if os.environ.get('MACOSX_DEPLOYMENT_TARGET'):
|
|
|
|
del os.environ['MACOSX_DEPLOYMENT_TARGET']
|
|
|
|
else:
|
|
|
|
os.environ['MACOSX_DEPLOYMENT_TARGET'] = target
|
2011-05-15 11:46:11 -03:00
|
|
|
|
|
|
|
deptarget_c = os.path.join(self.tmp_dir, 'deptargetmodule.c')
|
|
|
|
|
|
|
|
with open(deptarget_c, 'w') as fp:
|
|
|
|
fp.write(textwrap.dedent('''\
|
|
|
|
#include <AvailabilityMacros.h>
|
|
|
|
|
|
|
|
int dummy;
|
|
|
|
|
2011-06-28 23:43:15 -03:00
|
|
|
#if TARGET %s MAC_OS_X_VERSION_MIN_REQUIRED
|
|
|
|
#else
|
2011-05-15 11:46:11 -03:00
|
|
|
#error "Unexpected target"
|
|
|
|
#endif
|
|
|
|
|
2011-06-28 23:43:15 -03:00
|
|
|
''' % operator))
|
2011-05-15 11:46:11 -03:00
|
|
|
|
2011-06-28 23:43:15 -03:00
|
|
|
# get the deployment target that the interpreter was built with
|
2011-05-15 11:46:11 -03:00
|
|
|
target = sysconfig.get_config_var('MACOSX_DEPLOYMENT_TARGET')
|
|
|
|
target = tuple(map(int, target.split('.')))
|
|
|
|
target = '%02d%01d0' % target
|
|
|
|
deptarget_ext = Extension(
|
|
|
|
'deptarget',
|
|
|
|
[deptarget_c],
|
|
|
|
extra_compile_args=['-DTARGET=%s'%(target,)],
|
|
|
|
)
|
|
|
|
dist = Distribution({
|
|
|
|
'name': 'deptarget',
|
|
|
|
'ext_modules': [deptarget_ext]
|
|
|
|
})
|
|
|
|
dist.package_dir = self.tmp_dir
|
|
|
|
cmd = build_ext(dist)
|
|
|
|
cmd.build_lib = self.tmp_dir
|
|
|
|
cmd.build_temp = self.tmp_dir
|
|
|
|
|
|
|
|
try:
|
|
|
|
old_stdout = sys.stdout
|
|
|
|
if not support.verbose:
|
|
|
|
# silence compiler output
|
|
|
|
sys.stdout = StringIO()
|
|
|
|
try:
|
|
|
|
cmd.ensure_finalized()
|
|
|
|
cmd.run()
|
|
|
|
finally:
|
|
|
|
sys.stdout = old_stdout
|
|
|
|
|
|
|
|
except CompileError:
|
|
|
|
self.fail("Wrong deployment target during compilation")
|
|
|
|
|
|
|
|
|
Merged revisions 63412,63445-63447,63449-63450,63452,63454,63459,63463,63465,63470,63483-63484,63496-63497,63499-63501,63530-63531,63540,63614 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk
........
r63412 | georg.brandl | 2008-05-17 19:57:01 +0200 (Sat, 17 May 2008) | 2 lines
#961805: fix Edit.text_modified().
........
r63445 | georg.brandl | 2008-05-18 10:52:59 +0200 (Sun, 18 May 2008) | 2 lines
GHOP #180 by Michael Schneider: add examples to the socketserver documentation.
........
r63446 | georg.brandl | 2008-05-18 11:12:20 +0200 (Sun, 18 May 2008) | 2 lines
GHOP #134, #171, #137: unit tests for the three HTTPServer modules.
........
r63447 | georg.brandl | 2008-05-18 12:39:26 +0200 (Sun, 18 May 2008) | 3 lines
Take namedtuple item names only from ascii_letters (this blew up on OSX),
and make sure there are no duplicate names.
........
r63449 | georg.brandl | 2008-05-18 13:46:51 +0200 (Sun, 18 May 2008) | 2 lines
GHOP #217: add support for compiling Python with coverage checking enabled.
........
r63450 | georg.brandl | 2008-05-18 13:52:36 +0200 (Sun, 18 May 2008) | 2 lines
GHOP #257: test distutils' build_ext command, written by Josip Dzolonga.
........
r63452 | georg.brandl | 2008-05-18 15:34:06 +0200 (Sun, 18 May 2008) | 2 lines
Add GHOP students.
........
r63454 | georg.brandl | 2008-05-18 18:32:48 +0200 (Sun, 18 May 2008) | 2 lines
GHOP #121: improve test_pydoc, by Benjamin Peterson.
........
r63459 | benjamin.peterson | 2008-05-18 22:48:07 +0200 (Sun, 18 May 2008) | 2 lines
bring test_pydoc up to my high standards (now that I have them)
........
r63463 | georg.brandl | 2008-05-18 23:10:19 +0200 (Sun, 18 May 2008) | 2 lines
Fix test_pyclbr after another platform-dependent function was added to urllib.
........
r63465 | benjamin.peterson | 2008-05-19 01:07:07 +0200 (Mon, 19 May 2008) | 2 lines
change some imports in tests so they will not be skipped in 3.0
........
r63470 | georg.brandl | 2008-05-19 18:47:25 +0200 (Mon, 19 May 2008) | 2 lines
test_httpservers has unpredictable refcount behavior.
........
r63483 | georg.brandl | 2008-05-20 08:15:36 +0200 (Tue, 20 May 2008) | 2 lines
Activate two more test cases in test_httpservers.
........
r63484 | georg.brandl | 2008-05-20 08:47:31 +0200 (Tue, 20 May 2008) | 2 lines
Argh, this is the *actual* test that works under Windows.
........
r63496 | georg.brandl | 2008-05-20 10:07:36 +0200 (Tue, 20 May 2008) | 2 lines
Improve diffing logic and output for test_pydoc.
........
r63497 | georg.brandl | 2008-05-20 10:10:03 +0200 (Tue, 20 May 2008) | 2 lines
Use inspect.getabsfile() to get the documented module's filename.
........
r63499 | georg.brandl | 2008-05-20 10:25:48 +0200 (Tue, 20 May 2008) | 3 lines
Patch #1775025: allow opening zipfile members via ZipInfo instances.
Patch by Graham Horler.
........
r63500 | georg.brandl | 2008-05-20 10:40:43 +0200 (Tue, 20 May 2008) | 2 lines
#2592: delegate nb_index and the floor/truediv slots in weakref.proxy.
........
r63501 | georg.brandl | 2008-05-20 10:48:34 +0200 (Tue, 20 May 2008) | 2 lines
#615772: raise a more explicit error from Tkinter.Misc.__contains__.
........
r63530 | benjamin.peterson | 2008-05-22 02:57:02 +0200 (Thu, 22 May 2008) | 2 lines
use more specific asserts in test_opcode
........
r63531 | benjamin.peterson | 2008-05-22 03:02:23 +0200 (Thu, 22 May 2008) | 2 lines
remove redundant invocation of json doctests
........
r63540 | benjamin.peterson | 2008-05-23 01:09:26 +0200 (Fri, 23 May 2008) | 3 lines
fix test_pydoc so it works on make installed Python installations
Also let it pass when invoked directly
........
r63614 | georg.brandl | 2008-05-25 10:07:37 +0200 (Sun, 25 May 2008) | 2 lines
#2959: allow multiple close() calls for GzipFile.
........
2008-05-25 15:19:30 -03:00
|
|
|
def test_suite():
|
2011-08-20 01:27:18 -03:00
|
|
|
return unittest.makeSuite(BuildExtTestCase)
|
Merged revisions 63412,63445-63447,63449-63450,63452,63454,63459,63463,63465,63470,63483-63484,63496-63497,63499-63501,63530-63531,63540,63614 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk
........
r63412 | georg.brandl | 2008-05-17 19:57:01 +0200 (Sat, 17 May 2008) | 2 lines
#961805: fix Edit.text_modified().
........
r63445 | georg.brandl | 2008-05-18 10:52:59 +0200 (Sun, 18 May 2008) | 2 lines
GHOP #180 by Michael Schneider: add examples to the socketserver documentation.
........
r63446 | georg.brandl | 2008-05-18 11:12:20 +0200 (Sun, 18 May 2008) | 2 lines
GHOP #134, #171, #137: unit tests for the three HTTPServer modules.
........
r63447 | georg.brandl | 2008-05-18 12:39:26 +0200 (Sun, 18 May 2008) | 3 lines
Take namedtuple item names only from ascii_letters (this blew up on OSX),
and make sure there are no duplicate names.
........
r63449 | georg.brandl | 2008-05-18 13:46:51 +0200 (Sun, 18 May 2008) | 2 lines
GHOP #217: add support for compiling Python with coverage checking enabled.
........
r63450 | georg.brandl | 2008-05-18 13:52:36 +0200 (Sun, 18 May 2008) | 2 lines
GHOP #257: test distutils' build_ext command, written by Josip Dzolonga.
........
r63452 | georg.brandl | 2008-05-18 15:34:06 +0200 (Sun, 18 May 2008) | 2 lines
Add GHOP students.
........
r63454 | georg.brandl | 2008-05-18 18:32:48 +0200 (Sun, 18 May 2008) | 2 lines
GHOP #121: improve test_pydoc, by Benjamin Peterson.
........
r63459 | benjamin.peterson | 2008-05-18 22:48:07 +0200 (Sun, 18 May 2008) | 2 lines
bring test_pydoc up to my high standards (now that I have them)
........
r63463 | georg.brandl | 2008-05-18 23:10:19 +0200 (Sun, 18 May 2008) | 2 lines
Fix test_pyclbr after another platform-dependent function was added to urllib.
........
r63465 | benjamin.peterson | 2008-05-19 01:07:07 +0200 (Mon, 19 May 2008) | 2 lines
change some imports in tests so they will not be skipped in 3.0
........
r63470 | georg.brandl | 2008-05-19 18:47:25 +0200 (Mon, 19 May 2008) | 2 lines
test_httpservers has unpredictable refcount behavior.
........
r63483 | georg.brandl | 2008-05-20 08:15:36 +0200 (Tue, 20 May 2008) | 2 lines
Activate two more test cases in test_httpservers.
........
r63484 | georg.brandl | 2008-05-20 08:47:31 +0200 (Tue, 20 May 2008) | 2 lines
Argh, this is the *actual* test that works under Windows.
........
r63496 | georg.brandl | 2008-05-20 10:07:36 +0200 (Tue, 20 May 2008) | 2 lines
Improve diffing logic and output for test_pydoc.
........
r63497 | georg.brandl | 2008-05-20 10:10:03 +0200 (Tue, 20 May 2008) | 2 lines
Use inspect.getabsfile() to get the documented module's filename.
........
r63499 | georg.brandl | 2008-05-20 10:25:48 +0200 (Tue, 20 May 2008) | 3 lines
Patch #1775025: allow opening zipfile members via ZipInfo instances.
Patch by Graham Horler.
........
r63500 | georg.brandl | 2008-05-20 10:40:43 +0200 (Tue, 20 May 2008) | 2 lines
#2592: delegate nb_index and the floor/truediv slots in weakref.proxy.
........
r63501 | georg.brandl | 2008-05-20 10:48:34 +0200 (Tue, 20 May 2008) | 2 lines
#615772: raise a more explicit error from Tkinter.Misc.__contains__.
........
r63530 | benjamin.peterson | 2008-05-22 02:57:02 +0200 (Thu, 22 May 2008) | 2 lines
use more specific asserts in test_opcode
........
r63531 | benjamin.peterson | 2008-05-22 03:02:23 +0200 (Thu, 22 May 2008) | 2 lines
remove redundant invocation of json doctests
........
r63540 | benjamin.peterson | 2008-05-23 01:09:26 +0200 (Fri, 23 May 2008) | 3 lines
fix test_pydoc so it works on make installed Python installations
Also let it pass when invoked directly
........
r63614 | georg.brandl | 2008-05-25 10:07:37 +0200 (Sun, 25 May 2008) | 2 lines
#2959: allow multiple close() calls for GzipFile.
........
2008-05-25 15:19:30 -03:00
|
|
|
|
|
|
|
if __name__ == '__main__':
|
|
|
|
support.run_unittest(test_suite())
|