aboutsummaryrefslogtreecommitdiff
path: root/run_unittests.py
diff options
context:
space:
mode:
authorXavier Claessens <xavier.claessens@collabora.com>2020-04-24 17:57:19 -0400
committerJussi Pakkanen <jpakkane@gmail.com>2021-02-04 16:24:38 +0000
commit95c079071118abc9078b0931ee86f51b1b4f8e05 (patch)
tree6535a45ede91198c5a346fd4c5b69dbffc4aebaa /run_unittests.py
parent673aff3595d04a82d431dc4903c95227481565ca (diff)
downloadmeson-95c079071118abc9078b0931ee86f51b1b4f8e05.zip
meson-95c079071118abc9078b0931ee86f51b1b4f8e05.tar.gz
meson-95c079071118abc9078b0931ee86f51b1b4f8e05.tar.bz2
minstall: Add --dry-run option
Closes: #1281
Diffstat (limited to 'run_unittests.py')
-rwxr-xr-xrun_unittests.py19
1 files changed, 14 insertions, 5 deletions
diff --git a/run_unittests.py b/run_unittests.py
index 2b8812a..da13753 100755
--- a/run_unittests.py
+++ b/run_unittests.py
@@ -2270,11 +2270,13 @@ class AllPlatformTests(BasePlatformTests):
expected = {installpath: 0}
for name in installpath.rglob('*'):
expected[name] = 0
- # Find logged files and directories
- with Path(self.builddir, 'meson-logs', 'install-log.txt').open() as f:
- logged = list(map(lambda l: Path(l.strip()),
- filter(lambda l: not l.startswith('#'),
- f.readlines())))
+ def read_logs():
+ # Find logged files and directories
+ with Path(self.builddir, 'meson-logs', 'install-log.txt').open() as f:
+ return list(map(lambda l: Path(l.strip()),
+ filter(lambda l: not l.startswith('#'),
+ f.readlines())))
+ logged = read_logs()
for name in logged:
self.assertTrue(name in expected, 'Log contains extra entry {}'.format(name))
expected[name] += 1
@@ -2283,6 +2285,13 @@ class AllPlatformTests(BasePlatformTests):
self.assertGreater(count, 0, 'Log is missing entry for {}'.format(name))
self.assertLess(count, 2, 'Log has multiple entries for {}'.format(name))
+ # Verify that with --dry-run we obtain the same logs but with nothing
+ # actually installed
+ windows_proof_rmtree(self.installdir)
+ self._run(self.meson_command + ['install', '--dry-run', '--destdir', self.installdir], workdir=self.builddir)
+ self.assertEqual(logged, read_logs())
+ self.assertFalse(os.path.exists(self.installdir))
+
def test_uninstall(self):
exename = os.path.join(self.installdir, 'usr/bin/prog' + exe_suffix)
testdir = os.path.join(self.common_test_dir, '8 install')