diff options
author | Matthias Klumpp <matthias@tenstral.net> | 2016-08-21 01:41:14 +0200 |
---|---|---|
committer | Matthias Klumpp <matthias@tenstral.net> | 2016-08-21 01:41:14 +0200 |
commit | 309f7a1b4a7179f44f53b75736b7cd6030f9f40d (patch) | |
tree | be3ee04cac7c98281ac118c39c825e8d1a49095a | |
parent | 12a01c26f3ea32d21e6632e8001b93deb8097fb6 (diff) | |
download | meson-309f7a1b4a7179f44f53b75736b7cd6030f9f40d.zip meson-309f7a1b4a7179f44f53b75736b7cd6030f9f40d.tar.gz meson-309f7a1b4a7179f44f53b75736b7cd6030f9f40d.tar.bz2 |
interpreter: Rename get_unittest_flag() to unittest_args()
-rw-r--r-- | mesonbuild/compilers.py | 4 | ||||
-rw-r--r-- | mesonbuild/interpreter.py | 10 |
2 files changed, 7 insertions, 7 deletions
diff --git a/mesonbuild/compilers.py b/mesonbuild/compilers.py index f3ea766..a68a0f9 100644 --- a/mesonbuild/compilers.py +++ b/mesonbuild/compilers.py @@ -1505,7 +1505,7 @@ class DCompiler(Compiler): def get_soname_args(self, shlib_name, path, soversion): return [] - def get_unittest_flag(self): + def get_unittest_args(self): return ['-unittest'] def get_buildtype_linker_args(self, buildtype): @@ -1587,7 +1587,7 @@ class GnuDCompiler(DCompiler): def build_rpath_args(self, build_dir, rpath_paths, install_rpath): return build_unix_rpath_args(build_dir, rpath_paths, install_rpath) - def get_unittest_flag(self): + def get_unittest_args(self): return ['-funittest'] class LLVMDCompiler(DCompiler): diff --git a/mesonbuild/interpreter.py b/mesonbuild/interpreter.py index 763eb7d..f9841bd 100644 --- a/mesonbuild/interpreter.py +++ b/mesonbuild/interpreter.py @@ -597,7 +597,7 @@ class CompilerHolder(InterpreterObject): 'find_library': self.find_library_method, 'has_argument' : self.has_argument_method, 'first_supported_argument' : self.first_supported_argument_method, - 'get_unittest_flag' : self.get_unittest_flag_method, + 'unittest_args' : self.unittest_args_method, }) def version_method(self, args, kwargs): @@ -651,11 +651,11 @@ class CompilerHolder(InterpreterObject): def get_id_method(self, args, kwargs): return self.compiler.get_id() - def get_unittest_flag_method(self, args, kwargs): + def unittest_args_method(self, args, kwargs): # At time, only D compilers have this feature. - if not getattr(self.compiler, "get_unittest_flag", None): - return '' - return self.compiler.get_unittest_flag() + if not hasattr(self.compiler, 'get_unittest_args'): + raise InterpreterException('This {} compiler has no unittest arguments.'.format(self.compiler.language)) + return self.compiler.get_unittest_args() def has_member_method(self, args, kwargs): if len(args) != 2: |