Ejemplo n.º 1
0
 def check(parser):
     goals = (
         ('class', ('Base', 'int32', 7, 0), exp_base_desc(parser)),
         ('class', ('Point', True, 'CA', 0), exp_point_desc),
         ('class', 'Toaster', exp_toaster_desc),
         ('func', 'simple', exp_simple_desc),
         # Verify that we pick up parameter names from definitions
         ('func', 'twice', exp_twice_desc),
         # Verify that the first parameter name declaration wins
         ('func', 'conflict', exp_conflict_desc),
         ('func', ('lasso', 17, 'int32', 'float32'), exp_lasso_desc(17)),
         ('func', ('lasso', 18, 'int32', 'float32'), exp_lasso_desc(18)),
         ('class', 'Default', exp_default_desc),
         ('class', 'NoDefaultBase', exp_nodefault_base_desc),
         ('class', 'NoDefault', exp_nodefault_desc),
         ('var', 'Choices', exp_choices_desc))
     for kind, name, exp in goals:
         obs = ad.describe(fname,
                           name=name,
                           kind=kind,
                           parsers=parser,
                           builddir=buildbase + '-' + parser,
                           verbose=False,
                           ts=ts,
                           clang_includes=clang_includes)
         assert_equal_or_diff(obs, exp)
Ejemplo n.º 2
0
 def check(parser):
     goals = (
         ("class", ("Base", "int32", 7, 0), exp_base_desc(parser)),
         ("class", ("Point", True, "CA", 0), exp_point_desc),
         ("class", "Toaster", exp_toaster_desc),
         ("func", "simple", exp_simple_desc),
         # Verify that we pick up parameter names from definitions
         ("func", "twice", exp_twice_desc),
         # Verify that the first parameter name declaration wins
         ("func", "conflict", exp_conflict_desc),
         ("func", ("lasso", 17, "int32", "float32"), exp_lasso_desc(17)),
         ("func", ("lasso", 18, "int32", "float32"), exp_lasso_desc(18)),
         ("class", "Default", exp_default_desc),
         ("class", "NoDefaultBase", exp_nodefault_base_desc),
         ("class", "NoDefault", exp_nodefault_desc),
         ("var", "Choices", exp_choices_desc),
     )
     for kind, name, exp in goals:
         obs = ad.describe(
             fname,
             name=name,
             kind=kind,
             parsers=parser,
             builddir=buildbase + "-" + parser,
             verbose=False,
             ts=ts,
             clang_includes=clang_includes,
         )
         assert_equal_or_diff(obs, exp)
Ejemplo n.º 3
0
def test_describe_gccxml():
    fname = os.path.join(os.path.split(__file__)[0], 'toaster.h')
    ts.register_classname('Toaster', 'toaster', 'toaster', 'cpp_toaster')
    obs = ad.describe(fname, name='Toaster', parsers='gccxml', verbose=False, ts=ts)
    exp = exp_toaster_desc
    #pprint(exp)
    #pprint(obs)
    assert_equal(obs, exp)
Ejemplo n.º 4
0
 def check(parser):
     goals = (('class', ('Base', 'int32', 7, 0), exp_base_desc(parser)),
              ('class', ('Point', True, 'CA', 0), exp_point_desc),
              ('class', 'Toaster', exp_toaster_desc),
              ('func', 'simple', exp_simple_desc),
              # Verify that we pick up parameter names from definitions
              ('func', 'twice', exp_twice_desc), 
              # Verify that the first parameter name declaration wins
              ('func', 'conflict', exp_conflict_desc), 
              ('func', ('lasso', 17, 'int32', 'float32'), exp_lasso_desc(17)),
              ('func', ('lasso', 18, 'int32', 'float32'), exp_lasso_desc(18)),
              ('class', 'Default', exp_default_desc),
              ('class', 'NoDefaultBase', exp_nodefault_base_desc),
              ('class', 'NoDefault', exp_nodefault_desc),
              ('var', 'Choices', exp_choices_desc))
     for kind, name, exp in goals:
         obs = ad.describe(fname, name=name, kind=kind, parsers=parser, 
                           builddir=buildbase + '-' + parser, verbose=False, 
                           ts=ts, clang_includes=clang_includes)
         assert_equal_or_diff(obs, exp)