mirror of
https://github.com/intel/compute-runtime.git
synced 2025-12-25 13:33:02 +08:00
restored the possibility of different writing modes in the FileLogger mocked writeToFile in TestFileLogger Related-To: NEO-7006 Signed-off-by: Marcel Skierkowski <marcel.skierkowski@intel.com>
42 lines
1.3 KiB
C++
42 lines
1.3 KiB
C++
/*
|
|
* Copyright (C) 2019-2024 Intel Corporation
|
|
*
|
|
* SPDX-License-Identifier: MIT
|
|
*
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
#include "shared/source/helpers/file_io.h"
|
|
#include "shared/source/helpers/string_helpers.h"
|
|
#include "shared/source/utilities/directory.h"
|
|
#include "shared/test/common/utilities/logger_tests.h"
|
|
|
|
#include "opencl/source/utilities/cl_logger.h"
|
|
|
|
#include <map>
|
|
|
|
template <DebugFunctionalityLevel debugLevel>
|
|
class TestClFileLogger : public NEO::ClFileLogger<debugLevel> {
|
|
public:
|
|
TestClFileLogger(TestFileLogger<debugLevel> &baseLoggerInm, const NEO::DebugVariables &flags)
|
|
: NEO::ClFileLogger<debugLevel>(baseLoggerInm, flags), baseLogger(baseLoggerInm) { baseLogger.useRealFiles(false); }
|
|
|
|
protected:
|
|
TestFileLogger<debugLevel> &baseLogger;
|
|
};
|
|
|
|
template <bool debugFunctionality>
|
|
class TestLoggerApiEnterWrapper : public NEO::LoggerApiEnterWrapper<debugFunctionality> {
|
|
public:
|
|
TestLoggerApiEnterWrapper(const char *functionName, int *errCode) : NEO::LoggerApiEnterWrapper<debugFunctionality>(functionName, errCode) {
|
|
if (debugFunctionality) {
|
|
loggedEnter = true;
|
|
}
|
|
}
|
|
|
|
bool loggedEnter = false;
|
|
};
|
|
|
|
using FullyEnabledClFileLogger = TestClFileLogger<DebugFunctionalityLevel::full>;
|
|
using FullyDisabledClFileLogger = TestClFileLogger<DebugFunctionalityLevel::none>; |