diff options
author | Jussi Pakkanen <jpakkane@gmail.com> | 2018-07-09 21:16:11 +0300 |
---|---|---|
committer | Jussi Pakkanen <jpakkane@gmail.com> | 2018-07-09 23:14:59 +0200 |
commit | 09ad29ec560f2a05108694d909de30b5e3e58357 (patch) | |
tree | 2e39442dfcd8c1d58ab36378c2720bd193bec009 /run_unittests.py | |
parent | 8cfb8fd02c86e1667ded9a7841d77204f96a4a6d (diff) | |
download | meson-09ad29ec560f2a05108694d909de30b5e3e58357.zip meson-09ad29ec560f2a05108694d909de30b5e3e58357.tar.gz meson-09ad29ec560f2a05108694d909de30b5e3e58357.tar.bz2 |
Fix directory verification. Closes #3857.
Diffstat (limited to 'run_unittests.py')
-rwxr-xr-x | run_unittests.py | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/run_unittests.py b/run_unittests.py index 4a47d5e..df4603e 100755 --- a/run_unittests.py +++ b/run_unittests.py @@ -2406,6 +2406,24 @@ recommended as it is not supported on some platforms''') self.assertEqual(f.read().strip(), b'') self.assertRegex(out, r"DEPRECATION:.*\['array'\] is invalid.*dict") + def test_dirs(self): + with tempfile.TemporaryDirectory() as containing: + with tempfile.TemporaryDirectory(dir=containing) as srcdir: + mfile = os.path.join(srcdir, 'meson.build') + of = open(mfile, 'w') + of.write("project('foobar', 'c')\n") + of.close() + pc = subprocess.run(self.setup_command, + cwd=srcdir, + stdout=subprocess.PIPE, + stderr=subprocess.DEVNULL) + self.assertIn(b'Must specify at least one directory name', pc.stdout) + with tempfile.TemporaryDirectory(dir=srcdir) as builddir: + subprocess.run(self.setup_command, + check=True, + cwd=builddir, + stdout=subprocess.DEVNULL, + stderr=subprocess.DEVNULL) class FailureTests(BasePlatformTests): ''' |