mirror of
https://github.com/intel/compute-runtime.git
synced 2025-09-15 13:01:45 +08:00
Move debug setting and file reader tests to shared
Signed-off-by: Mateusz Jablonski <mateusz.jablonski@intel.com>
This commit is contained in:

committed by
Compute-Runtime-Automation

parent
1a04628393
commit
2ad04efd16
@ -1,14 +1,11 @@
|
||||
#
|
||||
# Copyright (C) 2018-2021 Intel Corporation
|
||||
# Copyright (C) 2018-2022 Intel Corporation
|
||||
#
|
||||
# SPDX-License-Identifier: MIT
|
||||
#
|
||||
|
||||
set(IGDRCL_SRCS_tests_utilities
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/CMakeLists.txt
|
||||
${CMAKE_CURRENT_SOURCE_DIR}${BRANCH_DIR_SUFFIX}debug_file_reader_tests.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/debug_file_reader_tests.inl
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/debug_settings_reader_tests.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/file_logger_tests.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/file_logger_tests.h
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/tag_allocator_tests.cpp
|
||||
|
@ -1,5 +1,5 @@
|
||||
#
|
||||
# Copyright (C) 2019-2021 Intel Corporation
|
||||
# Copyright (C) 2019-2022 Intel Corporation
|
||||
#
|
||||
# SPDX-License-Identifier: MIT
|
||||
#
|
||||
@ -11,6 +11,9 @@ target_sources(${TARGET_NAME} PRIVATE
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/containers_tests.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/containers_tests_helpers.h
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/cpuintrinsics_tests.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}${BRANCH_DIR_SUFFIX}debug_file_reader_tests.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/debug_file_reader_tests.inl
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/debug_settings_reader_tests.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/destructor_counted.h
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/heap_allocator_tests.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/io_functions_tests.cpp
|
||||
|
@ -1,11 +1,11 @@
|
||||
/*
|
||||
* Copyright (C) 2018-2021 Intel Corporation
|
||||
* Copyright (C) 2018-2022 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
*/
|
||||
|
||||
#include "opencl/test/unit_test/utilities/debug_file_reader_tests.inl"
|
||||
#include "shared/test/unit_test/utilities/debug_file_reader_tests.inl"
|
||||
|
||||
using namespace NEO;
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2018-2021 Intel Corporation
|
||||
* Copyright (C) 2018-2022 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
@ -1,17 +1,16 @@
|
||||
/*
|
||||
* Copyright (C) 2018-2021 Intel Corporation
|
||||
* Copyright (C) 2018-2022 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
*/
|
||||
|
||||
#include "shared/source/debug_settings/debug_settings_manager.h"
|
||||
#include "shared/source/helpers/api_specific_config.h"
|
||||
#include "shared/source/helpers/file_io.h"
|
||||
#include "shared/source/utilities/debug_settings_reader.h"
|
||||
#include "shared/test/common/test_macros/test.h"
|
||||
|
||||
#include "opencl/source/os_interface/ocl_reg_path.h"
|
||||
|
||||
#include "gtest/gtest.h"
|
||||
|
||||
#include <fstream>
|
||||
@ -31,7 +30,7 @@ class MockSettingsReader : public SettingsReader {
|
||||
};
|
||||
|
||||
TEST(SettingsReader, WhenCreatingSettingsReaderThenReaderIsCreated) {
|
||||
SettingsReader *reader = SettingsReader::create(oclRegPath);
|
||||
SettingsReader *reader = SettingsReader::create(ApiSpecificConfig::getRegistryPath());
|
||||
EXPECT_NE(nullptr, reader);
|
||||
delete reader;
|
||||
}
|
||||
@ -41,7 +40,7 @@ TEST(SettingsReader, GivenNoSettingsFileWhenCreatingSettingsReaderThenOsReaderIs
|
||||
auto fileReader = std::unique_ptr<SettingsReader>(SettingsReader::createFileReader());
|
||||
EXPECT_EQ(nullptr, fileReader.get());
|
||||
|
||||
auto osReader = std::unique_ptr<SettingsReader>(SettingsReader::create(oclRegPath));
|
||||
auto osReader = std::unique_ptr<SettingsReader>(SettingsReader::create(ApiSpecificConfig::getRegistryPath()));
|
||||
EXPECT_NE(nullptr, osReader.get());
|
||||
}
|
||||
|
||||
@ -51,7 +50,7 @@ TEST(SettingsReader, GivenSettingsFileExistsWhenCreatingSettingsReaderThenReader
|
||||
const char data[] = "ProductFamilyOverride = test";
|
||||
writeDataToFile(SettingsReader::settingsFileName, &data, sizeof(data));
|
||||
}
|
||||
auto reader = std::unique_ptr<SettingsReader>(SettingsReader::create(oclRegPath));
|
||||
auto reader = std::unique_ptr<SettingsReader>(SettingsReader::create(ApiSpecificConfig::getRegistryPath()));
|
||||
EXPECT_NE(nullptr, reader.get());
|
||||
std::string defaultValue("unk");
|
||||
EXPECT_STREQ("test", reader->getSetting("ProductFamilyOverride", defaultValue).c_str());
|
||||
@ -75,13 +74,13 @@ TEST(SettingsReader, WhenCreatingFileReaderThenReaderIsCreated) {
|
||||
}
|
||||
|
||||
TEST(SettingsReader, WhenCreatingOsReaderThenReaderIsCreated) {
|
||||
SettingsReader *reader = SettingsReader::createOsReader(false, oclRegPath);
|
||||
SettingsReader *reader = SettingsReader::createOsReader(false, ApiSpecificConfig::getRegistryPath());
|
||||
EXPECT_NE(nullptr, reader);
|
||||
delete reader;
|
||||
}
|
||||
|
||||
TEST(SettingsReader, GivenRegKeyWhenCreatingOsReaderThenReaderIsCreated) {
|
||||
std::string regKey = oclRegPath;
|
||||
std::string regKey = ApiSpecificConfig::getRegistryPath();
|
||||
std::unique_ptr<SettingsReader> reader(SettingsReader::createOsReader(false, regKey));
|
||||
EXPECT_NE(nullptr, reader);
|
||||
}
|
Reference in New Issue
Block a user