aboutsummaryrefslogtreecommitdiff
path: root/run_unittests.py
diff options
context:
space:
mode:
authorMichael Hirsch, Ph.D <10931741+scivision@users.noreply.github.com>2020-01-30 16:07:44 -0500
committerGitHub <noreply@github.com>2020-01-30 23:07:44 +0200
commit00f5dadd5b7d71c30bd7393d165a87f554eb92e5 (patch)
tree6a8f65c47b75ce0152b450dce40214190781135f /run_unittests.py
parent1682058decb5f16ce1b78121ee587c024e9cfa17 (diff)
downloadmeson-00f5dadd5b7d71c30bd7393d165a87f554eb92e5.zip
meson-00f5dadd5b7d71c30bd7393d165a87f554eb92e5.tar.gz
meson-00f5dadd5b7d71c30bd7393d165a87f554eb92e5.tar.bz2
Bugfix: sanitize_dir: use pathlib to handle case-insensitive filesystems (#6398)
Diffstat (limited to 'run_unittests.py')
-rwxr-xr-xrun_unittests.py21
1 files changed, 14 insertions, 7 deletions
diff --git a/run_unittests.py b/run_unittests.py
index 4c1d4b5..5388679 100755
--- a/run_unittests.py
+++ b/run_unittests.py
@@ -1783,7 +1783,8 @@ class AllPlatformTests(BasePlatformTests):
https://github.com/mesonbuild/meson/issues/1345
'''
testdir = os.path.join(self.common_test_dir, '90 default options')
- prefix = '/someabs'
+ # on Windows, /someabs is *not* an absolute path
+ prefix = 'x:/someabs' if is_windows() else '/someabs'
libdir = 'libdir'
extra_args = ['--prefix=' + prefix,
# This can just be a relative path, but we want to test
@@ -1804,16 +1805,25 @@ class AllPlatformTests(BasePlatformTests):
'''
testdir = os.path.join(self.common_test_dir, '1 trivial')
# libdir being inside prefix is ok
- args = ['--prefix', '/opt', '--libdir', '/opt/lib32']
+ if is_windows():
+ args = ['--prefix', 'x:/opt', '--libdir', 'x:/opt/lib32']
+ else:
+ args = ['--prefix', '/opt', '--libdir', '/opt/lib32']
self.init(testdir, extra_args=args)
self.wipe()
# libdir not being inside prefix is not ok
- args = ['--prefix', '/usr', '--libdir', '/opt/lib32']
+ if is_windows():
+ args = ['--prefix', 'x:/usr', '--libdir', 'x:/opt/lib32']
+ else:
+ args = ['--prefix', '/usr', '--libdir', '/opt/lib32']
self.assertRaises(subprocess.CalledProcessError, self.init, testdir, extra_args=args)
self.wipe()
# libdir must be inside prefix even when set via mesonconf
self.init(testdir)
- self.assertRaises(subprocess.CalledProcessError, self.setconf, '-Dlibdir=/opt', False)
+ if is_windows():
+ self.assertRaises(subprocess.CalledProcessError, self.setconf, '-Dlibdir=x:/opt', False)
+ else:
+ self.assertRaises(subprocess.CalledProcessError, self.setconf, '-Dlibdir=/opt', False)
def test_prefix_dependent_defaults(self):
'''
@@ -7310,14 +7320,11 @@ def main():
import pytest # noqa: F401
# Need pytest-xdist for `-n` arg
import xdist # noqa: F401
- if sys.version_info.major <= 3 and sys.version_info.minor <= 5:
- raise ImportError('pytest with python <= 3.5 is causing issues on the CI')
pytest_args = ['-n', 'auto', './run_unittests.py']
pytest_args += convert_args(sys.argv[1:])
return subprocess.run(python_command + ['-m', 'pytest'] + pytest_args).returncode
except ImportError:
print('pytest-xdist not found, using unittest instead')
- pass
# All attempts at locating pytest failed, fall back to plain unittest.
cases = ['InternalTests', 'DataTests', 'AllPlatformTests', 'FailureTests',
'PythonTests', 'NativeFileTests', 'RewriterTests', 'CrossFileTests',