aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEli Schwartz <eschwartz@archlinux.org>2021-03-18 21:29:03 -0400
committerEli Schwartz <eschwartz@archlinux.org>2021-03-18 21:50:38 -0400
commitf7b0238ed67fc0c9e3cef38090983e33b40fa205 (patch)
tree9dcd00030e33e1babc65d28fcf7f2bebd1b2b7fd
parent0ad870f3dc970e4cee8cafc47034abf973de4113 (diff)
downloadmeson-f7b0238ed67fc0c9e3cef38090983e33b40fa205.zip
meson-f7b0238ed67fc0c9e3cef38090983e33b40fa205.tar.gz
meson-f7b0238ed67fc0c9e3cef38090983e33b40fa205.tar.bz2
add test case for installed targets uninstalling a single directory
-rwxr-xr-xrun_unittests.py2
-rwxr-xr-xtest cases/common/8 install/gendir.py8
-rw-r--r--test cases/common/8 install/meson.build6
-rw-r--r--test cases/common/8 install/test.json7
4 files changed, 20 insertions, 3 deletions
diff --git a/run_unittests.py b/run_unittests.py
index 82689be..ef4a786 100755
--- a/run_unittests.py
+++ b/run_unittests.py
@@ -2496,6 +2496,7 @@ class AllPlatformTests(BasePlatformTests):
def test_uninstall(self):
exename = os.path.join(self.installdir, 'usr/bin/prog' + exe_suffix)
+ dirname = os.path.join(self.installdir, 'usr/share/dir')
testdir = os.path.join(self.common_test_dir, '8 install')
self.init(testdir)
self.assertPathDoesNotExist(exename)
@@ -2503,6 +2504,7 @@ class AllPlatformTests(BasePlatformTests):
self.assertPathExists(exename)
self.uninstall()
self.assertPathDoesNotExist(exename)
+ self.assertPathDoesNotExist(dirname)
def test_forcefallback(self):
testdir = os.path.join(self.unit_test_dir, '31 forcefallback')
diff --git a/test cases/common/8 install/gendir.py b/test cases/common/8 install/gendir.py
new file mode 100755
index 0000000..b42327d
--- /dev/null
+++ b/test cases/common/8 install/gendir.py
@@ -0,0 +1,8 @@
+#!/usr/bin/env python3
+
+import sys, os
+
+dirname = sys.argv[1]
+fname = os.path.join(dirname, 'file.txt')
+os.makedirs(dirname, exist_ok=True)
+open(fname, 'w').close()
diff --git a/test cases/common/8 install/meson.build b/test cases/common/8 install/meson.build
index 12ad389..6eb5ba5 100644
--- a/test cases/common/8 install/meson.build
+++ b/test cases/common/8 install/meson.build
@@ -2,3 +2,9 @@ project('install test', 'c', default_options : ['libdir=libtest'])
stlib = static_library('stat', 'stat.c', install : true)
exe = executable('prog', 'prog.c', install : true)
+
+dirtarget = custom_target('dirtarget',
+ output: ['dir'],
+ install: true,
+ command: [find_program('gendir.py'), '@OUTPUT@'],
+ install_dir: get_option('datadir'))
diff --git a/test cases/common/8 install/test.json b/test cases/common/8 install/test.json
index d2b1c63..b31f287 100644
--- a/test cases/common/8 install/test.json
+++ b/test cases/common/8 install/test.json
@@ -1,8 +1,9 @@
{
"installed": [
- { "type": "exe", "file": "usr/bin/prog" },
- { "type": "pdb", "file": "usr/bin/prog" },
- { "type": "file", "file": "usr/libtest/libstat.a" }
+ { "type": "exe", "file": "usr/bin/prog" },
+ { "type": "pdb", "file": "usr/bin/prog" },
+ { "type": "file", "file": "usr/share/dir/file.txt" },
+ { "type": "file", "file": "usr/libtest/libstat.a" }
],
"do_not_set_opts": ["libdir"]
}