There are two different environments: The environment that the Squish tools (including test scripts) execute in, and the environment that the AUT executes in. Here we will consider the Squish environment; for more about the AUT's environment, see Setting Environment Variables (Section 16.4.3).
When a Squish starts up it reads the following environment variables (and uses default values for any that are not set):
SQUISH_LIBQTDIR If set, Squish will look
in the directory specified by this variable when looking for the Qt
library when starting and when hooking into an AUT instead of using the
default location.
SQUISH_LICENSEKEY_DIR If set, Squish will look in the
directory specified by this variable when looking for the Squish
license key file; otherwise the key will be looked for in
$HOME on Unix-like systems and in
%HOMEPATH% (or %USERPROFILE%
if %HOMEPATH% isn't defined) on Windows systems.
SQUISH_SCRIPT_DIR If set, in addition to looking in the
test suite's shared scripts directory, Squish will also search the
directories listed in this variable when trying to locate a script file.
SQUISH_TESTCASE_TEMPLATES_DIR If set, Squish
reads test case templates from the specified directory; otherwise a
default directory is used. See Choosing a Custom Location for Storing Templates (Section 16.13.3)
for details.
SQUISH_USER_SETTINGS_DIR If set, Squish will use this
directory to store its user settings (for the squishserver, for the
Squish IDE, and also the descriptor files), instead of the default locations.
(See Descriptor File Locations (Section 16.11.2.1) for more about
descriptor files.)
SQUISH_WRAPPER_PATH If set, in addition to searching
all the paths in the AUT Paths list, Squish will also search all the
paths listed in this variable when trying to locate a wrapper library.
(For more about the AUT Path see AUT Paths and Mapped AUTs (Section 16.4.2).)
Test scripts can access environment variables using the
scripting-language-specific technique. For example, in Python, we can
use home = os.environ["HOME"] (having done import
os at the top of our script), and in JavaScript we can use
var home = OS.getenv("HOME");. Test scripts can also access
the AUT's environment by retrieving an ApplicationContext
object and using the environmentVariable method; see
Application Context (Section 16.1.3.10).
Squish also supports other environment variables, but unlike those shown above—which must be set before Squish is run (for example, by using a shell script or batch file to set them and then to run the Squish IDE)—the other environment variables can be set inside Squish using the Settings view (Section 17.2.13)'s Environment section; see Setting Environment Variables for the AUT (Section 16.4.3.1) for more details.
When running a test case, Squish sets the following environment variables in the AUT's environment:
SQUISH_TESTCASE_NAME This environment variable is set to
the name of the currently executing test case.
SQUISH_TESTSUITE_NAME This environment variable is set to
the name of the currently executing test suite.
Neither of these environment variables is available to test scripts
(because test scripts execute in the Squish tools environment, not the
AUT's environment). However, there is an exception: When
squishrunner is used with the --testsuite option, both
the AUT and the Squish tools environment (i.e.,
including test scripts) have SQUISH_TESTSUITE_NAME
defined.