tests/common/227: don't have symlink in Git

Windows Git users with symlinks have a constantly dirty repo from
this "a_symlink". This change generates a symlink in the build directory
when the test is run.
pull/7043/merge
Michael Hirsch 4 years ago committed by Nirbheek Chauhan
parent 6006987ce5
commit 3c02cccd5b
  1. 1
      test cases/common/227 fs module/a_symlink
  2. 6
      test cases/common/227 fs module/meson.build

@ -18,7 +18,9 @@ assert(not fs.exists('nonexisting'), 'Nonexisting file was found.')
is_git_checkout = fs.exists('../../../.git')
if not is_windows and build_machine.system() != 'cygwin' and is_git_checkout
assert(fs.is_symlink('a_symlink'), 'Symlink not detected.')
symlink = meson.current_build_dir() / 'a_symlink'
run_command('ln', '-s', meson.current_source_dir() / 'meson.build', symlink)
assert(fs.is_symlink(symlink), 'Symlink not detected.')
assert(not fs.is_symlink('meson.build'), 'Regular file detected as symlink.')
endif
@ -104,7 +106,7 @@ assert(not fs.is_samepath(f1, 'subdir/subdirfile.txt'), 'is_samepath known bad c
assert(not fs.is_samepath('not-a-path', f2), 'is_samepath should not error if path(s) do not exist')
if not is_windows and build_machine.system() != 'cygwin' and is_git_checkout
assert(fs.is_samepath('a_symlink', 'meson.build'), 'symlink is_samepath fail')
assert(fs.is_samepath(symlink, 'meson.build'), 'symlink is_samepath fail')
endif
# parts of path

Loading…
Cancel
Save