#!/usr/bin/env python3 # SPDX-License-Identifier: GPL-2.0 # # This file runs some basic checks to verify kunit works. # It is only of interest if you're making changes to KUnit itself. # # Copyright (C) 2021, Google LLC. # Author: Daniel Latypov <dlatypov@google.com.com>
from concurrent import futures import datetime import os import shutil import subprocess import sys import textwrap from typing import Dict, List, Sequence
# The user might not have mypy or pytype installed, skip them if so. # Note: you can install both via `$ pip install mypy pytype`
necessary_deps : Dict[str, str] = { 'pytype': 'pytype', 'mypy': 'mypy',
}
def main(argv: Sequence[str]) -> None: if argv: raise RuntimeError('This script takes no arguments')
future_to_name: Dict[futures.Future[None], str] = {}
executor = futures.ThreadPoolExecutor(max_workers=len(commands)) for name, argv in commands.items(): if name in necessary_deps and shutil.which(necessary_deps[name]) isNone:
print(f'{name}: SKIPPED, {necessary_deps[name]} not in $PATH') continue
f = executor.submit(run_cmd, argv)
future_to_name[f] = name
has_failures = False
print(f'Waiting on {len(future_to_name)} checks ({", ".join(future_to_name.values())})...') for f in futures.as_completed(future_to_name.keys()):
name = future_to_name[f]
ex = f.exception() ifnot ex:
print(f'{name}: PASSED') continue
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.