diff options
author | Nirbheek Chauhan <nirbheek@centricular.com> | 2021-10-30 18:54:04 +0530 |
---|---|---|
committer | Nirbheek Chauhan <nirbheek.chauhan@gmail.com> | 2021-10-31 19:22:36 +0530 |
commit | 04ae1cfb7999e25f476f84572ff0ad853629346c (patch) | |
tree | 16e9c8f4b1a473f28b5f54a050196f8c6f4394ec /unittests/linuxliketests.py | |
parent | 2046593825d03c348fb09430e38145d92d9d6b94 (diff) | |
download | meson-04ae1cfb7999e25f476f84572ff0ad853629346c.zip meson-04ae1cfb7999e25f476f84572ff0ad853629346c.tar.gz meson-04ae1cfb7999e25f476f84572ff0ad853629346c.tar.bz2 |
Fix cygwin test failure due to shortpath usage
Two tests are failing on Cygwin because the argument is passed as
a long-path and the Path is ending up as a short-path:
AllPlatformTests.test_run_target_files_path
Traceback (most recent call last):
File "/cygdrive/d/a/meson/meson/test cases/common/51 run target/check-env.py", line 22, in <module>
assert build_root == env_build_root
AssertionError
SubprojectsCommandTests.test_purge
> self.assertEqual(deleting(out), sorted([
str(self.subprojects_dir / 'redirect.wrap'),
str(self.subprojects_dir / 'sub_file'),
str(self.subprojects_dir / 'sub_git'),
]))
E AssertionError: Lists differ: ['/cygdrive/c/Users/runneradmin/AppData/Local/Temp/tmpeaa2a49[205 chars]git'] != ['/cygdrive/c/Users/RUNNER~1/AppData/Local/Temp/tmpeaa2a49z/s[196 chars]git']
[...]
['/cygdrive/c/Users/runneradmin/AppData/Local/Temp/tmpeaa2a49z/src/subprojects/redirect.wrap',
^^^^^^^^^^^
['/cygdrive/c/Users/RUNNER~1/AppData/Local/Temp/tmpeaa2a49z/src/subprojects/redirect.wrap',
^^^^^^^^
The fix is to not use the tempdir for all tests, but only for tests
that check the mode.
Diffstat (limited to 'unittests/linuxliketests.py')
-rw-r--r-- | unittests/linuxliketests.py | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/unittests/linuxliketests.py b/unittests/linuxliketests.py index 75888b3..0f99f01 100644 --- a/unittests/linuxliketests.py +++ b/unittests/linuxliketests.py @@ -574,6 +574,8 @@ class LinuxlikeTests(BasePlatformTests): Test that files installed by these tests have the correct permissions. Can't be an ordinary test because our installed_files.txt is very basic. ''' + if is_cygwin(): + self.new_builddir_in_tempdir() # Test file modes testdir = os.path.join(self.common_test_dir, '12 data') self.init(testdir) @@ -626,6 +628,8 @@ class LinuxlikeTests(BasePlatformTests): ''' Test that files are installed with correct permissions using install_mode. ''' + if is_cygwin(): + self.new_builddir_in_tempdir() testdir = os.path.join(self.common_test_dir, '190 install_mode') self.init(testdir) self.build() @@ -664,6 +668,8 @@ class LinuxlikeTests(BasePlatformTests): install umask of 022, regardless of the umask at time the worktree was checked out or the build was executed. ''' + if is_cygwin(): + self.new_builddir_in_tempdir() # Copy source tree to a temporary directory and change permissions # there to simulate a checkout with umask 002. orig_testdir = os.path.join(self.unit_test_dir, '26 install umask') |