aboutsummaryrefslogtreecommitdiff
path: root/run_unittests.py
diff options
context:
space:
mode:
authorNirbheek Chauhan <nirbheek@centricular.com>2019-07-12 13:10:30 +0530
committerJussi Pakkanen <jpakkane@gmail.com>2019-07-12 21:49:48 +0300
commit264533cb67261bcf424f8f84e3a32b43d1704a02 (patch)
treed480a6ae39593caa03b973dab58891c9eda7c855 /run_unittests.py
parentd5cb1c2f19d7109a8269724f19ee71273afd4493 (diff)
downloadmeson-264533cb67261bcf424f8f84e3a32b43d1704a02.zip
meson-264533cb67261bcf424f8f84e3a32b43d1704a02.tar.gz
meson-264533cb67261bcf424f8f84e3a32b43d1704a02.tar.bz2
unit tests: Don't keep builddirs inside source tree on Cygwin
Seems to cause the umask tests to fail: https://github.com/mesonbuild/meson/pull/5546#issuecomment-509666523
Diffstat (limited to 'run_unittests.py')
-rwxr-xr-xrun_unittests.py10
1 files changed, 9 insertions, 1 deletions
diff --git a/run_unittests.py b/run_unittests.py
index d4e6735..306c221 100755
--- a/run_unittests.py
+++ b/run_unittests.py
@@ -1199,9 +1199,17 @@ class BasePlatformTests(unittest.TestCase):
self.builddirs.append(self.builddir)
def new_builddir(self):
+ if not is_cygwin():
+ # Keep builddirs inside the source tree so that virus scanners
+ # don't complain
+ newdir = tempfile.mkdtemp(dir=os.getcwd())
+ else:
+ # But not on Cygwin because that breaks the umask tests. See:
+ # https://github.com/mesonbuild/meson/pull/5546#issuecomment-509666523
+ newdir = tempfile.mkdtemp()
# In case the directory is inside a symlinked directory, find the real
# path otherwise we might not find the srcdir from inside the builddir.
- newdir = os.path.realpath(tempfile.mkdtemp(dir=os.getcwd()))
+ newdir = os.path.realpath(newdir)
self.change_builddir(newdir)
def _print_meson_log(self):