From 3902bd4ef15ed1c50b008ba2e0e0dad79ff185f4 Mon Sep 17 00:00:00 2001 From: Xavier Claessens Date: Wed, 27 Oct 2021 14:33:54 -0400 Subject: Fix add_install_script() ignoring install_tag Fixes: #9454 --- unittests/allplatformstests.py | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) (limited to 'unittests/allplatformstests.py') diff --git a/unittests/allplatformstests.py b/unittests/allplatformstests.py index 3443076..aec832a 100644 --- a/unittests/allplatformstests.py +++ b/unittests/allplatformstests.py @@ -3896,17 +3896,19 @@ class AllPlatformTests(BasePlatformTests): Path(installpath, 'usr/share/out2.txt'), } - def do_install(tags=None): - extra_args = ['--tags', tags] if tags else [] - self._run(self.meson_command + ['install', '--dry-run', '--destdir', self.installdir] + extra_args, workdir=self.builddir) + def do_install(tags, expected_files, expected_scripts): + cmd = self.meson_command + ['install', '--dry-run', '--destdir', self.installdir] + cmd += ['--tags', tags] if tags else [] + stdout = self._run(cmd, workdir=self.builddir) installed = self.read_install_logs() - return sorted(installed) - - self.assertEqual(sorted(expected_devel), do_install('devel')) - self.assertEqual(sorted(expected_runtime), do_install('runtime')) - self.assertEqual(sorted(expected_custom), do_install('custom')) - self.assertEqual(sorted(expected_runtime_custom), do_install('runtime,custom')) - self.assertEqual(sorted(expected_all), do_install()) + self.assertEqual(sorted(expected_files), sorted(installed)) + self.assertEqual(expected_scripts, stdout.count('Running custom install script')) + + do_install('devel', expected_devel, 0) + do_install('runtime', expected_runtime, 0) + do_install('custom', expected_custom, 1) + do_install('runtime,custom', expected_runtime_custom, 1) + do_install(None, expected_all, 2) def test_introspect_install_plan(self): testdir = os.path.join(self.unit_test_dir, '98 install all targets') -- cgit v1.1