else/SnudownTest/fuzzing/gen_testcases.py

21 lines
504 B
Python
Raw Normal View History

2015-11-20 12:08:53 +00:00
#!/bin/env python
# dump all of our testcases into a directory as separate files, like AFL
# wants.
import os.path
import sys
import itertools
sys.path.append("..")
import test_snudown
cases = itertools.chain(test_snudown.cases.keys(), test_snudown.wiki_cases.keys())
for i, md in enumerate(cases):
# skip huge testcases
if len(md) > 2048:
continue
test_path = os.path.join('testing', 'testcases', 'test_default_%d.md' % i)
with open(test_path, 'w') as f:
f.write(md)