Make look slightly less like a translation from a Haskell program.
Cat's Eye Technologies
11 years ago
52 | 52 | else: |
53 | 53 | return 0 |
54 | 54 | |
55 | # load Documents and create Falderal Tests from them | |
56 | documents = [] | |
57 | functionalities = {} | |
58 | tests = [] | |
55 | 59 | try: |
56 | return test_documents(options, args) | |
60 | for filename in args: | |
61 | documents.append(Document.load(filename)) | |
62 | for document in documents: | |
63 | tests += document.parse_blocks_to_tests(functionalities) | |
57 | 64 | except FalderalSyntaxError as e: |
58 | 65 | # if options.show_full_exception: do that, else |
59 | 66 | sys.stderr.write('%s: %s\n' % (e.__class__.__name__, str(e))) |
60 | 67 | return 1 |
61 | ||
62 | ||
63 | def test_documents(options, args): | |
64 | # load Falderal documents | |
65 | documents = [] | |
66 | for filename in args: | |
67 | documents.append(Document.load(filename)) | |
68 | ||
69 | # collect functionalities | |
70 | # XXX if any implementations are given in the command line, | |
71 | # we can put them in here. | |
72 | functionalities = {} | |
73 | ||
74 | # create Falderal Tests | |
75 | tests = [] | |
76 | for document in documents: | |
77 | tests += document.parse_blocks_to_tests(functionalities) | |
78 | 68 | |
79 | 69 | if options.clear_functionalities: |
80 | 70 | for name in options.clear_functionalities.split(':'): |