summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoman Smrž <roman.smrz@seznam.cz>2025-05-12 19:09:04 +0200
committerRoman Smrž <roman.smrz@seznam.cz>2025-05-12 19:30:42 +0200
commit1ead6b1931f79e1bed7fef75ae57a751c29e8d79 (patch)
tree4811e4edbed69bcebcaba5d44e3700b5fe54ef47
parent9f488411284608260cf5b449f2bcc87d35d0a18d (diff)
Asset documentation
Changelog: Asset files and directories for use during tests
-rw-r--r--README.md34
1 files changed, 34 insertions, 0 deletions
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
---------------------