|
27 | 27 | @support.requires_resource('cpu') |
28 | 28 | class TestExt(unittest.TestCase): |
29 | 29 | def test_build_c99(self): |
30 | | - self.check_build('c99', '_test_c99_ext') |
| 30 | + self.check_build('_test_c99_ext', std='c99') |
31 | 31 |
|
32 | 32 | def test_build_c11(self): |
33 | | - self.check_build('c11', '_test_c11_ext') |
| 33 | + self.check_build('_test_c11_ext', std='c11') |
34 | 34 |
|
35 | | - def check_build(self, clang_std, extension_name): |
| 35 | + def test_build_limited(self): |
| 36 | + self.check_build('_test_limited_ext', limited=True) |
| 37 | + |
| 38 | + def test_build_limited_c11(self): |
| 39 | + self.check_build('_test_limited_c11_ext', limited=True, std='c11') |
| 40 | + |
| 41 | + def check_build(self, extension_name, std=None, limited=False): |
36 | 42 | venv_dir = 'env' |
37 | 43 | with support.setup_venv_with_pip_setuptools_wheel(venv_dir) as python_exe: |
38 | | - self._check_build(clang_std, extension_name, python_exe) |
| 44 | + self._check_build(extension_name, python_exe, |
| 45 | + std=std, limited=limited) |
39 | 46 |
|
40 | | - def _check_build(self, clang_std, extension_name, python_exe): |
| 47 | + def _check_build(self, extension_name, python_exe, std, limited): |
41 | 48 | pkg_dir = 'pkg' |
42 | 49 | os.mkdir(pkg_dir) |
43 | 50 | shutil.copy(SETUP, os.path.join(pkg_dir, os.path.basename(SETUP))) |
44 | 51 | shutil.copy(SOURCE, os.path.join(pkg_dir, os.path.basename(SOURCE))) |
45 | 52 |
|
46 | 53 | def run_cmd(operation, cmd): |
47 | 54 | env = os.environ.copy() |
48 | | - env['CPYTHON_TEST_STD'] = clang_std |
| 55 | + if std: |
| 56 | + env['CPYTHON_TEST_STD'] = std |
| 57 | + if limited: |
| 58 | + env['CPYTHON_TEST_LIMITED'] = '1' |
49 | 59 | env['CPYTHON_TEST_EXT_NAME'] = extension_name |
50 | 60 | if support.verbose: |
51 | 61 | print('Run:', ' '.join(cmd)) |
|
0 commit comments