Next: , Previous: , Up: API  


1.5 (veritas runner)

1.5.1 Procedures

Procedure: discover-tests KEY: #:test-type #:scan-dir #:test-top-dir #:test-module #:dir

Recursively traverse a cleaned directory metadata structure dir to isolate relevant test targets.

Dispatches recursive tree matching across structural listings by comparing elements against the designated configuration constraints:

  • If directory branches match structural target strings, routes deeper down those tree boundaries.
  • If a matching folder named after test-type is reached, routes the underlying components to flatten-test-files.

Returns a multi-dimensional nested string list structure grouping eligible test module file locations.

Procedure: run-test-file KEY: #:test-file #:test-type #:entrypoint-function

Dynamically resolve and execute a designated test file module.

Accepts three keyword arguments:

  • test-file: The relative string path targeting a test definition file.
  • test-type: A descriptive categorization string used for module names (e.g., "unit").
  • entrypoint-function: A string name identifying the zero-argument procedure to run.

Transforms the target string file path into an expected Guile module path syntax under the top-level hierarchy prefix (veritas test-type ...), maps the matching entrypoint, and executes it synchronously.

(run-test-file #:test-file "math/algebra.scm"
               #:test-type "unit"
               #:entrypoint-function "spec")
;; Dynamically runs the 'spec' function inside module: (veritas unit math algebra)
Procedure: run-tests

Main entry point orchestration runner for looking up, organizing, and executing tests.

Automatically configures operations by reading environment variables on execution:

  • VERITAS_SCAN_DIR: High-level folder root used to scan files. Defaults to "./".
  • VERITAS_TEST_TOP_DIR: The subfolder boundary identifier containing test suites. Defaults to "test".
  • VERITAS_ENTRYPOINT: The signature method executed inside test targets. Defaults to "spec".
  • VERITAS_TEST_MODULE: Top level test parent folder filter. Defaults to "veritas".
  • VERITAS_TEST_TYPE: Category discriminator keyword used during routing. Defaults to "unit".
  • VERITAS_SHUFFLE_FILES: Set to string "true" to shuffle execution sequences using a Fisher-Yates algorithm. Defaults to "true".

Locates target test collections dynamically via directory traversal hooks, updates stdout buffers with operational summaries, and processes matching test suites consecutively.


Next: (veritas shuffle), Previous: (veritas reporter), Up: API