Skip to content

Commit 7082dfe

Browse files
bonzinijpakkane
authored andcommitted
unittests: remove FakeCompilerOptions
It does not seem to be needed anymore, and the incomplete mock does not have for example the "yielding" attribute that is used by OptionStore.get_value_object_and_value_for. Signed-off-by: Paolo Bonzini <[email protected]>
1 parent dce9c55 commit 7082dfe

File tree

2 files changed

+1
-10
lines changed

2 files changed

+1
-10
lines changed

run_tests.py

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -135,10 +135,6 @@ class FakeBuild:
135135
def __init__(self, env):
136136
self.environment = env
137137

138-
class FakeCompilerOptions:
139-
def __init__(self):
140-
self.value = []
141-
142138
def get_fake_options(prefix: str = '') -> SharedCMDOptions:
143139
opts = T.cast('SharedCMDOptions', argparse.Namespace())
144140
opts.native_file = []
@@ -153,7 +149,6 @@ def get_fake_env(sdir: str = '', bdir: T.Optional[str] = None, prefix: str = '',
153149
if opts is None:
154150
opts = get_fake_options(prefix)
155151
env = Environment(sdir, bdir, opts)
156-
env.coredata.optstore.set_value_object(OptionKey('c_args'), FakeCompilerOptions())
157152
env.machines.host.cpu_family = 'x86_64' # Used on macOS inside find_library
158153
# Invalidate cache when using a different Environment object.
159154
clear_meson_configure_class_caches()

unittests/internaltests.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -44,10 +44,7 @@
4444
import mesonbuild.modules.pkgconfig
4545
from mesonbuild import utils
4646

47-
48-
from run_tests import (
49-
FakeCompilerOptions, get_fake_env, get_fake_options
50-
)
47+
from run_tests import get_fake_env, get_fake_options
5148

5249
from .helpers import *
5350

@@ -629,7 +626,6 @@ def create_static_lib(name):
629626
env = get_fake_env()
630627
compiler = detect_c_compiler(env, MachineChoice.HOST)
631628
env.coredata.compilers.host = {'c': compiler}
632-
env.coredata.optstore.set_value_object(OptionKey('c_link_args'), FakeCompilerOptions())
633629
p1 = Path(tmpdir) / '1'
634630
p2 = Path(tmpdir) / '2'
635631
p1.mkdir()

0 commit comments

Comments
 (0)