2017-12-21 07:45:38 +08:00
|
|
|
/*
|
2020-02-23 05:21:06 +08:00
|
|
|
* Copyright (C) 2017-2020 Intel Corporation
|
2017-12-21 07:45:38 +08:00
|
|
|
*
|
2018-09-18 15:11:08 +08:00
|
|
|
* SPDX-License-Identifier: MIT
|
2017-12-21 07:45:38 +08:00
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
2020-02-23 22:20:22 +08:00
|
|
|
#include "opencl/test/unit_test/utilities/debug_file_reader_tests.inl"
|
2017-12-21 07:45:38 +08:00
|
|
|
|
2019-03-26 18:59:46 +08:00
|
|
|
using namespace NEO;
|
2017-12-21 07:45:38 +08:00
|
|
|
|
2018-03-16 17:12:38 +08:00
|
|
|
TEST(SettingsFileReader, givenTestFileWithDefaultValuesWhenTheyAreQueriedThenDefaultValuesMatch) {
|
2017-12-21 07:45:38 +08:00
|
|
|
|
|
|
|
// Use test settings file
|
2018-08-27 22:30:40 +08:00
|
|
|
std::unique_ptr<TestSettingsFileReader> reader =
|
2020-03-27 22:56:17 +08:00
|
|
|
std::unique_ptr<TestSettingsFileReader>(new TestSettingsFileReader(TestSettingsFileReader::testPath));
|
2018-08-27 22:30:40 +08:00
|
|
|
|
2017-12-21 07:45:38 +08:00
|
|
|
ASSERT_NE(nullptr, reader);
|
|
|
|
|
|
|
|
size_t debugVariableCount = 0;
|
2020-05-19 20:56:03 +08:00
|
|
|
bool variableFound = false;
|
2018-03-16 17:12:38 +08:00
|
|
|
bool compareSuccessful = false;
|
2018-08-27 22:30:40 +08:00
|
|
|
#define DECLARE_DEBUG_VARIABLE(dataType, variableName, defaultValue, description) \
|
2020-05-19 20:56:03 +08:00
|
|
|
variableFound = reader->hasSetting(#variableName); \
|
|
|
|
EXPECT_TRUE(variableFound) << #variableName; \
|
2018-08-27 22:30:40 +08:00
|
|
|
compareSuccessful = (defaultValue == reader->getSetting(#variableName, defaultValue)); \
|
|
|
|
EXPECT_TRUE(compareSuccessful) << #variableName; \
|
2017-12-21 07:45:38 +08:00
|
|
|
debugVariableCount++;
|
2020-06-15 17:16:46 +08:00
|
|
|
#include "shared/source/debug_settings/release_variables.inl"
|
|
|
|
|
2018-10-26 20:13:04 +08:00
|
|
|
#include "debug_variables.inl"
|
2017-12-21 07:45:38 +08:00
|
|
|
#undef DECLARE_DEBUG_VARIABLE
|
|
|
|
|
2019-09-13 18:14:06 +08:00
|
|
|
size_t mapCount = reader->getStringSettingsCount();
|
2017-12-21 07:45:38 +08:00
|
|
|
EXPECT_EQ(mapCount, debugVariableCount);
|
|
|
|
}
|