. "$BST_LIB" # BST-TIMEOUT: 600 # # MEASURED: every case below has run on this arm and passes; the whole suite # takes about 10 s on the local verify runner. The bound stays at the spawn # budget the next block describes rather than at that stopwatch figure, # because the browser runtime instantiates each poke spawn more slowly and a # bound sized from a fast host would turn a slow run into a false red. # # Expectations the upstream corpus does not pin were checked against an x86_64 # build of the same poke 1.2 tarball; where they disagreed, the native # behaviour won and the case says so (--help, and a FILE argument that does not # exist yet). # THE SPAWN BUDGET IS WHAT SHAPES THIS FILE, and it is worth stating before the # assertions, because the file looks strangely batched otherwise. # # exec on this arm is a fresh wasm module instantiation, and `poke' is not a # small module: it carries libpoke, the Pkl compiler and a Jitter-generated VM. # Worse, the host-side verify harness ends a boot when the guest process grows # faster than 2048 MiB/min averaged over 120 s, and on this runtime a working # guest grows ~9300 MiB/min (brintos/hardwarejs#20), so a suite that runs much # past two minutes is powered off mid-run and -- because brintos-selftest # buffers a suite's whole output until it ends -- loses everything it had # already produced. That is what turned four attempts at 99-opkg-utils into # four zero-case captures. # # So the currency here is INVOCATIONS, not assertions. poke takes any number of # -c commands and executes them in order, printing the value of each statement # that has one, so N assertions cost ONE spawn if they share an IO space and a # .set state. This file therefore runs about a dozen poke invocations and takes # each one's output APART LINE BY LINE, scoring every line as its own case. # _line_n does that with parameter expansion only -- no sed, no cut, no head, # because a helper that spawned per line would cost more than the tool. # # THE ORACLE IS UPSTREAM'S OWN TESTSUITE, not this author's expectations. poke # 1.2 ships a DejaGnu corpus (testsuite/poke.pkl, poke.cmd, poke.std) in which # each test states its data, its commands and its expected output as dg-data / # dg-command / dg-output directives. Every assertion below that carries a # `[dg: ]' comment is transcribed from one of those, expected output # included, and the invocation shape -- `-q --quiet --no-hserver --color=no', # with .file first -- is the one testsuite/lib/poke-dg.exp builds. # # WHY THE MATCHING IS SUBSTRING AND NOT EQUALITY. dg-output is a REGEX matched # against poke's output, so a short expectation is deliberately loose: poke.pkl # add-arrays-3 gives "3" for an expression that actually renders "3UL", because # "3" matches it. Transcribing those as exact line equality would invent a # precision upstream never asserted and would red on a correct tool. want_sub # below is therefore substring, which is dg's own semantics. Where a dg-output # IS a complete rendering (a dump line, "0x30405060U", "[0x20UB,0x30UB,0x80UB]") # the substring happens to pin the whole line anyway, which is the coverage # worth having. # # WHY UPSTREAM'S `make check' IS NOT SHIPPED AS A PTEST, which the ticket asks # about: it is DejaGnu. Running it on target needs runtest, expect and tcl on # the image, plus a working spawn/pty path for a corpus of ~1400 files that # would each spawn poke -- several thousand execs against a two-minute wall. # The corpus is used here as an ORACLE instead, which is the part of it that # carries the value; the harness is what does not fit. # poke (1.2, meta-oe recipes-devtools/poke, plus one patch of ours against the # bundled Jitter's Makefile.am). GNU poke is an extensible editor for structured # binary data: a procedural language (Pkl) for describing binary layouts, and an # IO-space abstraction that MAPS those descriptions over a file so fields can be # read and written in place. # # TAKEN STRICTLY IN ITS NON-INTERACTIVE MODE, per the ticket. Upstream calls # poke an interactive editor and it has a REPL; nothing here touches it. Every # assertion goes through `poke -c ' or `poke -L