aboutsummaryrefslogtreecommitdiff
path: root/run_unittests.py
diff options
context:
space:
mode:
authorDaniel Pirch <dpirch@gmail.com>2018-08-09 19:27:45 +0200
committerJussi Pakkanen <jpakkane@gmail.com>2018-08-17 00:33:38 +0300
commit6ecd31af19dc537983311796929a9dd690632999 (patch)
treebef19217113e7a5f9e17bddddb047aedddad2694 /run_unittests.py
parentb400cbe058df10bc37e628305c72c574177062e2 (diff)
downloadmeson-6ecd31af19dc537983311796929a9dd690632999.zip
meson-6ecd31af19dc537983311796929a9dd690632999.tar.gz
meson-6ecd31af19dc537983311796929a9dd690632999.tar.bz2
wraptool: fix manual selection of wrap file to promote
Fixed manually promoting wrap files with a full path, e.g. `meson wrap promote subprojects/s1/subprojects/projname.wrap`, which resulted in an error before (new test added: `./run_unittests.py AllPlatformTests.test_subproject_promotion_wrap`). Additionally, running promote with an invalid subproject path now fails properly. Before, it just silently did nothing (added to test: `./run_unittests.py AllPlatformTests.test_subproject_promotion`).
Diffstat (limited to 'run_unittests.py')
-rwxr-xr-xrun_unittests.py17
1 files changed, 17 insertions, 0 deletions
diff --git a/run_unittests.py b/run_unittests.py
index d768028..ab5d4b7 100755
--- a/run_unittests.py
+++ b/run_unittests.py
@@ -2094,6 +2094,9 @@ int main(int argc, char **argv) {
self.assertNotEqual(subprocess.call(self.wrap_command + ['promote', 'scommon'],
cwd=workdir,
stdout=subprocess.DEVNULL), 0)
+ self.assertNotEqual(subprocess.call(self.wrap_command + ['promote', 'invalid/path/to/scommon'],
+ cwd=workdir,
+ stderr=subprocess.DEVNULL), 0)
self.assertFalse(os.path.isdir(scommondir))
subprocess.check_call(self.wrap_command + ['promote', 'subprojects/s2/subprojects/scommon'], cwd=workdir)
self.assertTrue(os.path.isdir(scommondir))
@@ -2104,6 +2107,20 @@ int main(int argc, char **argv) {
self.init(workdir)
self.build()
+ def test_subproject_promotion_wrap(self):
+ testdir = os.path.join(self.unit_test_dir, '42 promote wrap')
+ workdir = os.path.join(self.builddir, 'work')
+ shutil.copytree(testdir, workdir)
+ spdir = os.path.join(workdir, 'subprojects')
+
+ ambiguous_wrap = os.path.join(spdir, 'ambiguous.wrap')
+ self.assertNotEqual(subprocess.call(self.wrap_command + ['promote', 'ambiguous'],
+ cwd=workdir,
+ stdout=subprocess.DEVNULL), 0)
+ self.assertFalse(os.path.isfile(ambiguous_wrap))
+ subprocess.check_call(self.wrap_command + ['promote', 'subprojects/s2/subprojects/ambiguous.wrap'], cwd=workdir)
+ self.assertTrue(os.path.isfile(ambiguous_wrap))
+
def test_warning_location(self):
tdir = os.path.join(self.unit_test_dir, '22 warning location')
out = self.init(tdir)