Testing

From owent/libatbus · View interactive version

Testing is an AI agent skill from the GitHub repository owent/libatbus. Use when: designing, writing, reviewing, or running libatbus unit tests, filtering private-framework cases, testing topology/channel behavior, or diagnosing Windows test startup/PATH.

How to use this skill

Skill file

Unit testing (libatbus)

The test executable is atbus_unit_test; cases and their real helpers live under test/case/.

Read test design and acceptance when planning, writing, or reviewing cases.

It is not needed merely to run a known test command. Also load libatbus-protocol-crypto when protocol compatibility,

framing, authentication, encryption, compression, or cross-language vectors are in scope.

Choose the narrowest real path

construct real public objects and assert public results/state. Do not start TCP/Unix/SHM merely to reach an internal

branch that has an in-memory production path.

subject. Treat address availability, OS permissions, and cross-process support as integration prerequisites; do not

copy a fixed port/address or invent an allocation API because a nearby test happens to use one.

validation, compatibility, and error semantics; never assert exact random key/nonce output.

callback state isolated so case order does not affect results.

Drive time and I/O deterministically

make the case fail by itself. Always assert the awaited predicate and business result after the loop.

behavior. Do not use real elapsed time, a fixed sleep, CPU scheduling, or a precise pump/tick count as the oracle.

timeout prevents a hang; connection/message/callback state proves correctness.

transport is unavoidable, use current platform guards and verify cleanup even after a failed precondition.

CASE_EXPECT_* is non-fatal. Guard dependent operations after setup failures. Cross-language vector cases may return

early when required generated files are absent; inspect output/case counts and report that path as skipped, not green

compatibility coverage.

Run tests

Resolve <BUILD_DIR> as required by AGENTS.md, then prefer the registered CTest:

ctest --test-dir <BUILD_DIR> -R "^libatbus\.unit_test$" --output-on-failure

Add -C <CONFIG> for a verified multi-config generator.

The executable supports:

Run the exact case first and confirm it was selected, then the registered CTest and broader matrix in proportion to

protocol/platform risk. Do not maintain hand-counted case inventories in this Skill; discover current groups with -l

and source search.

Windows startup

Prefer the registered CTest command so the target and working directory match current CMake configuration. If CTest or a

direct run reports missing DLLs, locate the actual executable/DLL outputs in the current build tree and prepend only

those verified directories to the current process PATH. Windows private shared memory and public shared-memory

permissions differ; preserve current platform guards and report unsupported/skipped coverage explicitly.

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.