aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild/astinterpreter.py
diff options
context:
space:
mode:
authorJussi Pakkanen <jpakkane@gmail.com>2016-11-19 22:11:20 +0200
committerJussi Pakkanen <jpakkane@gmail.com>2016-11-19 22:11:20 +0200
commitc41805f012fe7305dfba978f6cb70741d782c57f (patch)
tree1eb0ed9af19cd6f4eed82a0637a6330da2034a71 /mesonbuild/astinterpreter.py
parent7e8872236d1c8b8baca910a3c03b0399ed94dbea (diff)
downloadmeson-c41805f012fe7305dfba978f6cb70741d782c57f.zip
meson-c41805f012fe7305dfba978f6cb70741d782c57f.tar.gz
meson-c41805f012fe7305dfba978f6cb70741d782c57f.tar.bz2
Moved more stuff, can now parse all of common tests.
Diffstat (limited to 'mesonbuild/astinterpreter.py')
-rw-r--r--mesonbuild/astinterpreter.py54
1 files changed, 51 insertions, 3 deletions
diff --git a/mesonbuild/astinterpreter.py b/mesonbuild/astinterpreter.py
index 571ecfd..247f7d9 100644
--- a/mesonbuild/astinterpreter.py
+++ b/mesonbuild/astinterpreter.py
@@ -34,22 +34,52 @@ class MockStaticLibrary(interpreterbase.InterpreterObject):
class MockSharedLibrary(interpreterbase.InterpreterObject):
pass
+class MockCustomTarget(interpreterbase.InterpreterObject):
+ pass
+
+class MockRunTarget(interpreterbase.InterpreterObject):
+ pass
+
class AstInterpreter(interpreterbase.InterpreterBase):
def __init__(self, source_root, subdir):
super().__init__(source_root, subdir)
self.funcs.update({'project' : self.func_do_nothing,
'test' : self.func_do_nothing,
+ 'benchmark' : self.func_do_nothing,
'install_headers' : self.func_do_nothing,
'install_man' : self.func_do_nothing,
'install_data' : self.func_do_nothing,
+ 'install_subdir' : self.func_do_nothing,
'configuration_data' : self.func_do_nothing,
'configure_file' : self.func_do_nothing,
'find_program' : self.func_do_nothing,
+ 'include_directories' : self.func_do_nothing,
+ 'add_global_arguments' : self.func_do_nothing,
+ 'add_global_link_arguments' : self.func_do_nothing,
+ 'add_project_arguments' : self.func_do_nothing,
+ 'add_project_link_arguments' : self.func_do_nothing,
+ 'message' : self.func_do_nothing,
+ 'generator' : self.func_do_nothing,
+ 'error' : self.func_do_nothing,
+ 'run_command' : self.func_do_nothing,
+ 'assert' : self.func_do_nothing,
+ 'subproject' : self.func_do_nothing,
+ 'dependency' : self.func_do_nothing,
+ 'get_option' : self.func_do_nothing,
+ 'join_paths' : self.func_do_nothing,
+ 'environment' : self.func_do_nothing,
+ 'import' : self.func_do_nothing,
+ 'vcs_tag' : self.func_do_nothing,
+ 'add_languages' : self.func_do_nothing,
+ 'declare_dependency' : self.func_do_nothing,
'files' : self.func_files,
'executable': self.func_executable,
'static_library' : self.func_static_lib,
'shared_library' : self.func_shared_lib,
+ 'library' : self.func_library,
'build_target' : self.func_build_target,
+ 'custom_target' : self.func_custom_target,
+ 'run_target' : self.func_run_target,
'subdir' : self.func_subdir,
'set_variable' : self.func_set_variable,
'get_variable' : self.func_get_variable,
@@ -57,7 +87,10 @@ class AstInterpreter(interpreterbase.InterpreterBase):
})
def func_do_nothing(self, *args, **kwargs):
- return DontCareObject()
+ return True
+
+ def method_call(self, node):
+ return True
def func_executable(self, *args, **kwargs):
return MockExecutable()
@@ -68,6 +101,15 @@ class AstInterpreter(interpreterbase.InterpreterBase):
def func_shared_lib(self, *args, **kwargs):
return MockSharedLibrary()
+ def func_library(self, *args, **kwargs):
+ return self.func_shared_lib(*args, **kwargs)
+
+ def func_custom_target(self, *args, **kwargs):
+ return MockCustomTarget()
+
+ def func_run_target(self, *args, **kwargs):
+ return MockRunTarget()
+
def func_subdir(self, node, args, kwargs):
prev_subdir = self.subdir
subdir = os.path.join(prev_subdir, args[0])
@@ -93,8 +135,14 @@ class AstInterpreter(interpreterbase.InterpreterBase):
return [args]
return args
- def method_call(self, node):
- return DontCareObject()
+ def evaluate_arithmeticstatement(self, cur):
+ return 0
+
+ def evaluate_plusassign(self, node):
+ return 0
+
+ def evaluate_indexing(self, node):
+ return 0
def dump(self):
self.load_root_meson_file()