Add kwarg checker in module code.

pull/2001/head
Jussi Pakkanen 8 years ago
parent 50e75baa91
commit 7f482824bb
  1. 2
      mesonbuild/modules/__init__.py
  2. 2
      mesonbuild/modules/modtest.py
  3. 5
      test cases/failing/57 kwarg in module/meson.build

@ -3,9 +3,11 @@ import os
from .. import build
from .. import dependencies
from ..mesonlib import MesonException
from ..interpreterbase import permittedKwargs, noKwargs
_found_programs = {}
class ExtensionModule:
def __init__(self):
self.snippets = set() # List of methods that operate only on the interpreter.

@ -14,9 +14,11 @@
from . import ModuleReturnValue
from . import ExtensionModule
from . import noKwargs
class TestModule(ExtensionModule):
@noKwargs
def print_hello(self, state, args, kwargs):
print('Hello from a Meson module')
rv = ModuleReturnValue(None, [])

@ -0,0 +1,5 @@
project('module test', 'c')
modtest = import('modtest', i_cause: 'a_build_failure')
modtest.print_hello()
Loading…
Cancel
Save