2018-12-21 00:38:38 +08:00
|
|
|
/*
|
2023-11-24 01:09:04 +08:00
|
|
|
* Copyright (C) 2019-2023 Intel Corporation
|
2018-12-21 00:38:38 +08:00
|
|
|
*
|
|
|
|
* SPDX-License-Identifier: MIT
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
2020-02-24 05:44:01 +08:00
|
|
|
#include "shared/source/debug_settings/debug_settings_manager.h"
|
|
|
|
#include "shared/source/helpers/file_io.h"
|
|
|
|
#include "shared/source/utilities/directory.h"
|
2018-12-21 00:38:38 +08:00
|
|
|
|
2019-01-17 20:55:49 +08:00
|
|
|
#include <map>
|
|
|
|
|
2019-03-26 18:59:46 +08:00
|
|
|
using namespace NEO;
|
2018-12-21 00:38:38 +08:00
|
|
|
|
|
|
|
#undef DECLARE_DEBUG_VARIABLE
|
|
|
|
|
|
|
|
class TestDebugFlagsChecker {
|
|
|
|
public:
|
|
|
|
static bool isEqual(int32_t returnedValue, bool defaultValue) {
|
|
|
|
if (returnedValue == 0) {
|
|
|
|
return !defaultValue;
|
|
|
|
} else {
|
|
|
|
return defaultValue;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static bool isEqual(int32_t returnedValue, int32_t defaultValue) {
|
|
|
|
return returnedValue == defaultValue;
|
|
|
|
}
|
|
|
|
|
2020-03-27 14:47:16 +08:00
|
|
|
static bool isEqual(int64_t returnedValue, int64_t defaultValue) {
|
|
|
|
return returnedValue == defaultValue;
|
|
|
|
}
|
|
|
|
|
2020-03-27 22:56:17 +08:00
|
|
|
static bool isEqual(std::string returnedValue, std::string defaultValue) {
|
2018-12-21 00:38:38 +08:00
|
|
|
return returnedValue == defaultValue;
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
2023-11-24 01:09:04 +08:00
|
|
|
template <DebugFunctionalityLevel debugLevel>
|
|
|
|
class TestDebugSettingsManager : public DebugSettingsManager<debugLevel> {
|
2018-12-21 00:38:38 +08:00
|
|
|
public:
|
2023-11-24 01:09:04 +08:00
|
|
|
using DebugSettingsManager<debugLevel>::dumpFlags;
|
|
|
|
using DebugSettingsManager<debugLevel>::settingsDumpFileName;
|
2019-04-01 17:25:47 +08:00
|
|
|
|
2023-11-24 01:09:04 +08:00
|
|
|
TestDebugSettingsManager() : DebugSettingsManager<debugLevel>("") {}
|
2018-12-21 00:38:38 +08:00
|
|
|
SettingsReader *getSettingsReader() {
|
2023-11-24 01:09:04 +08:00
|
|
|
return DebugSettingsManager<debugLevel>::readerImpl.get();
|
2018-12-21 00:38:38 +08:00
|
|
|
}
|
|
|
|
};
|
|
|
|
|
2023-12-05 20:06:54 +08:00
|
|
|
using FullyEnabledTestDebugManager = TestDebugSettingsManager<DebugFunctionalityLevel::full>;
|
|
|
|
using FullyDisabledTestDebugManager = TestDebugSettingsManager<DebugFunctionalityLevel::none>;
|