@permittedKwargs({'name', 'no_builtin_args', 'include_directories', 'args', 'dependencies'})
def run_method(self, args, kwargs):
    if (len(args) != 1):
        raise InterpreterException('Run method takes exactly one positional argument.')
    code = args[0]
    if isinstance(code, mesonlib.File):
        code = mesonlib.File.from_absolute_file(code.rel_to_builddir(self.environment.source_dir))
    elif (not isinstance(code, str)):
        raise InvalidArguments('Argument must be string or file.')
    testname = kwargs.get('name', '')
    if (not isinstance(testname, str)):
        raise InterpreterException('Testname argument must be a string.')
    extra_args = functools.partial(self.determine_args, kwargs)
    (deps, msg) = self.determine_dependencies(kwargs, endl=None)
    result = self.compiler.run(code, self.environment, extra_args=extra_args, dependencies=deps)
    if (len(testname) > 0):
        if (not result.compiled):
            h = mlog.red('DID NOT COMPILE')
        elif (result.returncode == 0):
            h = mlog.green('YES')
        else:
            h = mlog.red(('NO (%d)' % result.returncode))
        mlog.log('Checking if', mlog.bold(testname, True), msg, 'runs:', h)
    return TryRunResultHolder(result)
@permittedKwargs({'name', 'no_builtin_args', 'include_directories', 'args', 'dependencies'})
def run_method(self, args, kwargs):
    if (len(args) != 1):
        raise InterpreterException('Run method takes exactly one positional argument.')
    code = args[0]
    if isinstance(code, mesonlib.File):
        code = mesonlib.File.from_absolute_file(code.rel_to_builddir(self.environment.source_dir))
    elif (not isinstance(code, str)):
        raise InvalidArguments('Argument must be string or file.')
    testname = kwargs.get('name', )
    if (not isinstance(testname, str)):
        raise InterpreterException('Testname argument must be a string.')
    extra_args = functools.partial(self.determine_args, kwargs)
    (deps, msg) = self.determine_dependencies(kwargs, endl=None)
    result = self.compiler.run(code, self.environment, extra_args=extra_args, dependencies=deps)
    if (len(testname) > 0):
        if (not result.compiled):
            h = mlog.red('DID NOT COMPILE')
        elif (result.returncode == 0):
            h = mlog.green('YES')
        else:
            h = mlog.red(('NO (%d)' % result.returncode))
        mlog.log('Checking if', mlog.bold(testname, True), msg, 'runs:', h)
    return TryRunResultHolder(result)