From 5e93393cd912f08dd6b561b78f50a83fef430097 Mon Sep 17 00:00:00 2001 From: Nirbheek Chauhan Date: Sun, 19 Aug 2018 20:27:34 +0530 Subject: Test that system shlibs with undefined symbols can be found --- run_tests.py | 36 ++++++++++++++++++++++++++---------- 1 file changed, 26 insertions(+), 10 deletions(-) (limited to 'run_tests.py') diff --git a/run_tests.py b/run_tests.py index 6e441d3..a5fd7a5 100755 --- a/run_tests.py +++ b/run_tests.py @@ -31,7 +31,32 @@ from mesonbuild import mesonlib from mesonbuild import mesonmain from mesonbuild import mtest from mesonbuild import mlog -from mesonbuild.environment import detect_ninja +from mesonbuild.environment import Environment, detect_ninja + + +# Fake classes and objects for mocking +class FakeBuild: + def __init__(self, env): + self.environment = env + +class FakeCompilerOptions: + def __init__(self): + self.value = [] + +def get_fake_options(prefix): + import argparse + opts = argparse.Namespace() + opts.cross_file = None + opts.wrap_mode = None + opts.prefix = prefix + opts.cmd_line_options = {} + return opts + +def get_fake_env(sdir, bdir, prefix): + env = Environment(sdir, bdir, get_fake_options(prefix)) + env.coredata.compiler_options['c_args'] = FakeCompilerOptions() + return env + Backend = Enum('Backend', 'ninja vs xcode') @@ -148,15 +173,6 @@ def ensure_backend_detects_changes(backend): if backend is Backend.ninja: time.sleep(1) -def get_fake_options(prefix): - import argparse - opts = argparse.Namespace() - opts.cross_file = None - opts.wrap_mode = None - opts.prefix = prefix - opts.cmd_line_options = {} - return opts - def run_mtest_inprocess(commandlist): old_stdout = sys.stdout sys.stdout = mystdout = StringIO() -- cgit v1.1