From 3c02cccd5b2c6ffe9fa17541347ec750164d350f Mon Sep 17 00:00:00 2001 From: Michael Hirsch Date: Fri, 24 Jul 2020 17:02:06 -0400 Subject: [PATCH] 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. --- test cases/common/227 fs module/a_symlink | 1 - test cases/common/227 fs module/meson.build | 6 ++++-- 2 files changed, 4 insertions(+), 3 deletions(-) delete mode 120000 test cases/common/227 fs module/a_symlink diff --git a/test cases/common/227 fs module/a_symlink b/test cases/common/227 fs module/a_symlink deleted file mode 120000 index 25d053a52..000000000 --- a/test cases/common/227 fs module/a_symlink +++ /dev/null @@ -1 +0,0 @@ -meson.build \ No newline at end of file diff --git a/test cases/common/227 fs module/meson.build b/test cases/common/227 fs module/meson.build index a73276826..038fa62c3 100644 --- a/test cases/common/227 fs module/meson.build +++ b/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