diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2024-07-17 12:16:59 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2024-07-17 15:21:57 +0200 |
commit | 69e7000ed420faf513002076089aca82bddfbc28 (patch) | |
tree | ac34589617f15a2be40b57a7c2296565022683f4 /vcl/inc/salinst.hxx | |
parent | c1b00424f17eaea8f55565dae285521c1ec4d042 (diff) |
Simplify checking for "running under unit/ui test"
In various places, the code checks if we are running as a unit test or a
UI test. This code grew organically, and is most re-using environment
variables that were designed for narrower purposes.
Rather than being clever, just add two new explicit and simple
environment variables in the natural place (the command that runs them),
and check for those variables in the code.
Change-Id: Icce0997914fa0be30a5ac1f29bd870bdb5893a8b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/170618
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Tested-by: Jenkins
Diffstat (limited to 'vcl/inc/salinst.hxx')
-rw-r--r-- | vcl/inc/salinst.hxx | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/vcl/inc/salinst.hxx b/vcl/inc/salinst.hxx index 45c031db30ae..b356a4514aee 100644 --- a/vcl/inc/salinst.hxx +++ b/vcl/inc/salinst.hxx @@ -211,9 +211,7 @@ public: virtual void BeforeAbort(const OUString& /* rErrorText */, bool /* bDumpCore */) {} - // Note: we cannot make this a global variable, because it might be initialised BEFORE the putenv() call in cppunittester. - static bool IsRunningUnitTest() { return getenv("LO_TESTNAME") != nullptr; } - + static bool IsRunningUnitTest(); static bool IsRunningUITest(); // both must be implemented, if the VCL plugin needs to run via system event loop |