2018-12-21 00:38:38 +08:00
|
|
|
/*
|
|
|
|
* Copyright (C) 2019 Intel Corporation
|
|
|
|
*
|
|
|
|
* SPDX-License-Identifier: MIT
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
2019-10-17 04:21:04 +08:00
|
|
|
#include "core/helpers/file_io.h"
|
2019-09-11 15:26:24 +08:00
|
|
|
#include "core/utilities/directory.h"
|
2018-12-21 00:38:38 +08:00
|
|
|
#include "runtime/helpers/string_helpers.h"
|
|
|
|
#include "runtime/os_interface/debug_settings_manager.h"
|
|
|
|
|
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
|
|
|
using namespace std;
|
|
|
|
|
|
|
|
#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;
|
|
|
|
}
|
|
|
|
|
|
|
|
static bool isEqual(string returnedValue, string defaultValue) {
|
|
|
|
return returnedValue == defaultValue;
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
template <DebugFunctionalityLevel DebugLevel>
|
|
|
|
class TestDebugSettingsManager : public DebugSettingsManager<DebugLevel> {
|
|
|
|
public:
|
2019-04-01 17:25:47 +08:00
|
|
|
using DebugSettingsManager<DebugLevel>::dumpFlags;
|
|
|
|
using DebugSettingsManager<DebugLevel>::settingsDumpFileName;
|
|
|
|
|
2018-12-21 00:38:38 +08:00
|
|
|
SettingsReader *getSettingsReader() {
|
|
|
|
return DebugSettingsManager<DebugLevel>::readerImpl.get();
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
using FullyEnabledTestDebugManager = TestDebugSettingsManager<DebugFunctionalityLevel::Full>;
|
|
|
|
using FullyDisabledTestDebugManager = TestDebugSettingsManager<DebugFunctionalityLevel::None>;
|