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/skia | |
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/skia')
-rw-r--r-- | vcl/inc/skia/utils.hxx | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/vcl/inc/skia/utils.hxx b/vcl/inc/skia/utils.hxx index e1bed3dffdd9..99bac8e4c877 100644 --- a/vcl/inc/skia/utils.hxx +++ b/vcl/inc/skia/utils.hxx @@ -143,8 +143,8 @@ inline bool isUnitTestRunning(const char* name = nullptr) { if (name == nullptr) { - static const char* const testname = getenv("LO_TESTNAME"); - if (testname != nullptr) + static const bool bRunningUnitTest = getenv("LO_RUNNING_UNIT_TEST"); + if (bRunningUnitTest) return true; return !vcl::test::activeGraphicsRenderTest().isEmpty(); } |