/* * Copyright (C) 2021 Intel Corporation * * SPDX-License-Identifier: MIT * */ #include "shared/test/common/test_macros/test_excludes.h" #include "shared/source/helpers/debug_helpers.h" #include #include #include #include using namespace NEO; PRODUCT_FAMILY productFamily = {}; GFXCORE_FAMILY renderCoreFamily = {}; static std::unique_ptr>> pProductExcludesPerTest; static std::unique_ptr>> pGfxExcludesPerTest; bool isExcluded(const char *testName, const uint32_t family, std::unique_ptr>> &pExcludesPerTest) { if ((pExcludesPerTest == nullptr) || pExcludesPerTest->count(testName) == 0) { return false; } return (pExcludesPerTest->at(testName).count(family) > 0); } void addExclude(const char *testName, const uint32_t family, std::unique_ptr>> &pExcludesPerTest) { if (pExcludesPerTest == nullptr) { pExcludesPerTest = std::make_unique>>(); } if (pExcludesPerTest->count(testName) == 0) { pExcludesPerTest->insert(std::make_pair(testName, std::unordered_set{})); } pExcludesPerTest->at(testName).insert(family); } bool TestExcludes::isTestExcluded(const char *testName, const PRODUCT_FAMILY productFamily, const GFXCORE_FAMILY gfxFamily) { return (isExcluded(testName, productFamily, pProductExcludesPerTest) || isExcluded(testName, gfxFamily, pGfxExcludesPerTest)); } void TestExcludes::addTestExclude(const char *testName, const PRODUCT_FAMILY family) { addExclude(testName, family, pProductExcludesPerTest); } void TestExcludes::addTestExclude(const char *testName, const GFXCORE_FAMILY family) { addExclude(testName, family, pGfxExcludesPerTest); }