aboutsummaryrefslogtreecommitdiff
path: root/interpreter.py
diff options
context:
space:
mode:
authorJussi Pakkanen <jpakkane@gmail.com>2013-07-31 21:25:46 +0300
committerJussi Pakkanen <jpakkane@gmail.com>2013-07-31 21:25:46 +0300
commit9e122005cf5aa1ac288f9d7229d1fc2f7d472270 (patch)
treea3e961125342afd8c082bd7dace49f66829a8c9d /interpreter.py
parente13f8136268124b5591c8151130137599d313153 (diff)
downloadmeson-9e122005cf5aa1ac288f9d7229d1fc2f7d472270.zip
meson-9e122005cf5aa1ac288f9d7229d1fc2f7d472270.tar.gz
meson-9e122005cf5aa1ac288f9d7229d1fc2f7d472270.tar.bz2
Can print status info to log in compiles().
Diffstat (limited to 'interpreter.py')
-rw-r--r--interpreter.py12
1 files changed, 11 insertions, 1 deletions
diff --git a/interpreter.py b/interpreter.py
index 26c5021..359e50c 100644
--- a/interpreter.py
+++ b/interpreter.py
@@ -734,11 +734,21 @@ class CompilerHolder(InterpreterObject):
if len(args) != 1:
raise InterpreterException('compiles method takes exactly one argument.')
string = args[0]
+ testname = kwargs.get('testname', '')
+ if not isinstance(testname, str):
+ raise InterpreterException('Testname argument must be a string.')
if isinstance(string, nodes.StringStatement):
string = string.value
if not isinstance(string, str):
raise InterpreterException('Argument to compiles() must be a string')
- return self.compiler.compiles(string)
+ result = self.compiler.compiles(string)
+ if len(testname) > 0:
+ if result:
+ h = mlog.green('YES')
+ else:
+ h = mlog.red('NO')
+ mlog.log('Checking if "', mlog.bold(testname), '" compiles : ', h, sep='')
+ return result
def has_header_method(self, args, kwargs):
if len(args) != 1: