From 1ead6b1931f79e1bed7fef75ae57a751c29e8d79 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Roman=20Smr=C5=BE?= Date: Mon, 12 May 2025 19:09:04 +0200 Subject: Asset documentation Changelog: Asset files and directories for use during tests --- README.md | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/README.md b/README.md index 2c11170..511501b 100644 --- a/README.md +++ b/README.md @@ -196,6 +196,15 @@ Members: `node` : Node on which the process is running. +#### asset + +Represents an asset (file or directory), which can be used during test execution. + +Members: + +`path` +: Path to the asset valid during the test execution. + #### list Lists are written using bracket notation: @@ -423,6 +432,31 @@ module bar.baz import foo ``` +### Assets + +To provide the used test tool with access to auxiliary files needed for the +test execution, asset objects can be defined. The definition is done on the +toplevel using the `asset` keyword, giving the asset object name and a path to +the asset on the filesystem, relative to the directory containing the test +script: + +``` +asset my_asset: + path: ../path/to/file +``` + +Such defined asset object can then be used in expressions within tests or function definitions: + +``` +test: + spawn p + send to p "use-asset ${my_asset.path}" +``` + +The `my_asset.path` expression expands to a strict containing path to the asset +that can be used by the spawn process `p`. The process should not try to modify +the file. + Optional dependencies --------------------- -- cgit v1.2.3