Skip to main content
Ctrl+K

canary 26.4.16.dev0

  • User's guide
  • API reference
  • Developer's guide
  • Release notes
  • Tutorial
  • GitHub
  • User's guide
  • API reference
  • Developer's guide
  • Release notes
  • Tutorial
  • GitHub

Section Navigation

Getting started

  • About canary
  • Installing canary
  • Getting help
  • Getting started

Basics and usage

  • canary basics
    • Canary basics: the Canary workspace
    • The test file
    • The Job object
    • Test statuses
    • Resource allocation
    • Time resources
  • canary usage
    • Finding and listing test files
    • Describing a test file
    • Running tests
    • Filtering tests
    • Parameterizing tests
    • Getting the status of a test session
    • Inspecting log files
    • Rerunning tests
    • Rebaselining tests
    • Finding locations of test assets
    • Enabling/disabling tests
    • Copying and linking resource files into the test execution directory
    • The execute and analyze pattern
    • Marking a test expected to diff or fail
    • Loading modules in your test environment
    • Sourcing rc scripts during test execution
    • CMake, CTest, and CDash
      • CMake
      • CTest
      • CDash
    • Running tests via an HPC batch scheduler
      • Running tests in a scheduler
      • Resource Pool Considerations
    • VVTest test scripts
    • GitLab reporting
      • Merge request reporting

Configuration

  • Configuration
    • Overview
    • Configuration file
    • Configuration settings
    • Setting configuration variables on the command line

Creating reports

  • Reporting test results
    • JUnit style reports
    • Multi-page markdown report
    • Multi-page HTML report
    • JSON report

Extending canary through plugins

  • Extending canary
    • Extend canary with plugins
    • User defined reports
    • User defined commands
    • User defined test generator

Commands and directives

  • Command Reference
    • collect
    • config
    • describe
    • docs
    • edit
    • exec
    • fetch
    • find
    • gc
    • help
    • hpc
    • info
    • init
    • location
    • log
    • rebaseline
    • report
    • rm
    • run
    • select
    • status
    • view
  • Test Directives
    • artifact
    • baseline
    • copy
    • cpus
    • depends_on
    • enable
    • exclusive
    • filter_warnings
    • generate_composite_base_case
    • gpus
    • include
    • keywords
    • link
    • load_module
    • owners
    • parameterize
    • preload
    • set_attribute
    • skipif
    • source
    • testname
    • timeout
    • xdiff
    • xfail
  • Utilities
    • Executable
    • Filesystem
  • canary user’s guide
  • Test Directives
  • link

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 link

  • src: Source file to link

  • dst: Link src to this destination

  • when: Restrict processing of the directive to this condition

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

  • options: Restrict processing of the directive to command line -o options

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

Note

The files positional arguments and src,dst keyword arguments are mutually exclusive.

Examples#

Link files input.txt and helper.py from the source directory to the execution directory

import canary
canary.directives.link("input.txt", "helper.py")
#VVT: link : input.txt helper.py

Link files file1.txt and file2.txt from the source directory to the execution directory and rename them

import 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

previous

keywords

next

load_module

On this page
  • link()

© Copyright 2024, National Technology & Engineering Solutions of Sandia, LLC (NTESS).

Created using Sphinx 9.1.0.

Built with the PyData Sphinx Theme 0.18.0.