summaryrefslogtreecommitdiff
path: root/unittests
diff options
context:
space:
mode:
authorCharles Brunet <charles.brunet@optelgroup.com>2024-03-06 14:10:08 -0500
committerDylan Baker <dylan@pnwbakers.com>2024-03-10 13:09:32 -0700
commitf9479787a01106235e14d2a08a74352f4b1177ef (patch)
treed46c28c64c07d8d11322e95ec0404cf8282b7088 /unittests
parent9e270f030f3016be2a419b698b8062e5ed5373b8 (diff)
downloadmeson-f9479787a01106235e14d2a08a74352f4b1177ef.tar.gz
fix reconfigure subproject base options
Diffstat (limited to 'unittests')
-rw-r--r--unittests/allplatformstests.py14
-rw-r--r--unittests/platformagnostictests.py4
2 files changed, 10 insertions, 8 deletions
diff --git a/unittests/allplatformstests.py b/unittests/allplatformstests.py
index 2475b17f9..0e5637587 100644
--- a/unittests/allplatformstests.py
+++ b/unittests/allplatformstests.py
@@ -944,7 +944,7 @@ class AllPlatformTests(BasePlatformTests):
testdir = os.path.join("test cases/cython", '2 generated sources')
env = get_fake_env(testdir, self.builddir, self.prefix)
try:
- detect_compiler_for(env, "cython", MachineChoice.HOST, True)
+ detect_compiler_for(env, "cython", MachineChoice.HOST, True, '')
except EnvironmentException:
raise SkipTest("Cython is not installed")
self.init(testdir)
@@ -969,7 +969,7 @@ class AllPlatformTests(BasePlatformTests):
testdir = os.path.join("test cases/cython", '2 generated sources')
env = get_fake_env(testdir, self.builddir, self.prefix)
try:
- cython = detect_compiler_for(env, "cython", MachineChoice.HOST, True)
+ cython = detect_compiler_for(env, "cython", MachineChoice.HOST, True, '')
if not version_compare(cython.version, '>=0.29.33'):
raise SkipTest('Cython is too old')
except EnvironmentException:
@@ -2355,7 +2355,7 @@ class AllPlatformTests(BasePlatformTests):
env = get_fake_env()
for l in ['cpp', 'cs', 'd', 'java', 'cuda', 'fortran', 'objc', 'objcpp', 'rust', 'vala']:
try:
- comp = detect_compiler_for(env, l, MachineChoice.HOST, True)
+ comp = detect_compiler_for(env, l, MachineChoice.HOST, True, '')
with tempfile.TemporaryDirectory() as d:
comp.sanity_check(d, env)
langs.append(l)
@@ -2373,7 +2373,7 @@ class AllPlatformTests(BasePlatformTests):
if is_windows() and lang == 'fortran' and target_type == 'library':
# non-Gfortran Windows Fortran compilers do not do shared libraries in a Fortran standard way
# see "test cases/fortran/6 dynamic"
- fc = detect_compiler_for(env, 'fortran', MachineChoice.HOST, True)
+ fc = detect_compiler_for(env, 'fortran', MachineChoice.HOST, True, '')
if fc.get_id() in {'intel-cl', 'pgi'}:
continue
# test empty directory
@@ -4433,18 +4433,18 @@ class AllPlatformTests(BasePlatformTests):
env = get_fake_env()
# Get the compiler so we know which compiler class to mock.
- cc = detect_compiler_for(env, 'c', MachineChoice.HOST, True)
+ cc = detect_compiler_for(env, 'c', MachineChoice.HOST, True, '')
cc_type = type(cc)
# Test a compiler that acts as a linker
with mock.patch.object(cc_type, 'INVOKES_LINKER', True):
- cc = detect_compiler_for(env, 'c', MachineChoice.HOST, True)
+ cc = detect_compiler_for(env, 'c', MachineChoice.HOST, True, '')
link_args = env.coredata.get_external_link_args(cc.for_machine, cc.language)
self.assertEqual(sorted(link_args), sorted(['-DCFLAG', '-flto']))
# And one that doesn't
with mock.patch.object(cc_type, 'INVOKES_LINKER', False):
- cc = detect_compiler_for(env, 'c', MachineChoice.HOST, True)
+ cc = detect_compiler_for(env, 'c', MachineChoice.HOST, True, '')
link_args = env.coredata.get_external_link_args(cc.for_machine, cc.language)
self.assertEqual(sorted(link_args), sorted(['-flto']))
diff --git a/unittests/platformagnostictests.py b/unittests/platformagnostictests.py
index a6db17341..b75a78052 100644
--- a/unittests/platformagnostictests.py
+++ b/unittests/platformagnostictests.py
@@ -282,9 +282,11 @@ class PlatformAgnosticTests(BasePlatformTests):
self.assertIn('\nMessage: b_ndebug: true\n', out)
self.assertIn('\nMessage: c_std: c89\n', out)
- out = self.init(testdir, extra_args=['--reconfigure', '-Db_ndebug=if-release', '-Dsub:b_ndebug=false', '-Dc_std=c99'])
+ out = self.init(testdir, extra_args=['--reconfigure', '-Db_ndebug=if-release', '-Dsub:b_ndebug=false', '-Dc_std=c99', '-Dsub:c_std=c11'])
self.assertIn('\nMessage: b_ndebug: if-release\n', out)
self.assertIn('\nMessage: c_std: c99\n', out)
+ self.assertIn('\nsub| Message: b_ndebug: false\n', out)
+ self.assertIn('\nsub| Message: c_std: c11\n', out)
def test_setup_with_unknown_option(self):
testdir = os.path.join(self.common_test_dir, '1 trivial')