aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaolo Bonzini <pbonzini@redhat.com>2021-02-17 11:47:20 +0100
committerXavier Claessens <xclaesse@gmail.com>2021-02-17 12:10:05 -0500
commit2b48d75c7e86d77b24518e3584576d298d41b6fb (patch)
tree17d9d878dd028538ad943e2f07088e1121001641
parent6c1467db272c4700ae79f74c3541f6ccc4814138 (diff)
downloadmeson-2b48d75c7e86d77b24518e3584576d298d41b6fb.zip
meson-2b48d75c7e86d77b24518e3584576d298d41b6fb.tar.gz
meson-2b48d75c7e86d77b24518e3584576d298d41b6fb.tar.bz2
mtest: use / as path separator for ninja targets
os.path.relpath(f, wd) returns path with \ seperator on Windows, but ninja targets always uses / separator. See for example https://gitlab.freedesktop.org/ocrete/libnice/-/jobs/7348274. Analyzed-by: Xavier Claessens <xavier.claessens@collabora.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
-rw-r--r--mesonbuild/mtest.py8
1 files changed, 7 insertions, 1 deletions
diff --git a/mesonbuild/mtest.py b/mesonbuild/mtest.py
index 6b3eb6f..95ad77b 100644
--- a/mesonbuild/mtest.py
+++ b/mesonbuild/mtest.py
@@ -1887,6 +1887,12 @@ def list_tests(th: TestHarness) -> bool:
return not tests
def rebuild_deps(wd: str, tests: T.List[TestSerialisation]) -> bool:
+ def convert_path_to_target(path: str) -> str:
+ path = os.path.relpath(path, wd)
+ if os.sep != '/':
+ path = path.replace(os.sep, '/')
+ return path
+
if not (Path(wd) / 'build.ninja').is_file():
print('Only ninja backend is supported to rebuild tests before running them.')
return True
@@ -1901,7 +1907,7 @@ def rebuild_deps(wd: str, tests: T.List[TestSerialisation]) -> bool:
intro_targets = dict() # type: T.Dict[str, T.List[str]]
for target in load_info_file(get_infodir(wd), kind='targets'):
intro_targets[target['id']] = [
- os.path.relpath(f, wd)
+ convert_path_to_target(f)
for f in target['filename']]
for t in tests:
for d in t.depends: