diff options
author | Nirbheek Chauhan <nirbheek@centricular.com> | 2018-08-19 20:27:34 +0530 |
---|---|---|
committer | Nirbheek Chauhan <nirbheek.chauhan@gmail.com> | 2018-08-22 12:24:43 -0700 |
commit | 5e93393cd912f08dd6b561b78f50a83fef430097 (patch) | |
tree | e3b84887ee1e371b54b39fed82c23283c3d9a408 /run_tests.py | |
parent | bb5f2ca3da821d7a8e865cd55a8d5d638e0aab22 (diff) | |
download | meson-5e93393cd912f08dd6b561b78f50a83fef430097.zip meson-5e93393cd912f08dd6b561b78f50a83fef430097.tar.gz meson-5e93393cd912f08dd6b561b78f50a83fef430097.tar.bz2 |
Test that system shlibs with undefined symbols can be found
Diffstat (limited to 'run_tests.py')
-rwxr-xr-x | run_tests.py | 36 |
1 files changed, 26 insertions, 10 deletions
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() |