baseline#

baseline(*, src: str | None = None, dst: str | None = None, when: str | dict[str, str] | None = None, flag: str | None = None) None#

Rebaseline a test by running canary rebaseline ... in the test session directory (or one of its subdirectories)

Usage#

.pyt:

import canary
canary.directives.baseline(src, dst, when=...)
canary.directives.baseline(flag=..., when=...)

.vvt:

#VVT: baseline (options=..., platforms=..., testname=...) : src,dst
#VVT: baseline (options=..., platforms=..., testname=...) : flag

Parameters#

  • src: The source file.

  • dst: The destination file to replace with src

  • when: Restrict processing of the directive to this condition

  • flag: Run the test script with the --FLAG option on the command line to perform rebaselining. flag should start with a hyphen (-). The script should parse this value and perform the appropriate rebaselining.

The when expression is limited to the following conditions:

  • testname: Restrict processing of the directive to this test name

  • platforms: Restrict processing of the directive to certain platform or platforms

  • parameters: Restrict processing of the directive to certain parameter names and values

Examples#

import canary
canary.directives.baseline("file.exo", "file.base_exo", when="platforms='not darwin'")
# VVT: baseline (platforms="not darwin") : file.exo,file.base_exo

will replace file.base_exo with file.exo when the baseline stage is ran in its results directory:

$ canary run [options]
$ cd $(canary -C TestResults location /TESTID)
$ canary rebaseline .