Home Corporate Contacts TETware Knowledgebase |
ProductsSolutionsInformationDatasheetDocumentationFAQKnowledgebase |
Return to Knowledgebase Index32. How to run test cases in a clean environment
Question We want to be able to run test cases without being influenced by the
environment that is in effect when
Answer You can use a shellscript exec tool to execute the test case in a pristine environment. The tool must take care not to remove TETware communication variables from the environment, otherwise the TCM/API will be unable to function correctly. For example: #!/bin/sh # # exec tool which executes a test case in a known, pristine environment # tcname=${1:?} shift exec env - \ ${PATH+PATH="$PATH"} \ ${TZ+TZ="$TZ"} \ ${TET_ACTIVITY+TET_ACTIVITY="$TET_ACTIVITY"} \ ${TET_CODE+TET_CODE="$TET_CODE"} \ ${TET_CONFIG+TET_CONFIG="$TET_CONFIG"} \ ${TET_EXECUTE+TET_EXECUTE="$TET_EXECUTE"} \ ${TET_ROOT+TET_ROOT="$TET_ROOT"} \ ${TET_RUN+TET_RUN="$TET_RUN"} \ ${TET_SUITE_ROOT+TET_SUITE_ROOT="$TET_SUITE_ROOT"} \ ${TET_TMP_DIR+TET_TMP_DIR="$TET_TMP_DIR"} \ ${TET_TIARGS+TET_TIARGS="$TET_TIARGS"} \ ${TET_TSARGS+TET_TSARGS="$TET_TSARGS"} \ ./$tcname $* When a process is executed by the env(1)
command with the
-
option,
it is necessary to pass all the required environment variables
explicitly on the command line.
Other variables which are inherited by the exec tool from
tcc
and/or
tccd
are not made available to the test case.
The
On some systems you may need to add other variables to the list.
For example:
See also
|