Repository navigation
Ariadne: (quit code), assert and ari test - #896
Merged
Merged
Conversation
- (quit [code]): AppRuntime::register_quit() binds `on: quit` and the verb; the first close request's code is exit_code(). ari run/snapshot/check and arigl (window and --terminal) exit with it; snapshot stops on the frame the document quit. - (assert cond [message [data]]): a builtin raising AssertionError (a new class under Exception), "assertion failed[: message]"; its traceback ends at the form. - tests: block (name -> program) captured by the loader; Runtime::run_program runs a program on the action lane and reports how it ended to a callback. - ari test [--tap] [--timeout S] [--frames N] doc.ari...: each document headless until it quits, its tests have run, N frames, or the timeout. Fails on a non-zero quit, an uncaught error, a failed or warning load, a failed test, or a timeout. One line per document with what failed and in which program; TAP with --tap; exit 1 on failure. Network flags and settling as snapshot's. - Action failure warnings name their program; resident ones their lane. - Docs: ARIADNE.md §13, the exceptions table, the developer guide.
transfix
added a commit
to cy-pca/cypkg
that referenced
this pull request
Oct 30, 2026
…illing stepped_solve::impl did f.assign(nv, f[0]): the value is a reference into f, and libc++'s assign frees the old buffer before filling the new one, so on macOS every entry was read from freed memory (Fem.SteppedPoissonMatchesTheOneShotSolve, rel diff 6.7e268 in the macOS recipe lanes). libstdc++ and MSVC copy the value first, so Linux and Windows passed.
Takes #903's fix for the stepped Poisson solve in place of the same fix made here.
This was referenced Oct 30, 2026
transfix
pushed a commit
that referenced
this pull request
Oct 31, 2026
This was referenced Oct 31, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Part of #894 (the first three asks). Functions for loaded documents comes in a separate PR.
What a document gets
(quit [code]): every stock host binds it throughAppRuntime::register_quit(), which also bindson: quit.codeis an integer from 0 to 255 (default 0). Anything else raisesTypeErrororValueErrorin the calling program, and nothing closes.exit_code()).ari run,snapshotandcheckexit with it, and so do arigl's window and--terminalmodes.snapshotstops on the frame the document quit.checkrunsinit:, soinit: (quit 3)makesari checkexit 3.(assert cond [message [data]]): a builtin. Whencondis false it raisesAssertionError, a new class underException, notRuntimeError, with the messageassertion failedorassertion failed: <message>.trycatches it.AssertionError: assertion failed: one and one (at (assert (= (+ 1 1) 3) "one and one")).tests:: a top-level map of test name to program, ignored by every host exceptari test.ari test [--tap] [--timeout S] [--frames N] [host flags] doc.ari...snapshotdoes, but nothing is drawn, and there is no input.(quit code);tests:case has run (one at a time, in order, on the action lane, afterinit:and the first frame);--frames N;--timeout(default 30 s).snapshot's. Requests are waited for, and after--frameswith the network on it settles assnapshotdoes.--tapit prints TAP 13 instead (ok N - doc # detail, then the failures as#lines).Runtime changes
Runtime::run_program(script, done)runs a program on the action lane and reports how it ended ("",failed: ...,did not complete: ...) to the callback, not as a warning.[<its program, one line, 80 chars>]. A resident's warning names its lane:ari: on_tick: resident [...] failed: ....--timeoutis a general host flag (host_cli).src/ari/ari_run.hholds the helpers for runningarithatari_net_testhad.Tests
state_exec_exceptions_test: assert on all four engines, the class chain,try, the data argument, arity, and the traceback form.ariadne_loader_test: thetests:block, its order and its malformed shapes.ariadne_host_test:init:, and with no code;on: quit;run_programoutcomes, including a parked program and a syntax error;--timeoutparsing.ari_test_command_testruns the builtariend to end:checkandsnapshot;--framesand timeouts;Locally: the ariadne_* and state_exec_* suites all pass;
ctest -R "^(Ari|AriadneQuit|AriadneRunProgram|AriadneTests|AriadneHostCli|BuiltinClasses)"passes 554/554.Docs: docs/ARIADNE.md §13 (new) and §2.4, §5.1, §9.2; docs/STATE_EXEC_DEVELOPER_GUIDE.md; docs/STATE_EXEC_EXCEPTIONS.md; the
ariusage text.Rebase note: #883 also touches src/ari/CMakeLists.txt; keep both test blocks.