Polyman Documentation - v3.0.0
    Preparing search index...

    Class ReportCollector

    Collects step, solution, and per-test results for a JSON report. Every method is a no-op until startRun / startVerify is called, so helpers can record unconditionally.

    Index

    Constructors

    Properties

    active: ActiveReport | null = null
    finished: boolean = false
    exitHookInstalled: boolean = false

    Methods

    • Whether a JSON report is being collected.

      Returns boolean

    • Begin collecting a run report for the requested solution name.

      Parameters

      • solutionName: string

      Returns void

    • Begin collecting a verify report.

      Returns void

    • Records which solutions a run matched. With exactly one match the report's tag is that solution's tag; otherwise it is null.

      Parameters

      Returns void

    • Marks the start of a named pipeline step.

      Parameters

      • name: string

      Returns void

    • Captures an error line against the current step. Called by the formatter for every fmt.error while a report is active.

      Parameters

      • message: string

      Returns void

    • Marks the current step as failed with the given message. The first failure decides failedStep.

      Parameters

      • message: string

      Returns void

    • Updates the verdict of an already recorded test, e.g. after the checker judged the output. Creates the entry if the run happened elsewhere.

      Parameters

      Returns void

    • Records whether a solution's observed verdicts satisfy its tag.

      Parameters

      Returns void

    • Writes the JSON document to stdout exactly once. Safe to call more than once; later calls are ignored.

      Parameters

      • ok: boolean

      Returns void

    • Discards any collected state and restores the formatter (tests).

      Returns void

    • Parameters

      • command: "run" | "verify"
      • requestedSolution: string

      Returns void