Start moving machine files to their own store.
This commit is contained in:
parent
e5aed6ac8f
commit
daa058e907
|
@ -0,0 +1,15 @@
|
|||
# SPDX-License-Identifier: Apache-2.0
|
||||
# Copyright 2013-2024 Contributors to the The Meson project
|
||||
|
||||
from . import mlog
|
||||
|
||||
class MachineFile:
|
||||
def __init__(self, fname):
|
||||
with open(fname, encoding='utf-8') as f:
|
||||
pass
|
||||
self.stuff = None
|
||||
|
||||
class MachineFileStore:
|
||||
def __init__(self, native_files, cross_files):
|
||||
self.native = [MachineFile(x) for x in native_files]
|
||||
self.cross = [MachineFile(x) for x in cross_files]
|
|
@ -12,7 +12,7 @@ import functools
|
|||
import threading
|
||||
import sys
|
||||
from itertools import chain
|
||||
from unittest import mock, skipIf, SkipTest
|
||||
from unittest import mock, skipIf, SkipTest, TestCase
|
||||
from pathlib import Path
|
||||
import typing as T
|
||||
|
||||
|
@ -23,6 +23,9 @@ import mesonbuild.envconfig
|
|||
import mesonbuild.environment
|
||||
import mesonbuild.coredata
|
||||
import mesonbuild.modules.gnome
|
||||
|
||||
from mesonbuild import machinefile
|
||||
|
||||
from mesonbuild.mesonlib import (
|
||||
MachineChoice, is_windows, is_osx, is_cygwin, is_haiku, is_sunos
|
||||
)
|
||||
|
@ -50,6 +53,14 @@ def is_real_gnu_compiler(path):
|
|||
out = subprocess.check_output([path, '--version'], universal_newlines=True, stderr=subprocess.STDOUT)
|
||||
return 'Free Software Foundation' in out
|
||||
|
||||
cross_dir = Path(__file__).parent.parent / 'cross'
|
||||
|
||||
class MachineFileStoreTests(TestCase):
|
||||
|
||||
def test_loading(self):
|
||||
store = machinefile.MachineFileStore([cross_dir / 'ubuntu-armhf.txt'], [], str(cross_dir))
|
||||
self.assertTrue(True)
|
||||
|
||||
class NativeFileTests(BasePlatformTests):
|
||||
|
||||
def setUp(self):
|
||||
|
|
Loading…
Reference in New Issue