diff --git a/run_tests.py b/run_tests.py index 68a222c84..41c957749 100755 --- a/run_tests.py +++ b/run_tests.py @@ -358,7 +358,7 @@ def main(): parser.add_argument('--no-unittests', action='store_true', default=False) (options, _) = parser.parse_known_args() returncode = 0 - backend, _ = guess_backend(options.backend, shutil.which('msbuild')) + _, backend_flags = guess_backend(options.backend, shutil.which('msbuild')) no_unittests = options.no_unittests # Running on a developer machine? Be nice! if not mesonlib.is_windows() and not mesonlib.is_haiku() and 'CI' not in os.environ: @@ -394,7 +394,7 @@ def main(): else: print(mlog.bold('Running unittests.')) print(flush=True) - cmd = mesonlib.python_command + ['run_unittests.py', '--backend=' + backend.name, '-v'] + cmd = mesonlib.python_command + ['run_unittests.py', '-v'] + backend_flags if options.failfast: cmd += ['--failfast'] returncode += subprocess_call(cmd, env=env) diff --git a/unittests/allplatformstests.py b/unittests/allplatformstests.py index 844f90907..c05cb339f 100644 --- a/unittests/allplatformstests.py +++ b/unittests/allplatformstests.py @@ -3460,7 +3460,7 @@ class AllPlatformTests(BasePlatformTests): subsub : YES User defined options - backend : ''' + self.backend.name + ''' + backend : ''' + self.backend_name + ''' libdir : lib prefix : /usr enabled_opt : enabled diff --git a/unittests/baseplatformtests.py b/unittests/baseplatformtests.py index 9e55f6e60..9ab808394 100644 --- a/unittests/baseplatformtests.py +++ b/unittests/baseplatformtests.py @@ -55,8 +55,10 @@ class BasePlatformTests(TestCase): src_root = str(PurePath(__file__).parents[1]) self.src_root = src_root # Get the backend - self.backend = getattr(Backend, os.environ['MESON_UNIT_TEST_BACKEND']) - self.meson_args = ['--backend=' + self.backend.name] + self.backend_name = os.environ['MESON_UNIT_TEST_BACKEND'] + backend_type = 'vs' if self.backend_name.startswith('vs') else self.backend_name + self.backend = getattr(Backend, backend_type) + self.meson_args = ['--backend=' + self.backend_name] self.meson_native_files = [] self.meson_cross_files = [] self.meson_command = python_command + [get_meson_script()]