taptrail

Pure MoonBit TAP13 parser, CI validation gate, and Markdown/JSON report renderer.

tap
tap13
test-report
ci
parser
markdown
moon add MX-ai-nb/taptrail@0.1.0
Download zip
Author
Version
0.1.0
License
MIT
Last updated
5 hours ago
Downloads
2
README

#TapTrail

TapTrail 的主要说明文档在 README.md。本文件保留为 MoonBit 文档工具的兼容入口,核心用法、API、测试命令和 Mooncakes 发布说明均以 README.md 为准。

#
TapDiagnostic

pub(all) struct TapDiagnostic {
line : Int
text : String
} derive(Eq,
Debug
)

A diagnostic comment line.

#
TapDirective

pub(all) enum TapDirective {
NoDirective
Skip(String)
Todo(String)
} derive(Eq,
Debug
)

A TAP directive attached to a test point.

#
TapDocument

pub(all) struct TapDocument {
has_version : Bool
version : String
has_plan : Bool
plan_start : Int
plan_end : Int
points : Array[TapPoint]
diagnostics : Array[TapDiagnostic]
yaml_blocks : Array[TapYamlBlock]
bailed_out : Bool
bailout_reason : String
parse_issues : Array[TapIssue]
} derive(Eq,
Debug
)

Parsed TAP stream with non-fatal parser issues.

#
TapIssue

pub(all) struct TapIssue {
line : Int
code : String
message : String
} derive(Eq,
Debug
)

A parser or validation issue.

#
TapPoint

pub(all) struct TapPoint {
line : Int
number : Int
ok : Bool
name : String
directive : TapDirective
raw : String
} derive(Eq,
Debug
)

One parsed TAP test point.

#
TapReport

pub(all) struct TapReport {
document : TapDocument
summary : TapSummary
issues : Array[TapIssue]
ok : Bool
} derive(Eq,
Debug
)

A validation report ready for CI gates and release notes.

#
TapSummary

pub(all) struct TapSummary {
planned : Int
total : Int
passed : Int
failed : Int
skipped : Int
todo : Int
diagnostics : Int
yaml_blocks : Int
} derive(Eq,
Debug
)

Aggregate counts for one TAP stream.

#
TapYamlBlock

pub(all) struct TapYamlBlock {
start_line : Int
end_line : Int
lines : Array[String]
} derive(Eq,
Debug
)

A YAMLish TAP diagnostic block.

#
parse_and_report

fn parse_and_report(input : String) -> TapReport

Parse and validate a TAP stream in one call.

#
parse_tap

fn parse_tap(input : String) -> TapDocument

Parse a TAP13-ish stream. The parser is permissive and records unknown lines as issues instead of aborting.

#
report_passes

fn report_passes(input : String) -> Bool

Return true when the report has no validation issues.

#
summarize

fn summarize(doc : TapDocument) -> TapSummary

Build aggregate counters for a parsed TAP document.

#
to_compact_json

fn to_compact_json(report : TapReport) -> String

Render a small JSON object without requiring a JSON dependency.

#
to_junit_xml

fn to_junit_xml(report : TapReport, suite_name? : String) -> String

Render a JUnit-style XML test suite for CI systems that can ingest XML.

#
to_markdown

fn to_markdown(report : TapReport) -> String

Render a compact Markdown report for CI logs or release artifacts.

#
validate

fn validate(doc : TapDocument) -> TapReport

Validate a parsed TAP document for release or CI gating.

Source Files