X-Git-Url: https://dreyeck.freedombox.rocks/gitweb/topic-maps.git/blobdiff_plain/1805023b5c5690f224a2bb556af46a4af7c36687..437ad53ea7539d36db3fa871d0931650b7a6a03e:/scripts/check-report.py diff --git a/scripts/check-report.py b/scripts/check-report.py index 43a1c2d..c0ffe33 100644 --- a/scripts/check-report.py +++ b/scripts/check-report.py @@ -10,16 +10,23 @@ lock = json.loads((root / 'references/corpus-lock.json').read_text()) assert report['repository'] == lock['repository'] and report['commit'] == lock['commit'] assert report['qualification'] == lock['draftQualification'] assert report['counts'] == lock['ctmCounts'] -slice1 = len(sys.argv) > 2 and sys.argv[2] == '--slice-1' -assert report['implemented'] == dict(ctmParsing=slice1, tmdmDeserialization=slice1, cxtmCanonicalization=False) +slice5 = len(sys.argv) > 2 and sys.argv[2] == '--slice-5' +slice4 = slice5 or len(sys.argv) > 2 and sys.argv[2] == '--slice-4' +slice1 = slice4 or (len(sys.argv) > 2 and sys.argv[2] == '--slice-1') +assert report['implemented'] == dict(ctmParsing=slice1, tmdmDeserialization=slice1, cxtmCanonicalization=slice4) assert report['countsMatchPin'] is True assert report['correspondence'] == dict(ok=True, missingInputs=[], missingBaselines=[], unmatchedBaselines=[], duplicateIDs=[]) cases = report['cases'] assert len(cases) == report['counts']['valid'] + report['counts']['invalid'] -assert report['statuses'] == {'pass': int(slice1), 'fail': 0, 'unsupported': 0, 'not-run': len(cases)-int(slice1)} +passes = 29 if slice5 else 25 if slice4 else int(slice1) +assert report['statuses'] == {'pass': passes, 'fail': 0, 'unsupported': 0, 'not-run': len(cases)-passes} assert [c['id'] for c in cases] == sorted(c['id'] for c in cases) assert len({c['id'] for c in cases}) == len(cases) -untested = [c for c in cases if not (slice1 and c['id'] == 'ctm/invalid/prefix-undefined.ctm')] +tested = [c for c in cases if c['status'] == 'pass'] +if slice4: + positives = [c for c in tested if c['category'] == 'valid'] + assert len(positives) == (28 if slice5 else 24) and all(c['actualOutcome'] == 'cxtm-match' for c in positives) +untested = [c for c in cases if c not in tested] assert all(c['status'] == 'not-run' and c['actualOutcome'] is None and c['diagnostics'] == [] for c in untested) if slice1: negative = next(c for c in cases if c['id'] == 'ctm/invalid/prefix-undefined.ctm')