~ubuntu-branches/ubuntu/karmic/python3.0/karmic

« back to all changes in this revision

Viewing changes to Lib/distutils/tests/test_build_ext.py

  • Committer: Bazaar Package Importer
  • Author(s): Matthias Klose
  • Date: 2009-02-16 17:18:23 UTC
  • mfrom: (1.1.4 upstream)
  • Revision ID: james.westby@ubuntu.com-20090216171823-1d5cm5qnnjvmnzzm
Tags: 3.0.1-0ubuntu1
New upstream version.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
import sys
2
2
import os
3
 
import tempfile
4
3
import shutil
5
4
from io import StringIO
6
5
 
19
18
    def setUp(self):
20
19
        # Create a simple test environment
21
20
        # Note that we're making changes to sys.path
22
 
        self.tmp_dir = tempfile.mkdtemp(prefix="pythontest_")
 
21
        self.tmp_dir = os.path.join(os.path.dirname(__file__), 'xx')
 
22
        os.mkdir(self.tmp_dir)
23
23
        self.sys_path = sys.path[:]
24
24
        sys.path.append(self.tmp_dir)
25
25
 
75
75
        # XXX on Windows the test leaves a directory with xx module in TEMP
76
76
        shutil.rmtree(self.tmp_dir, os.name == 'nt' or sys.platform == 'cygwin')
77
77
 
 
78
    def test_solaris_enable_shared(self):
 
79
        dist = Distribution({'name': 'xx'})
 
80
        cmd = build_ext(dist)
 
81
        old = sys.platform
 
82
 
 
83
        sys.platform = 'sunos' # fooling finalize_options
 
84
        from distutils.sysconfig import  _config_vars
 
85
        old_var = _config_vars.get('Py_ENABLE_SHARED')
 
86
        _config_vars['Py_ENABLE_SHARED'] = 1
 
87
        try:
 
88
            cmd.ensure_finalized()
 
89
        finally:
 
90
            sys.platform = old
 
91
            if old_var is None:
 
92
                del _config_vars['Py_ENABLE_SHARED']
 
93
            else:
 
94
                _config_vars['Py_ENABLE_SHARED'] = old_var
 
95
 
 
96
        # make sur we get some lobrary dirs under solaris
 
97
        self.assert_(len(cmd.library_dirs) > 0)
 
98
 
78
99
def test_suite():
79
100
    if not sysconfig.python_build:
80
101
        if support.verbose: