diff options
author | Xavier Claessens <xavier.claessens@collabora.com> | 2020-09-28 08:49:41 -0400 |
---|---|---|
committer | Xavier Claessens <xavier.claessens@collabora.com> | 2020-09-28 11:22:38 -0400 |
commit | 7176b74fd60fb4726826c46c545c2ed25c26cd20 (patch) | |
tree | dd92b930a06c1f6d8c7bb8ba5d4088ad0fb3de3b /test cases/common | |
parent | 55ea461993db23c8a68053a5f499fda7f65df9b6 (diff) | |
download | meson-7176b74fd60fb4726826c46c545c2ed25c26cd20.zip meson-7176b74fd60fb4726826c46c545c2ed25c26cd20.tar.gz meson-7176b74fd60fb4726826c46c545c2ed25c26cd20.tar.bz2 |
Add meson.project_build/source_root() methods
Diffstat (limited to 'test cases/common')
4 files changed, 11 insertions, 2 deletions
diff --git a/test cases/common/227 fs module/meson.build b/test cases/common/227 fs module/meson.build index cff0987..f090d35 100644 --- a/test cases/common/227 fs module/meson.build +++ b/test cases/common/227 fs module/meson.build @@ -96,6 +96,9 @@ f1 = 'meson.build' f2 = 'subdir/../meson.build' assert(fs.is_samepath(f1, f2), 'is_samepath not detercting same files') assert(fs.is_samepath(meson.source_root(), 'subdir/..'), 'is_samepath not detecting same directory') +assert(fs.is_samepath(meson.project_source_root(), 'subdir/..'), 'is_samepath not detecting same directory') +# This fails with python3.5. It can be uncommented when we depend on python >= 3.6 +#assert(fs.is_samepath(meson.project_build_root(), meson.current_build_dir() / 'subdir/..'), 'is_samepath not detecting same directory') assert(not fs.is_samepath(f1, 'subdir/subdirfile.txt'), 'is_samepath known bad comparison') assert(not fs.is_samepath('not-a-path', f2), 'is_samepath should not error if path(s) do not exist') @@ -111,3 +114,5 @@ assert(fs.stem('foo/bar/baz.dll') == 'baz', 'failed to get stem with suffix') assert(fs.stem('foo/bar/baz.dll.a') == 'baz.dll', 'failed to get stem with compound suffix') subdir('subdir') + +subproject('subbie') diff --git a/test cases/common/227 fs module/subdir/meson.build b/test cases/common/227 fs module/subdir/meson.build index ec6f102..dc04b41 100644 --- a/test cases/common/227 fs module/subdir/meson.build +++ b/test cases/common/227 fs module/subdir/meson.build @@ -1 +1,3 @@ assert(fs.exists('subdirfile.txt'), 'Subdir file lookup is broken.') +assert(fs.is_samepath(meson.project_source_root(), '..'), 'is_samepath not detecting same directory') +assert(fs.is_samepath(meson.project_build_root(), meson.current_build_dir() / '..'), 'is_samepath not detecting same directory') diff --git a/test cases/common/227 fs module/subprojects/subbie/meson.build b/test cases/common/227 fs module/subprojects/subbie/meson.build index 55fc286..ca6d36b 100644 --- a/test cases/common/227 fs module/subprojects/subbie/meson.build +++ b/test cases/common/227 fs module/subprojects/subbie/meson.build @@ -3,7 +3,7 @@ project('subbie') fs = import('fs') assert(fs.exists('subprojectfile.txt'), 'Subproject root file not found.') +assert(fs.is_samepath(meson.project_source_root(), meson.current_source_dir()), 'is_samepath not detecting same directory') +assert(fs.is_samepath(meson.project_build_root(), meson.current_build_dir()), 'is_samepath not detecting same directory') subdir('subsub') - -subproject('subbie') diff --git a/test cases/common/227 fs module/subprojects/subbie/subsub/meson.build b/test cases/common/227 fs module/subprojects/subbie/subsub/meson.build index cf9a271..4ac68ae 100644 --- a/test cases/common/227 fs module/subprojects/subbie/subsub/meson.build +++ b/test cases/common/227 fs module/subprojects/subbie/subsub/meson.build @@ -1 +1,3 @@ assert(fs.exists('subsubfile.txt'), 'Subproject subdir lookup failed.') +assert(fs.is_samepath(meson.project_source_root(), meson.current_source_dir() / '..'), 'is_samepath not detecting same directory') +assert(fs.is_samepath(meson.project_build_root(), meson.current_build_dir() / '..'), 'is_samepath not detecting same directory') |