Understanding testsuite functions
V facilitates writing pre- and post-test execution routines in the form of testsuite
functions, namely testsuite_begin
and testsuite_end
, respectively:
testsuite_begin
: This function will be helpful when you are planning to set up certain resources, such as data or environment variables, or create files if any are needed by the tests that are part of the test file.testsuite_end
: Alternatively, thetestsuite_end
function can be used to clean up the resources introduced bytestsuite_begin
. Thetestsuite_end
function can be used to clean data and environment variables, or delete files if any are created during the test run.
Also, these testsuite
functions neither accept input arguments nor specify a return type. These functions execute only once, but not for every test that is present in a test file. When you start running tests, the test runner will look for the presence of testsuite_begin
and executes this function first. Similarly...