summaryrefslogtreecommitdiff
path: root/run-tests.py
blob: 57489537717a1f30990bc9612bc9ac01c6e1a02b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#!/usr/bin/env python

import tests
import os
import sys

if len(sys.argv) > 1 and sys.argv[1] == "update":
    if len(sys.argv) > 2:
        config = tests.get_config(os.path.dirname(sys.argv[2]))
        root, ext = os.path.splitext(sys.argv[2])
        if ext == config.get(
            config.get_section(os.path.basename(root)), 'input_ext'
        ):
            tests.generate(root, config)
        else:
            print(
                sys.argv[2],
                'does not have a valid file extension. Check config.'
            )
    else:
        tests.generate_all()
else:
    tests.run()