Browse Source

msubprojects: Fix unit tests on Windows

tags/0.56.0.rc1
Xavier Claessens Nirbheek Chauhan 1 month ago
parent
commit
17f07a53d0
2 changed files with 6 additions and 5 deletions
  1. +2
    -1
      mesonbuild/msubprojects.py
  2. +4
    -4
      run_unittests.py

+ 2
- 1
mesonbuild/msubprojects.py View File

@@ -1,5 +1,6 @@
import os, subprocess
import argparse
from pathlib import Path

from . import mlog
from .mesonlib import quiet_git, verbose_git, GitException, Popen_safe, MesonException
@@ -338,7 +339,7 @@ def run(options):
for wrap in wraps:
if types and wrap.type not in types:
continue
dirname = os.path.join(subprojects_dir, wrap.directory)
dirname = Path(subprojects_dir, wrap.directory).as_posix()
if not options.subprojects_func(wrap, dirname, options):
failures.append(wrap.name)
if failures:


+ 4
- 4
run_unittests.py View File

@@ -9125,13 +9125,13 @@ class SubprojectsCommandTests(BasePlatformTests):

dummy_cmd = ['true']
out = self._subprojects_cmd(['foreach'] + dummy_cmd)
self.assertEqual(ran_in(out), sorted(['./subprojects/sub_file', './subprojects/sub_git', './subprojects/sub_git_no_wrap']))
self.assertEqual(ran_in(out), sorted(['subprojects/sub_file', 'subprojects/sub_git', 'subprojects/sub_git_no_wrap']))
out = self._subprojects_cmd(['foreach', '--types', 'git,file'] + dummy_cmd)
self.assertEqual(ran_in(out), sorted(['./subprojects/sub_file', './subprojects/sub_git']))
self.assertEqual(ran_in(out), sorted(['subprojects/sub_file', 'subprojects/sub_git']))
out = self._subprojects_cmd(['foreach', '--types', 'file'] + dummy_cmd)
self.assertEqual(ran_in(out), ['./subprojects/sub_file'])
self.assertEqual(ran_in(out), ['subprojects/sub_file'])
out = self._subprojects_cmd(['foreach', '--types', 'git'] + dummy_cmd)
self.assertEqual(ran_in(out), ['./subprojects/sub_git'])
self.assertEqual(ran_in(out), ['subprojects/sub_git'])

def _clang_at_least(compiler, minver: str, apple_minver: str) -> bool:
"""


Loading…
Cancel
Save