Beispiel #1
0
def test_simple(src):

    code, module_name, nparams, nports = src()

    parser = header_parser()
    tokens = parser.parseString(code, parseAll=True)

    # x contains only tokens from first module encountered
    x = tokens[0].asDict()

    assert x['module_name'] == module_name
    if nparams:
        assert len(x['params']) == nparams
    if nports:
        assert len(x['ports']) == nports
def test_simple( src ):

  code, module_name, nparams, nports = src()

  parser = header_parser()
  tokens = parser.parseString( code, parseAll=True )

  # x contains only tokens from first module encountered
  x = tokens[0].asDict()

  assert x['module_name'] == module_name
  if nparams:
    assert len(x['params']) == nparams
  if nports:
    assert len(x['ports']) == nports
Beispiel #3
0
def test_files(filename):

    parser = header_parser()
    print filename
    x = parser.parseFile(filename)
def test_files( filename ):

  parser = header_parser()
  print filename
  x = parser.parseFile( filename )