Split test struct and handler macros out for the emitter/spec tests

This commit is contained in:
Jesse Beder
2012-05-22 22:10:47 -05:00
parent 115101d25d
commit 0fb59c18dd
5 changed files with 63 additions and 14 deletions

View File

@@ -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)