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