countsLinefunctionno test imports itfunction countsLine(q: QualityRecord): stringThe counts as one line, with the count of not_run beside passed and failed (FR-013).
The renderings of a quality record on demand (commons 0001-quality-evidence FR-013, FR-014, FR-017, FR-018, FR-020): JUnit XML, CTRF, SARIF and TAP over the cases of a QualityRecord, and the three documents of ISO/IEC/IEEE 29119-3 (the test completion report, the test status report and a test incident report for each failure, cancellation and not_run). None is kept as evidence; each is a function of the record (and of the grade given) alone, with no clock, so rendering twice gives the same bytes.
What 0008-test-evidence already renders is reused: the TAP of the cases that ran is tap14, the time helpers are its. What it cannot hold, a case that did not run, is added: its count wherever the counts of passed and failed are (FR-013), CTRF's status other (FR-019), a JUnit skipped of type not_run, a SARIF result at level warning. Every rendering that shows evidence shows its grade (FR-014).
import { ctrfDocument } from "./render.ts";
// const q = readQuality(text);
// if (q.kind === "ok") console.log(ctrfDocument(q.value, "E4"));countsLinefunctionno test imports itfunction countsLine(q: QualityRecord): stringThe counts as one line, with the count of not_run beside passed and failed (FR-013).
ctrfDocumentfunctionfunction ctrfDocument(q: QualityRecord, grade?: Grade): stringThe run as a CTRF document (FR-018): the case bodies as they are in the record, not_run as status other (FR-019), the grade shown.
junitfunctionfunction junit(q: QualityRecord, grade?: Grade): stringThe run as JUnit XML: a testsuite per file and runtime, a testcase per case with its grade among its properties, failure, error (cancelled) or skipped (skip, todo and, with type="not_run" and its reason, a case that did not run). JUnit has no word for not_run, so the count is a property of the run (ifc.not_run) beside the grade.
NO_RULEconstno test imports itconst NO_RULE: "ifc.test.no-requirement"The rule of a failed case that proves no requirement and belongs to no rule of a check.
sariffunctionfunction sarif(q: QualityRecord, grade?: Grade): stringThe run as SARIF 2.1.0: each failed or cancelled case an error result and each case that did not run a warning, at its file and, where it has one, its line, with its rule (a check's rule id, else its first requirement) (FR-020); the counts, not_run included, and the grade as the run's properties.
tapfunctionfunction tap(q: QualityRecord, grade?: Grade): stringThe run as TAP version 14: tap14 of 0008-test-evidence for the cases that ran, then, as comments, the count of not_run beside the others, each case that did not run with its reason, and the grade.
completionReportfunctionfunction completionReport(q: QualityRecord, grade?: Grade): stringThe test completion report of ISO/IEC/IEEE 29119-3 for a run (FR-017), as Markdown: the summary with the counts and the count of not_run, the requirements proved with the grade beside the count (FR-014), and the cases that did not pass.
statusReportfunctionfunction statusReport(q: QualityRecord, grade?: Grade): stringThe test status report of ISO/IEC/IEEE 29119-3 for a run in progress or ended (FR-017): where it stands, in a few lines.
IncidentReporttypeno test imports ittype IncidentReport = { readonly case: string; readonly text: string };A test incident report of ISO/IEC/IEEE 29119-3 for one case that failed, was cancelled or did not run (FR-017).
incidentReportsfunctionfunction incidentReports(q: QualityRecord, grade?: Grade): readonly IncidentReport[]The test incident reports of a run, one for each failure, cancellation and not_run (FR-017).
RenderFormattypeno test imports ittype RenderFormat = "junit" | "ctrf" | "sarif" | "tap" | "completion" | "status" | "incident";The reports a render can write.
RENDER_FORMATSconstconst RENDER_FORMATS: readonly RenderFormat[]Every format render knows, in the order it lists them.
isRenderFormatfunctionno test imports itfunction isRenderFormat(text: string): text is RenderFormatWhether a text is a format.
renderfunctionfunction render(q: QualityRecord, format: RenderFormat, grade?: Grade): stringA record rendered as one format (the incident reports joined, each beginning with its title).