diff options
author | Nirbheek Chauhan <nirbheek@centricular.com> | 2018-07-27 14:09:05 +0530 |
---|---|---|
committer | Nirbheek Chauhan <nirbheek.chauhan@gmail.com> | 2018-08-07 12:54:56 -0700 |
commit | 8402a2223382af76d85ea65e59ad17b0bb3b24ce (patch) | |
tree | 7410235030d0fb6cec4e8547ff8adcbf35855ce7 /mesonbuild/interpreter.py | |
parent | 376cdd7054a112f76cd0efcf32287b8efbbaf9ec (diff) | |
download | meson-8402a2223382af76d85ea65e59ad17b0bb3b24ce.zip meson-8402a2223382af76d85ea65e59ad17b0bb3b24ce.tar.gz meson-8402a2223382af76d85ea65e59ad17b0bb3b24ce.tar.bz2 |
Test that vim syntax highlighting is up-to-date
Needs a `mock` kwarg to Interpreter to not do any parsing of build
files, but only setup the builtins and functions.
Also consolidate the documentation and data tests into one class.
Diffstat (limited to 'mesonbuild/interpreter.py')
-rw-r--r-- | mesonbuild/interpreter.py | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/mesonbuild/interpreter.py b/mesonbuild/interpreter.py index 4e8ac20..3df3a45 100644 --- a/mesonbuild/interpreter.py +++ b/mesonbuild/interpreter.py @@ -1847,7 +1847,7 @@ permitted_kwargs = {'add_global_arguments': {'language'}, class Interpreter(InterpreterBase): def __init__(self, build, backend=None, subproject='', subdir='', subproject_dir='subprojects', - modules = None, default_project_options=None): + modules = None, default_project_options=None, mock=False): super().__init__(build.environment.get_source_dir(), subdir) self.an_unpicklable_object = mesonlib.an_unpicklable_object self.build = build @@ -1864,8 +1864,9 @@ class Interpreter(InterpreterBase): self.subproject_directory_name = subdir.split(os.path.sep)[-1] self.subproject_dir = subproject_dir self.option_file = os.path.join(self.source_root, self.subdir, 'meson_options.txt') - self.load_root_meson_file() - self.sanity_check_ast() + if not mock: + self.load_root_meson_file() + self.sanity_check_ast() self.builtin.update({'meson': MesonMain(build, self)}) self.generators = [] self.visited_subdirs = {} @@ -1883,7 +1884,8 @@ class Interpreter(InterpreterBase): self.build_func_dict() # build_def_files needs to be defined before parse_project is called self.build_def_files = [os.path.join(self.subdir, environment.build_filename)] - self.parse_project() + if not mock: + self.parse_project() self.builtin['build_machine'] = BuildMachine(self.coredata.compilers) if not self.build.environment.is_cross_build(): self.builtin['host_machine'] = self.builtin['build_machine'] |