#!/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.abspath( os.path.dirname(os.path.dirname(__file__)) ) references = [os.path.join(repo_root_path, 'test', x) for x in sys.argv[1:]] config = { "resolver.references": references, "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())