-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathrun_specific_test.py
48 lines (35 loc) · 1.25 KB
/
run_specific_test.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
import os
import yaml
import sys
from dabi.builtins import dABIContext
from dabi.builtins.types.testcase import TCaseType
from dabi.parser import dABIParser
current_file_path = os.path.dirname(os.path.abspath(__file__))
def run(to_run: str = None):
if to_run is None and len(sys.argv) < 2:
print("Please provide ARGS0 as a command-line argument.")
return
elif to_run is None:
to_run = sys.argv[1]
parser = dABIParser(current_file_path)
abi = parser.parse()
context = dABIContext()
context.set_root(current_file_path)
for subdir, dirs, files in os.walk(os.path.join(context.root, "schema", "tests")):
for file in files:
if file.endswith('.yaml'):
with open(os.path.join(subdir, file), 'r') as stream:
smcs = list(yaml.safe_load_all(stream))
for smc in smcs:
context.update_subcontext()
tmp = TCaseType(context, abi)
tmp.parse(smc)
if tmp.name == to_run:
tmp.validate()
del tmp
del context
del parser
del abi
print('Done')
if __name__ == '__main__':
run("evaa_master")