Changeset View
Changeset View
Standalone View
Standalone View
tests/testlib/testsafety.h
Show All 26 Lines | |||||
27 | namespace TestLib { | 27 | namespace TestLib { | ||
28 | namespace TestSafety { | 28 | namespace TestSafety { | ||
29 | 29 | | |||
30 | /** | 30 | /** | ||
31 | * Checks that the test is running in the proper test environment (akonaditest) | 31 | * Checks that the test is running in the proper test environment (akonaditest) | ||
32 | */ | 32 | */ | ||
33 | bool checkTestIsIsolated() | 33 | bool checkTestIsIsolated() | ||
34 | { | 34 | { | ||
35 | if (qgetenv( "AKONADI_TESTRUNNER_PID").isEmpty()) { | 35 | if (qEnvironmentVariableIsEmpty("AKONADI_TESTRUNNER_PID")) { | ||
36 | qCritical() << "This test must be run using ctest, in order to use the testrunner environment. Aborting, to avoid messing up your real akonadi"; | 36 | qCritical() << "This test must be run using ctest, in order to use the testrunner environment. Aborting, to avoid messing up your real akonadi"; | ||
37 | return false; | 37 | return false; | ||
38 | } | 38 | } | ||
39 | return true; | 39 | return true; | ||
40 | } | 40 | } | ||
41 | 41 | | |||
42 | } | 42 | } | ||
43 | } | 43 | } | ||
44 | 44 | |