diff options
| author | Eli Schwartz <eschwartz@archlinux.org> | 2023-08-17 23:56:51 -0400 |
|---|---|---|
| committer | Eli Schwartz <eschwartz@archlinux.org> | 2023-08-17 23:56:51 -0400 |
| commit | 84c8905d527893bedc673e8a036b8b2ec89368b4 (patch) | |
| tree | ffe8f20e45a5d6fdcc19927ae237c1bea2d769e0 /test cases/common/220 fs module | |
| parent | 1fd70a2a004900b7d97d9fc560e87d33266ecfed (diff) | |
| download | meson-84c8905d527893bedc673e8a036b8b2ec89368b4.tar.gz | |
Revert "Add fs.relative_to()"
This reverts commit f52bcaa27fc125ab9ae583af466ba99c164169f3.
It did not pass CI, and was merged anyway because there were two CI
errors in the same cygwin job. The other error was not the fault of this
commit, and since cygwin errors were glossed over because they were
"expected", the presence of a new error *added* by this commit was
overlooked.
Per the meson development policy, PRs which result in CI errors
can/should be reverted at will, no questions asked.
Diffstat (limited to 'test cases/common/220 fs module')
| -rw-r--r-- | test cases/common/220 fs module/meson.build | 25 | ||||
| -rw-r--r-- | test cases/common/220 fs module/subdir/btgt.c | 5 | ||||
| -rw-r--r-- | test cases/common/220 fs module/subdir/meson.build | 34 |
3 files changed, 1 insertions, 63 deletions
diff --git a/test cases/common/220 fs module/meson.build b/test cases/common/220 fs module/meson.build index 7f113d66e..b860fc8a3 100644 --- a/test cases/common/220 fs module/meson.build +++ b/test cases/common/220 fs module/meson.build @@ -1,4 +1,4 @@ -project('fs module test', 'c') +project('fs module test') is_windows = build_machine.system() == 'windows' @@ -139,29 +139,6 @@ assert(fs.name('foo/bar/baz.dll.a') == 'baz.dll.a', 'failed to get basename with 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') -# relative_to -if build_machine.system() == 'windows' - # strings - assert(fs.relative_to('c:\\prefix\\lib\\foo', 'c:\\prefix') == 'lib\\foo') - assert(fs.relative_to('c:\\prefix\\lib', 'c:\\prefix\\bin') == '..\\lib') - assert(fs.relative_to('c:\\proj1\\foo', 'd:\\proj1\\bar') == 'c:\\proj1\\foo') - assert(fs.relative_to('prefix\\lib\\foo', 'prefix') == 'lib\\foo') - assert(fs.relative_to('prefix\\lib', 'prefix\\bin') == '..\\lib') - assert(fs.relative_to('proj1\\foo', 'proj1\\bar') == '..\\foo') - assert(fs.relative_to('subdir/subdirfile.txt', meson.current_source_dir()) == 'subdir\\subdirfile.txt') - assert(fs.relative_to(files('meson.build'), files('subdir/meson.build')) == '..\\..\\meson.build') - assert(fs.relative_to(files('meson.build'), 'subdir/meson.build') == '..\\..\\meson.build') -else - # strings - assert(fs.relative_to('/prefix/lib/foo', '/prefix') == 'lib/foo') - assert(fs.relative_to('/prefix/lib', '/prefix/bin') == '../lib') - assert(fs.relative_to('prefix/lib/foo', 'prefix') == 'lib/foo') - assert(fs.relative_to('prefix/lib', 'prefix/bin') == '../lib') - assert(fs.relative_to('subdir/subdirfile.txt', meson.current_source_dir()) == 'subdir/subdirfile.txt') - assert(fs.relative_to(files('meson.build'), files('subdir/meson.build')) == '../../meson.build') - assert(fs.relative_to(files('meson.build'), 'subdir/meson.build') == '../../meson.build') -endif - subdir('subdir') subproject('subbie') diff --git a/test cases/common/220 fs module/subdir/btgt.c b/test cases/common/220 fs module/subdir/btgt.c deleted file mode 100644 index 8479e67d1..000000000 --- a/test cases/common/220 fs module/subdir/btgt.c +++ /dev/null @@ -1,5 +0,0 @@ -int -main(void) -{ - return 0; -} diff --git a/test cases/common/220 fs module/subdir/meson.build b/test cases/common/220 fs module/subdir/meson.build index a0f3091fa..0cd2475e9 100644 --- a/test cases/common/220 fs module/subdir/meson.build +++ b/test cases/common/220 fs module/subdir/meson.build @@ -4,37 +4,3 @@ assert(fs.is_samepath(meson.project_source_root(), '..'), 'is_samepath not detec assert(fs.is_samepath(meson.project_build_root(), meson.current_build_dir() / '..'), 'is_samepath not detecting same directory') assert(fs.is_samepath(subdirfiles[0], 'subdirfile.txt'), 'is_samepath not detecting same directory when using File and str') - -# More relative_to to test subdir/builddir components - -build_to_src = fs.relative_to(meson.current_source_dir(), meson.current_build_dir()) -src_to_build = fs.relative_to(meson.current_build_dir(), meson.current_source_dir()) - -btgt = executable('btgt', 'btgt.c') -ctgt = fs.copyfile('subdirfile.txt') - -if build_machine.system() == 'windows' - # Test that CustomTarget works - assert(fs.relative_to('subdirfile.txt', ctgt) == '..\\@0@\\subdirfile.txt'.format(build_to_src)) - assert(fs.relative_to(ctgt, 'subdirfile.txt') == '..\\@0@\\subdirfile.txt'.format(src_to_build)) - # Test that CustomTargetIndex works - assert(fs.relative_to('subdirfile.txt', ctgt[0]) == '..\\@0@\\subdirfile.txt'.format(build_to_src)) - assert(fs.relative_to(ctgt[0], 'subdirfile.txt') == '..\\@0@\\subdirfile.txt'.format(src_to_build)) - # Test that BuildTarget works - assert(fs.relative_to('subdirfile.txt', btgt) == '..\\@0@\\subdirfile.txt'.format(build_to_src)) - assert(fs.relative_to(btgt, 'subdirfile.txt') == '..\\@0@\\btgt.exe'.format(src_to_build)) -else - # Test that CustomTarget works - assert(fs.relative_to('subdirfile.txt', ctgt) == '../@0@/subdirfile.txt'.format(build_to_src)) - assert(fs.relative_to(ctgt, 'subdirfile.txt') == '../@0@/subdirfile.txt'.format(src_to_build)) - # Test that CustomTargetIndex works - assert(fs.relative_to('subdirfile.txt', ctgt[0]) == '../@0@/subdirfile.txt'.format(build_to_src)) - assert(fs.relative_to(ctgt[0], 'subdirfile.txt') == '../@0@/subdirfile.txt'.format(src_to_build)) - # Test that BuildTarget works - assert(fs.relative_to('subdirfile.txt', btgt) == '../@0@/subdirfile.txt'.format(build_to_src)) - if host_machine.system() == 'windows' - assert(fs.relative_to(btgt, 'subdirfile.txt') == '../@0@/btgt.exe'.format(src_to_build)) - else - assert(fs.relative_to(btgt, 'subdirfile.txt') == '../@0@/btgt'.format(src_to_build)) - endif -endif |
