Skip to content

Commit 1dd532e

Browse files
committed
twister: document: update document help for script
No scripts will have a default parameter testinstance.name also add twister document for scripts Signed-off-by: Hake Huang <[email protected]>
1 parent 8172513 commit 1dd532e

File tree

2 files changed

+34
-1
lines changed

2 files changed

+34
-1
lines changed

doc/develop/test/twister.rst

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1315,6 +1315,38 @@ Using Single Board For Multiple Variants
13151315
runner: nrfjprog
13161316
serial: /dev/ttyACM1
13171317
1318+
Scripts Usage for platform
1319+
++++++++++++++++++++++++++
1320+
1321+
Below scripts are supported
1322+
1323+
* pre_script: <path to pre script>
1324+
1325+
* post_script: <path to pre script>
1326+
1327+
* post_flash_script: <path to pre script>
1328+
1329+
each of above scripts can have timeout defined as below in hardwar map file by script_param
1330+
1331+
.. code-block:: yaml
1332+
1333+
- connected: false
1334+
id: 0229000005d9ebc600000000000000000000000097969905
1335+
platform: mimxrt1060_evk
1336+
probe_id: 000609301751
1337+
product: DAPLink CMSIS-DAP
1338+
runner: jlink
1339+
serial: null
1340+
pre_script: pre_scripts.sh
1341+
post_script: post_scripts.sh
1342+
post_flash_script: post_flash_scripts.sh
1343+
script_param:
1344+
"pre_script_timeout": 100
1345+
"post_script_timeout": 100
1346+
"post_flash_timeout": 100
1347+
1348+
also a default patameter <testinstance.name> will be pass as fist parameter for scripts
1349+
13181350
Quarantine
13191351
++++++++++
13201352

scripts/pylib/twister/twisterlib/environment.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -640,7 +640,8 @@ def add_parse_arguments(parser = None) -> argparse.ArgumentParser:
640640

641641
parser.add_argument("--pre-script",
642642
help="""specify a pre script. This will be executed
643-
before device handler open serial port and invoke runner.
643+
before device handler open serial port and invoke runner,
644+
and testinstance name will be its first parameter.
644645
""")
645646

646647
parser.add_argument(

0 commit comments

Comments
 (0)