diff options
author | Christoph Reiter <reiter.christoph@gmail.com> | 2020-11-20 15:34:37 +0100 |
---|---|---|
committer | Dylan Baker <dylan@pnwbakers.com> | 2020-11-23 09:26:41 -0800 |
commit | edbcb2bfc8e6628d61cdb52d97d359e1cd78a17c (patch) | |
tree | 2ca12ed14384f191dede53ce4ba7a2955776bc88 /run_project_tests.py | |
parent | abc7e6af01714206100a752898c325282436501f (diff) | |
download | meson-edbcb2bfc8e6628d61cdb52d97d359e1cd78a17c.zip meson-edbcb2bfc8e6628d61cdb52d97d359e1cd78a17c.tar.gz meson-edbcb2bfc8e6628d61cdb52d97d359e1cd78a17c.tar.bz2 |
Replace various calls to AutoDeletedDir with TemporaryDirectoryWinProof
AutoDeletedDir was a workaround to TemporaryDirectory not using
windows_proof_rmtree(). TemporaryDirectoryWinProof does now, so replace
it.
Diffstat (limited to 'run_project_tests.py')
-rwxr-xr-x | run_project_tests.py | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/run_project_tests.py b/run_project_tests.py index 5b67713..a88e5cc 100755 --- a/run_project_tests.py +++ b/run_project_tests.py @@ -42,7 +42,7 @@ from mesonbuild import mesonlib from mesonbuild import mlog from mesonbuild import mtest from mesonbuild.build import ConfigurationData -from mesonbuild.mesonlib import MachineChoice, Popen_safe +from mesonbuild.mesonlib import MachineChoice, Popen_safe, TemporaryDirectoryWinProof from mesonbuild.coredata import backendlist, version as meson_version from run_tests import get_fake_options, run_configure, get_meson_script @@ -520,7 +520,7 @@ def run_test(test: TestDef, extra_args, compiler, backend, flags, commands, shou if test.skip: return None with AutoDeletedDir(create_deterministic_builddir(test, use_tmp)) as build_dir: - with AutoDeletedDir(tempfile.mkdtemp(prefix='i ', dir=None if use_tmp else os.getcwd())) as install_dir: + with TemporaryDirectoryWinProof(prefix='i ', dir=None if use_tmp else os.getcwd()) as install_dir: try: return _run_test(test, build_dir, install_dir, extra_args, compiler, backend, flags, commands, should_fail) except TestResult as r: @@ -790,7 +790,7 @@ def have_d_compiler(): return False def have_objc_compiler(use_tmp: bool) -> bool: - with AutoDeletedDir(tempfile.mkdtemp(prefix='b ', dir=None if use_tmp else '.')) as build_dir: + with TemporaryDirectoryWinProof(prefix='b ', dir=None if use_tmp else '.') as build_dir: env = environment.Environment(None, build_dir, get_fake_options('/')) try: objc_comp = env.detect_objc_compiler(MachineChoice.HOST) @@ -806,7 +806,7 @@ def have_objc_compiler(use_tmp: bool) -> bool: return True def have_objcpp_compiler(use_tmp: bool) -> bool: - with AutoDeletedDir(tempfile.mkdtemp(prefix='b ', dir=None if use_tmp else '.')) as build_dir: + with TemporaryDirectoryWinProof(prefix='b ', dir=None if use_tmp else '.') as build_dir: env = environment.Environment(None, build_dir, get_fake_options('/')) try: objcpp_comp = env.detect_objcpp_compiler(MachineChoice.HOST) @@ -1190,7 +1190,7 @@ def check_meson_commands_work(options): global backend, compile_commands, test_commands, install_commands testdir = PurePath('test cases', 'common', '1 trivial').as_posix() meson_commands = mesonlib.python_command + [get_meson_script()] - with AutoDeletedDir(tempfile.mkdtemp(prefix='b ', dir=None if options.use_tmpdir else '.')) as build_dir: + with TemporaryDirectoryWinProof(prefix='b ', dir=None if options.use_tmpdir else '.') as build_dir: print('Checking that configuring works...') gen_cmd = meson_commands + [testdir, build_dir] + backend_flags + options.extra_args pc, o, e = Popen_safe(gen_cmd) @@ -1220,7 +1220,7 @@ def check_meson_commands_work(options): def detect_system_compiler(options): global host_c_compiler, compiler_id_map - with AutoDeletedDir(tempfile.mkdtemp(prefix='b ', dir=None if options.use_tmpdir else '.')) as build_dir: + with TemporaryDirectoryWinProof(prefix='b ', dir=None if options.use_tmpdir else '.') as build_dir: fake_opts = get_fake_options('/') if options.cross_file: fake_opts.cross_file = [options.cross_file] |