mirror of
https://github.com/jbeder/yaml-cpp.git
synced 2025-09-09 04:41:16 +00:00
Split test struct and handler macros out for the emitter/spec tests
This commit is contained in:
@@ -61,8 +61,10 @@ def gen_tests():
|
||||
def create_emitter_tests(out):
|
||||
out.write('namespace %s {\n' % NS)
|
||||
|
||||
for test in gen_tests():
|
||||
out.write('inline TEST %s(YAML::Emitter& out)\n' % test['name'])
|
||||
tests = list(gen_tests())
|
||||
|
||||
for test in tests:
|
||||
out.write('TEST %s(YAML::Emitter& out)\n' % test['name'])
|
||||
out.write('{\n')
|
||||
for event in test['events']:
|
||||
emit = event['emit']
|
||||
@@ -82,5 +84,11 @@ def create_emitter_tests(out):
|
||||
|
||||
out.write('}\n')
|
||||
|
||||
out.write('void RunGenEmitterTests(int& passed, int& total)\n')
|
||||
out.write('{\n')
|
||||
for test in tests:
|
||||
out.write(' RunGenEmitterTest(&Emitter::%s, %s, passed, total);\n' % (test['name'], encode(test['name'])))
|
||||
out.write('}\n')
|
||||
|
||||
if __name__ == '__main__':
|
||||
create_emitter_tests(sys.stdout)
|
||||
|
Reference in New Issue
Block a user