diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2016-11-02 17:30:31 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2016-11-04 09:26:37 +0200 |
commit | e4feb8be8bc8667b62574da521cd53ebc94b4afc (patch) | |
tree | 8879e33a66a7ff1008b1fff8571a2123d96ee9cc /doc | |
parent | 860750cc3128693ebc5c610855ae7b1ab60cdfc5 (diff) |
Update testscript spec with include directive grammar
Diffstat (limited to 'doc')
-rw-r--r-- | doc/testscript.cli | 25 |
1 files changed, 22 insertions, 3 deletions
diff --git a/doc/testscript.cli b/doc/testscript.cli index e4f59e4..d055b58 100644 --- a/doc/testscript.cli +++ b/doc/testscript.cli @@ -708,7 +708,7 @@ script: scope-body: *setup - *(scope|test) + *(scope|test|include) *teardown setup: @@ -728,6 +728,8 @@ test: *((variable-line|test-line) ';') test-line (':' <text>)? +include: 'include' '--once'? <path>+ + description: +(':' <text>) @@ -790,8 +792,25 @@ same time is illegal. Here-line is like double-quoted string but recognizes newlines. -It is an error to specify both normal (better term?) and inline descriptions -for a test. +It is an error to specify both leading and trailing descriptions. + +\h#include|Inclusion| + +While in the grammar the \c{include} directive is shown to only appear +interleaving with scopes and tests, it can be used anywhere in the scope +body. It can also contain several parts of a scope, for example, setup and +test lines. + +The \c{--once} option signals that files that have already been included +in this scope should not be included again. + +Note that \c{include} is a directive, not a command. It is performed during +parsing before any command is executed or testscript variable assigned. You +can, however, use variables assigned in the buildfile. For example: + +\ +include --once common-$(cxx.target.class).test +\ \ script: |