From efd1ccddc747794a83021c1b825dec94cff60a94 Mon Sep 17 00:00:00 2001 From: Jussi Pakkanen Date: Mon, 30 Dec 2019 00:19:26 +0200 Subject: Only run symlink test from git checkout. --- test cases/common/227 fs module/meson.build | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/test cases/common/227 fs module/meson.build b/test cases/common/227 fs module/meson.build index ef92df1..8795ee0 100644 --- a/test cases/common/227 fs module/meson.build +++ b/test cases/common/227 fs module/meson.build @@ -7,7 +7,17 @@ fs = import('fs') assert(fs.exists('meson.build'), 'Existing file reported as missing.') assert(not fs.exists('nonexisting'), 'Nonexisting file was found.') -if not is_windows and build_machine.system() != 'cygwin' +# When one creates a source release with sdist, Python +# does not store symlinks in the archive as native symlinks. +# Thus the extracted archive does not contain them either. +# Sadly this means that we can only execute the symlink test when +# running from a git checkout because otherwise we'd need to +# do postprocessing on the generated archive before actual release. +# That is both nonstandard an error prone and having symlinks in +# the archive would probably break on Windows anyway. +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.') assert(not fs.is_symlink('meson.build'), 'Regular file detected as symlink.') endif -- cgit v1.1