diff options
author | Nirbheek Chauhan <nirbheek@centricular.com> | 2017-11-29 17:36:58 +0530 |
---|---|---|
committer | Nirbheek Chauhan <nirbheek@centricular.com> | 2017-12-03 10:06:11 +0530 |
commit | b2feae98339556eb053d3493bc925f3ceb30ec3b (patch) | |
tree | 400ef79859c37d3f4a48b8c5c855a8af6377288d | |
parent | 45dbc0d30e2447faeb877469c54a47579e56837c (diff) | |
download | meson-b2feae98339556eb053d3493bc925f3ceb30ec3b.zip meson-b2feae98339556eb053d3493bc925f3ceb30ec3b.tar.gz meson-b2feae98339556eb053d3493bc925f3ceb30ec3b.tar.bz2 |
unit tests: Remove all instances of FakeEnvironment
We don't need to use that, and it causes build failures when code
actually uses the environment.
-rwxr-xr-x | run_tests.py | 9 | ||||
-rwxr-xr-x | run_unittests.py | 8 |
2 files changed, 5 insertions, 12 deletions
diff --git a/run_tests.py b/run_tests.py index b287a1a..1cc3983 100755 --- a/run_tests.py +++ b/run_tests.py @@ -155,15 +155,6 @@ def run_configure(meson_command, commandlist): return run_configure_external(meson_exe + commandlist) return run_configure_inprocess(meson_command, commandlist) -class FakeEnvironment(object): - def __init__(self): - self.cross_info = None - self.coredata = lambda: None - self.coredata.compilers = {} - - def is_cross_build(self): - return False - def print_system_info(): print(mlog.bold('System information.').get_text(mlog.colorize_console)) print('Architecture:', platform.architecture()) diff --git a/run_unittests.py b/run_unittests.py index 79805b2..728f8f3 100755 --- a/run_unittests.py +++ b/run_unittests.py @@ -40,7 +40,7 @@ from mesonbuild.environment import Environment from mesonbuild.dependencies import DependencyException from mesonbuild.dependencies import PkgConfigDependency, ExternalProgram -from run_tests import exe_suffix, get_fake_options, FakeEnvironment +from run_tests import exe_suffix, get_fake_options from run_tests import get_builddir_target_args, get_backend_commands, Backend from run_tests import ensure_backend_detects_changes, run_configure, meson_exe from run_tests import should_run_linux_cross_tests @@ -1555,7 +1555,8 @@ int main(int argc, char **argv) { '--libdir=' + libdir]) # Find foo dependency os.environ['PKG_CONFIG_LIBDIR'] = self.privatedir - env = FakeEnvironment() + env = Environment(testdir, self.builddir, self.meson_command, + get_fake_options(self.prefix), []) kwargs = {'required': True, 'silent': True} foo_dep = PkgConfigDependency('libfoo', env, kwargs) # Ensure link_args are properly quoted @@ -1856,7 +1857,8 @@ class LinuxlikeTests(BasePlatformTests): ''' testdir = os.path.join(self.common_test_dir, '51 pkgconfig-gen') self.init(testdir) - env = FakeEnvironment() + env = Environment(testdir, self.builddir, self.meson_command, + get_fake_options(self.prefix), []) kwargs = {'required': True, 'silent': True} os.environ['PKG_CONFIG_LIBDIR'] = self.privatedir foo_dep = PkgConfigDependency('libfoo', env, kwargs) |