mirror of
https://github.com/intel/compute-runtime.git
synced 2025-09-15 13:01:45 +08:00
test: add mechanism for detecting invalid test excludes
invalid test excludes are detected by default cmake flag NEO_IGNORE_INVALID_TEST_EXCLUDES disables this validation Signed-off-by: Mateusz Jablonski <mateusz.jablonski@intel.com>
This commit is contained in:

committed by
Compute-Runtime-Automation

parent
cd983d63de
commit
b401d83110
@ -275,6 +275,10 @@ if(NOT NEO_SKIP_AUB_TESTS_RUN)
|
||||
set(NEO_SKIP_AUB_TESTS FALSE)
|
||||
endif()
|
||||
|
||||
if(NEO_IGNORE_INVALID_TEST_EXCLUDES)
|
||||
add_definitions(-DNEO_IGNORE_INVALID_TEST_EXCLUDES)
|
||||
endif()
|
||||
|
||||
message(STATUS "NEO_SKIP_AUB_TESTS: ${NEO_SKIP_AUB_TESTS}")
|
||||
message(STATUS "NEO_SKIP_AUB_TESTS_RUN: ${NEO_SKIP_AUB_TESTS_RUN}")
|
||||
|
||||
|
@ -21,6 +21,7 @@
|
||||
#define HWTEST_TEST_(test_suite_name, test_name, parent_class, parent_id, SetUpT_name, TearDownT_name) \
|
||||
CHECK_TEST_NAME_LENGTH(test_suite_name, test_name) \
|
||||
\
|
||||
bool TEST_EXCLUDE_VARIABLE(test_suite_name, test_name); \
|
||||
class GTEST_TEST_CLASS_NAME_(test_suite_name, test_name) : public parent_class { \
|
||||
\
|
||||
public: \
|
||||
@ -82,6 +83,7 @@
|
||||
#define HWTEST2_TEST_(test_suite_name, test_name, parent_class, parent_id, test_matcher) \
|
||||
CHECK_TEST_NAME_LENGTH(test_suite_name, test_name) \
|
||||
\
|
||||
bool TEST_EXCLUDE_VARIABLE(test_suite_name, test_name); \
|
||||
class GTEST_TEST_CLASS_NAME_(test_suite_name, test_name) : public parent_class { \
|
||||
\
|
||||
public: \
|
||||
@ -232,6 +234,7 @@
|
||||
#define HWCMDTEST_TEST_(cmdset_gen_base, test_suite_name, test_name, parent_class, parent_id) \
|
||||
CHECK_TEST_NAME_LENGTH(test_suite_name, test_name) \
|
||||
\
|
||||
bool TEST_EXCLUDE_VARIABLE(test_suite_name, test_name); \
|
||||
class GTEST_TEST_CLASS_NAME_(test_suite_name, test_name) : public parent_class { \
|
||||
public: \
|
||||
GTEST_TEST_CLASS_NAME_(test_suite_name, test_name) \
|
||||
@ -297,6 +300,7 @@
|
||||
// Test can use FamilyType in the test -- equivalent to Gen9Family
|
||||
#define HWTEST_P(test_suite_name, test_name) \
|
||||
CHECK_TEST_NAME_LENGTH(test_suite_name, test_name) \
|
||||
bool TEST_EXCLUDE_VARIABLE(test_suite_name, test_name); \
|
||||
class GTEST_TEST_CLASS_NAME_(test_suite_name, test_name) : public test_suite_name { \
|
||||
public: \
|
||||
GTEST_TEST_CLASS_NAME_(test_suite_name, test_name) \
|
||||
@ -350,6 +354,7 @@
|
||||
#define HWCMDTEST_P(cmdset_gen_base, test_suite_name, test_name) \
|
||||
CHECK_TEST_NAME_LENGTH(test_suite_name, test_name) \
|
||||
\
|
||||
bool TEST_EXCLUDE_VARIABLE(test_suite_name, test_name); \
|
||||
class GTEST_TEST_CLASS_NAME_(test_suite_name, test_name) : public test_suite_name { \
|
||||
public: \
|
||||
GTEST_TEST_CLASS_NAME_(test_suite_name, test_name) \
|
||||
@ -414,6 +419,7 @@
|
||||
// Macros to provide template based testing.
|
||||
// Test can use productFamily, gfxCoreFamily and FamilyType in the test
|
||||
#define HWTEST2_P(test_suite_name, test_name, test_matcher) \
|
||||
bool TEST_EXCLUDE_VARIABLE(test_suite_name, test_name); \
|
||||
class GTEST_TEST_CLASS_NAME_(test_suite_name, test_name) : public test_suite_name { \
|
||||
\
|
||||
public: \
|
||||
|
@ -11,10 +11,22 @@
|
||||
#include "shared/test/common/test_macros/test_base.h"
|
||||
#include "shared/test/common/test_macros/test_excludes.h"
|
||||
|
||||
#ifdef NEO_IGNORE_INVALID_TEST_EXCLUDES
|
||||
constexpr bool ignoreInvalidTestExcludes = true;
|
||||
#else
|
||||
constexpr bool ignoreInvalidTestExcludes = false;
|
||||
#endif
|
||||
|
||||
#define TEST_EXCLUDE_VARIABLE(test_suite_name, test_name) Test_##test_suite_name##_##test_name##_NotFound_PleaseConsiderRemovingExclude
|
||||
|
||||
#define HWTEST_EXCLUDE_PRODUCT(test_suite_name, test_name, family) \
|
||||
extern bool TEST_EXCLUDE_VARIABLE(test_suite_name, test_name); \
|
||||
struct test_suite_name##test_name##_PLATFORM_EXCLUDES_EXCLUDE_##family { \
|
||||
test_suite_name##test_name##_PLATFORM_EXCLUDES_EXCLUDE_##family() { \
|
||||
NEO::TestExcludes::addTestExclude(#test_suite_name #test_name, family); \
|
||||
if constexpr (!ignoreInvalidTestExcludes) { \
|
||||
TEST_EXCLUDE_VARIABLE(test_suite_name, test_name) = true; \
|
||||
} \
|
||||
} \
|
||||
} test_suite_name##test_name##_PLATFORM_EXCLUDES_EXCLUDE_##family##_init;
|
||||
|
||||
@ -40,6 +52,7 @@
|
||||
#define FAMILYTEST_TEST_(test_suite_name, test_name, parent_class, parent_id, match_core, match_product) \
|
||||
CHECK_TEST_NAME_LENGTH(test_suite_name, test_name) \
|
||||
\
|
||||
bool TEST_EXCLUDE_VARIABLE(test_suite_name, test_name); \
|
||||
class GTEST_TEST_CLASS_NAME_(test_suite_name, test_name) : public parent_class { \
|
||||
public: \
|
||||
GTEST_TEST_CLASS_NAME_(test_suite_name, test_name) \
|
||||
@ -90,6 +103,7 @@
|
||||
|
||||
#define FAMILYTEST_TEST_P(test_suite_name, test_name, match_core, match_product) \
|
||||
CHECK_TEST_NAME_LENGTH(test_suite_name, test_name) \
|
||||
bool TEST_EXCLUDE_VARIABLE(test_suite_name, test_name); \
|
||||
class GTEST_TEST_CLASS_NAME_(test_suite_name, test_name) : public test_suite_name { \
|
||||
public: \
|
||||
GTEST_TEST_CLASS_NAME_(test_suite_name, test_name) \
|
||||
|
Reference in New Issue
Block a user