add test case for installed targets uninstalling a single directory

pull/8555/head
Eli Schwartz 4 years ago
parent 0ad870f3dc
commit f7b0238ed6
No known key found for this signature in database
GPG Key ID: CEB167EFB5722BD6
  1. 2
      run_unittests.py
  2. 8
      test cases/common/8 install/gendir.py
  3. 6
      test cases/common/8 install/meson.build
  4. 7
      test cases/common/8 install/test.json

@ -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')

@ -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()

@ -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'))

@ -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"]
}

Loading…
Cancel
Save