link#
- link(*files: str, src: str | None = None, dst: str | None = None, when: str | dict[str, str] | None = None) None#
Link files from the source directory into the execution directory.
Usage#
.pyt:import canary canary.directives.link(*files, when=...) canary.directives.link(src=..., dst=..., when=...)
.vvt:#VVT: link (rename, options=..., platforms=..., parameters=..., testname=...) : files ...Parameters#
files: File names to linksrc: Source file to linkdst: Linksrcto this destinationwhen: Restrict processing of the directive to this condition
The
whenexpression is limited to the following conditions:testname: Restrict processing of the directive to this test nameplatforms: Restrict processing of the directive to certain platform or platformsoptions: Restrict processing of the directive to command line-ooptionsparameters: Restrict processing of the directive to certain parameter names and values
Note
The
filespositional arguments andsrc,dstkeyword arguments are mutually exclusive.Examples#
Link files
input.txtandhelper.pyfrom the source directory to the execution directoryimport canary canary.directives.link("input.txt", "helper.py")
#VVT: link : input.txt helper.py
Link files
file1.txtandfile2.txtfrom the source directory to the execution directory and rename themimport canary canary.directives.link(src="file1.txt", dst="file1_link.txt") canary.directives.link(src="file2.txt", dst="file2_link.txt")
#VVT: link (rename) : file1.txt,file1_link.txt file2.txt,file2_link.txt