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
48
49
50
51
| | #!/usr/bin/env python3
import os
import sys
def check_avocado_version():
minimum_version = 106.0
def error_out():
print(
f"Avocado version {minimum_version} or later is required.\n"
f"You may install it with: \n"
f" python3 -m pip install avocado-framework",
file=sys.stderr,
)
sys.exit(1)
try:
from avocado import VERSION
if (float(VERSION)) < minimum_version:
error_out()
except ImportError:
error_out()
check_avocado_version()
from avocado.core.job import Job
from avocado.core.suite import TestSuite
def main():
repo_root_path = os.path.dirname(os.path.dirname(__file__))
test_root_path = os.path.join(repo_root_path, "test")
os.chdir(test_root_path)
config = {
"resolver.references": [
os.path.join(test_root_path, "avocado", "static_checkers.json")
],
"runner.identifier_format": "{args}",
}
suite = TestSuite.from_config(config, name="static_checkers")
with Job(config, [suite]) as j:
return j.run()
if __name__ == "__main__":
sys.exit(main())
|