VectorCAST Setup Teardown Scripts
Is there a way to prepare my compiler, target and/or environment variable before testing in VectorCAST?
Yes, it is often necessary to do some preparatory tasks before running the tests for a VectorCAST environment. These tasks may include starting a target server, setting environment variables, starting simulators, etc. Furthermore, after the environment test-runs, it may be necessary to perform some cleanup tasks. These cleanup tasks may include killing processes, cleaning up files, etc.
See also this video tutorial.
VectorCAST/Manage Projects now contain a script in the <PROJECT_DIRECTORY>/python directory called setup_teardown.py. This script is run when a project is loaded and is used to map the compiler node names within a project to Python classes that contain setup and teardown members.
- Access the Setup/Teardown script in Project | Edit Setup/Teardown
- In the setup_teardown.py script, locate class Target and add in what your testing requires in def setup for preparatory tasks and def teardown for cleanup tasks.
The following example would print Testing setup and Testing teardown during invocation of the setup/teardown when building and executing environments as well as when creating environments.