Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def test_from_file(self):
declarations = parser.parse([self.header], self.config)
cache = parser.file_cache_t(self.cache_file)
cache.update(
source_file=self.header,
configuration=self.config,
declarations=declarations,
included_files=[])
self.assertTrue(
declarations == cache.cached_value(
self.header,
self.config),
"cached declarations and source declarations are different")
cache.flush()
cache = parser.file_cache_t(self.cache_file)
self.assertTrue(
declarations == cache.cached_value(
self.header,
def setUp(self):
if not self.declarations:
self.declarations = parser.parse([self.header], self.config)
def test_simple(self):
decls = parser.parse([self.header], self.config)
self.__check_result(decls)
def setUp(self):
if not self.global_ns:
decls = parser.parse([self.header], self.config)
self.global_ns = declarations.get_global_namespace(decls)
self.global_ns.init_optimizer()
def test_infinite_recursion_sstream(self):
"""
Test find_noncopyable_vars
See #71
find_noncopyable_vars was throwing:
RuntimeError: maximum recursion depth exceeded while
calling a Python object
"""
decls = parser.parse([self.header], self.config)
global_ns = declarations.get_global_namespace(decls)
# Real life example of the bug. This leads to a similar error,
# but the situation is more complex as there are multiple
# classes that are related the one to the others
# (basic_istream, basic_ios, ios_base, ...)
test_ns = global_ns.namespace('Test2')
cls = test_ns.class_('FileStreamDataStream')
declarations.type_traits_classes.find_noncopyable_vars(cls)
self.assertFalse(declarations.type_traits_classes.is_noncopyable(cls))
def setUp(self):
if not tester_t.global_ns:
decls = parser.parse([self.header], self.config)
tester_t.global_ns = declarations.get_global_namespace(decls)
tester_t.global_ns.init_optimizer()
process = subprocess.Popen(
args='scons msvc_compiler=%s' %
autoconfig.cxx_parsers_cfg.gccxml.compiler,
shell=True,
stdin=subprocess.PIPE,
stdout=subprocess.PIPE,
stderr=subprocess.STDOUT,
cwd=self.binary_parsers_dir)
process.stdin.close()
while process.poll() is None:
line = process.stdout.readline()
print(line.rstrip())
def setUp(self):
if not self.declarations:
self.declarations = parser.parse([self.header], self.config)
def setUp(self):
if not self.global_ns:
decls = parser.parse([self.header], self.config)
self.global_ns = declarations.get_global_namespace(decls)
self.global_ns.init_optimizer()
def main():
config = pygccxml.parser.config_t(gccxml_path=gccxml_path,
cflags=cflags,
compiler="/usr/bin/gcc-4.0")
decls = pygccxml.parser.parse(filenames, config)
global_ns = pygccxml.declarations.get_global_namespace(decls)
gen = OSXTypesGen()
by_framework = groupByFramework(global_ns.declarations)
[gen.addToLookup(decl) for decl in global_ns.declarations]
for framework, declarations in by_framework.iteritems():
if framework == "stdlib":
continue
gen.writeFramework(framework, declarations)
print
print '#include "util/u_debug.h"'
print '#include "svga_dump.h"'
print
config = parser.config_t(
include_paths = ['../../../include', '../include'],
compiler = 'gcc',
)
headers = [
'svga_types.h',
'svga3d_reg.h',
]
decls = parser.parse(headers, config, parser.COMPILATION_MODE.ALL_AT_ONCE)
global_ns = declarations.get_global_namespace(decls)
names = set()
for id, header, body, footer in cmds:
names.add(header)
for struct, count in body:
names.add(struct)
if footer is not None:
names.add(footer)
for class_ in global_ns.classes(lambda decl: decl.name in names):
dump_struct(decls, class_)
dump_cmds()