diff options
author | Michael Hirsch <scivision@users.noreply.github.com> | 2020-07-24 17:02:06 -0400 |
---|---|---|
committer | Nirbheek Chauhan <nirbheek.chauhan@gmail.com> | 2020-08-04 20:33:47 +0000 |
commit | 3c02cccd5b2c6ffe9fa17541347ec750164d350f (patch) | |
tree | 4a5900eb5d0a1f4145d1a7fb80e6894f82e4275d | |
parent | 6006987ce5081534a129ee2d9d55d993c7a76b29 (diff) | |
download | meson-3c02cccd5b2c6ffe9fa17541347ec750164d350f.zip meson-3c02cccd5b2c6ffe9fa17541347ec750164d350f.tar.gz meson-3c02cccd5b2c6ffe9fa17541347ec750164d350f.tar.bz2 |
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.
l--------- | test cases/common/227 fs module/a_symlink | 1 | ||||
-rw-r--r-- | test cases/common/227 fs module/meson.build | 6 |
2 files changed, 4 insertions, 3 deletions
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 25d053a..0000000 --- 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 a732768..038fa62 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 |