tests: Assert that mips64 kernel is detected as mips64 with no compilers

Reproduces: https://github.com/mesonbuild/meson/issues/12017
Signed-off-by: Simon McVittie <smcv@debian.org>
pull/12081/head
Simon McVittie 1 year ago committed by Eli Schwartz
parent b95ebf80b8
commit 61554ad37b
  1. 19
      unittests/internaltests.py

@ -1600,6 +1600,16 @@ class InternalTests(unittest.TestCase):
actual = mesonbuild.environment.detect_cpu_family({'c': cc})
self.assertEqual(actual, expected)
# machine_info_can_run calls detect_cpu_family with no compilers at all
with mock.patch(
'mesonbuild.environment.any_compiler_has_define',
mock.Mock(side_effect=AssertionError('Should not be called')),
):
for test, expected in [('mips64', 'mips64')]:
with self.subTest(test, has_compiler=False), mock_trial(test):
actual = mesonbuild.environment.detect_cpu_family({})
self.assertEqual(actual, expected)
def test_detect_cpu(self) -> None:
@contextlib.contextmanager
@ -1639,6 +1649,15 @@ class InternalTests(unittest.TestCase):
actual = mesonbuild.environment.detect_cpu({'c': cc})
self.assertEqual(actual, expected)
with mock.patch(
'mesonbuild.environment.any_compiler_has_define',
mock.Mock(side_effect=AssertionError('Should not be called')),
):
for test, expected in [('mips64', 'mips64')]:
with self.subTest(test, has_compiler=False), mock_trial(test):
actual = mesonbuild.environment.detect_cpu({})
self.assertEqual(actual, expected)
def test_interpreter_unpicklable(self) -> None:
build = mock.Mock()
build.environment = mock.Mock()

Loading…
Cancel
Save