1616#include " opencl/source/program/kernel_info.h"
1717#include " opencl/source/utilities/logger.h"
1818#include " opencl/test/unit_test/custom_event_listener.h"
19+ #include " opencl/test/unit_test/global_environment.h"
1920#include " opencl/test/unit_test/mocks/mock_gmm_client_context.h"
2021#include " opencl/test/unit_test/mocks/mock_sip.h"
2122
@@ -45,7 +46,7 @@ TEST(Should, pass) { EXPECT_TRUE(true); }
4546namespace L0 {
4647
4748namespace ult {
48- ::testing::Environment *environment = nullptr ;
49+ TestEnvironment *environment = nullptr ;
4950}
5051} // namespace L0
5152
@@ -219,10 +220,6 @@ int main(int argc, char **argv) {
219220 NEO::GmmHelper::createGmmContextWrapperFunc =
220221 NEO::GmmClientContextBase::create<NEO::MockGmmClientContext>;
221222
222- if (environment) {
223- ::testing::AddGlobalTestEnvironment (environment);
224- }
225-
226223 uint64_t hwInfoConfig = NEO::defaultHardwareInfoConfigTable[productFamily];
227224 NEO::setHwInfoValuesFromConfig (hwInfoConfig, hwInfoForTests);
228225
@@ -235,6 +232,13 @@ int main(int argc, char **argv) {
235232 NEO::useKernelDescriptor = true ;
236233 NEO::MockSipData::mockSipKernel.reset (new NEO::MockSipKernel ());
237234
235+ environment = reinterpret_cast <TestEnvironment *>(::testing::AddGlobalTestEnvironment (new TestEnvironment));
236+
237+ MockCompilerDebugVars fclDebugVars;
238+ MockCompilerDebugVars igcDebugVars;
239+
240+ environment->setDefaultDebugVars (fclDebugVars, igcDebugVars, hwInfoForTests);
241+
238242 auto retVal = RUN_ALL_TESTS ();
239243
240244 return retVal;
0 commit comments