_PARSER = argparse.ArgumentParser(
prog="code-coverage-test-gap.py", usage="%(prog)s [options]"
)
_PARSER.add_argument( "tstfiles",
nargs="+",
type=str,
help="the test files you want to check code coverage for"
+ "(must be at least one)",
)
_PARSER.add_argument( "--gap-root",
nargs="?",
type=str,
help="the gap root directory (default: ~/gap)",
default="~/gap/",
)
_PARSER.add_argument( "--open",
nargs="?",
type=str,
help=("open the html page for this file (default: None)"),
default=None,
)
if exists("gap") and isdir("gap"):
_PROFILE_DIR = "/gap/" elif exists("lib") and isdir("lib"):
_PROFILE_DIR = "/lib/" else:
sys.exit(f"{_ERR_PREFIX}no directory gap or lib to profile!\033[0m")
_ARGS.gap_root = os.path.expanduser(_ARGS.gap_root) ifnot (exists(_ARGS.gap_root) and isdir(_ARGS.gap_root)):
sys.exit(f"{_ERR_PREFIX}can't find GAP root directory!\033[0m")
for f in _ARGS.tstfiles: ifnot (exists(f) and isfile(f)):
sys.exit(f"{_ERR_PREFIX}{f} does not exist!\033[0m")
suffix = "" if _ARGS.open:
filename = f"{_DIR}/{rewrite_fname(getcwd())}/{rewrite_fname(_ARGS.open)}.html"
p = re.compile(r"<tr class='missed'><td><a name=\"line(\d+)\">") with open(filename, "r", encoding="utf-8") as f:
m = p.search(f.read()) if m:
suffix += "#line" + m.group(1) else:
filename = _DIR + "/index.html"
print(f"{_INFO_PREFIX}\nSUCCESS!\033[0m")
print(f"{_INFO_PREFIX}See {filename}")
sys.exit(0)
Messung V0.5 in Prozent
¤ 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.0.21Bemerkung:
(vorverarbeitet am 2026-09-04)
¤
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.