Documentation
¶
Overview ¶
Package mtest is m-cli's test runner (spec §3.2): it discovers *TST.m suites, runs them through the Engine adapter, and parses the pure-M ^STDASSERT / TESTRUN output. The assertion library and suites are unchanged M that runs on both YottaDB and IRIS; only the host-side discovery + parsing live here.
Index ¶
Constants ¶
const ( // TierPureLogic suites are deterministic, with no live DD/data dependency. // They run file-side (host-orchestrated) and are the PR gate. The safe // default for an untagged suite. TierPureLogic = "pure-logic" // TierIntegration suites exist because of the live FileMan DD + populated // globals and cannot be reproduced file-side. They run resident (in the dev // IRIS, next to the data). TierIntegration = "integration" )
Tier classifies where a suite is authoritative (spec §9.1-Q6, design §3.4).
Variables ¶
This section is empty.
Functions ¶
func DetectProtocol ¶
DetectProtocol returns the routine hosting start/report for src (the first `do start^XYZ(.pass,.fail)`), defaulting to TESTRUN for legacy suites.
func DetectTier ¶
DetectTier reads the suite's tier directive. An untagged suite is TierPureLogic — the safe default that keeps it the file-side PR gate; only an explicit `;; tier: integration` moves it to the resident tier.
func IsSuiteFile ¶
IsSuiteFile reports whether path names a test suite by convention: stem matches [A-Z][A-Z0-9]*TST with an M extension (.m on YDB, .mac/.int on IRIS).
func ReferencedRoutines ¶
ReferencedRoutines returns the external routines src calls out to — every LABEL^ROUTINE / ^ROUTINE / $$^ROUTINE site — upper-cased and sorted. Local (bare-label / intra-routine) calls are excluded: they add no cross-file dependency. This maps a changed routine to the suites that exercise it.
Types ¶
type RunResult ¶
RunResult is the outcome of running one suite.
func Run ¶
Run runs every suite in order and returns the per-suite results. It stops at the first engine error (e.g. the engine is unreachable), returning what ran.
func RunSuite ¶
RunSuite runs the suite's entry routine ^SUITE through the engine and parses its ^STDASSERT/TESTRUN output. A suite is ok only when the parsed summary is ok AND the engine process exited 0 (a crash mid-suite must not read as a pass). Routines must already be available to the engine: on YDB they auto-compile from $ydb_routines; on IRIS the caller pre-loads them (OBJ.Load) during staging, since there is no compile-from-path.
type Summary ¶
Summary is the parsed result of running a suite.
func ParseOutput ¶
ParseOutput parses ^STDASSERT / TESTRUN output into a Summary. The contract (STDASSERT.m): per-assertion " PASS/FAIL <desc>" lines, a "Results: <total> tests <p> passed <f> failed" summary, then either "All tests passed." or "<n> test(s) FAILED.".
type TestCase ¶
TestCase is one test label inside a suite.
type TestSuite ¶
type TestSuite struct {
Name string
Path string
Protocol string // routine hosting start/report (STDASSERT, TESTRUN, …)
Tier string // TierPureLogic (default) | TierIntegration — see DetectTier
Cases []TestCase
Deps []string // external routines the suite calls (upper, sorted) — for affected-test selection
}
TestSuite is one *TST.m file with its cases.