From 03f6d131f1459c9577f4cf61386df98b6999c51f Mon Sep 17 00:00:00 2001 From: Jussi Pakkanen Date: Mon, 4 May 2020 14:37:05 +0300 Subject: [PATCH] Add regression test for libdir reset. --- run_unittests.py | 11 +++++++++++ test cases/unit/75 subdir libdir/meson.build | 2 ++ .../75 subdir libdir/subprojects/flub/meson.build | 1 + 3 files changed, 14 insertions(+) create mode 100644 test cases/unit/75 subdir libdir/meson.build create mode 100644 test cases/unit/75 subdir libdir/subprojects/flub/meson.build diff --git a/run_unittests.py b/run_unittests.py index fa61a6c8a..cb553a7d9 100755 --- a/run_unittests.py +++ b/run_unittests.py @@ -6615,6 +6615,17 @@ class LinuxCrossArmTests(BasePlatformTests): return self.assertTrue(False, 'Option libdir not in introspect data.') + def test_cross_libdir_subproject(self): + # Guard against a regression where calling "subproject" + # would reset the value of libdir to its default value. + testdir = os.path.join(self.unit_test_dir, '75 subdir libdir') + self.init(testdir, extra_args=['--libdir=fuf']) + for i in self.introspect('--buildoptions'): + if i['name'] == 'libdir': + self.assertEqual(i['value'], 'fuf') + return + self.assertTrue(False, 'Libdir specified on command line gets reset.') + def test_std_remains(self): # C_std defined in project options must be in effect also when cross compiling. testdir = os.path.join(self.unit_test_dir, '51 noncross options') diff --git a/test cases/unit/75 subdir libdir/meson.build b/test cases/unit/75 subdir libdir/meson.build new file mode 100644 index 000000000..5099c91c7 --- /dev/null +++ b/test cases/unit/75 subdir libdir/meson.build @@ -0,0 +1,2 @@ +project('toplevel', 'c') +subproject('flub') diff --git a/test cases/unit/75 subdir libdir/subprojects/flub/meson.build b/test cases/unit/75 subdir libdir/subprojects/flub/meson.build new file mode 100644 index 000000000..7bfd2c553 --- /dev/null +++ b/test cases/unit/75 subdir libdir/subprojects/flub/meson.build @@ -0,0 +1 @@ +project('subflub', 'c')