mirror of
https://github.com/intel/compute-runtime.git
synced 2026-01-03 06:49:52 +08:00
test: add command line option to change error count to display differences
Signed-off-by: Zbigniew Zdanowicz <zbigniew.zdanowicz@intel.com>
This commit is contained in:
committed by
Compute-Runtime-Automation
parent
d060d0b6dd
commit
60430c073e
@@ -27,6 +27,7 @@ struct LoadedDriverExtensions {
|
||||
static LoadedDriverExtensions driverExtensions;
|
||||
|
||||
bool verbose;
|
||||
uint32_t overrideErrorMax = 0;
|
||||
|
||||
bool isParamEnabled(int argc, char *argv[], const char *shortName, const char *longName) {
|
||||
char **arg = &argv[1];
|
||||
@@ -214,6 +215,10 @@ uint32_t getBufferLength(int argc, char *argv[], uint32_t defaultLength) {
|
||||
return length;
|
||||
}
|
||||
|
||||
void getErrorMax(int argc, char *argv[]) {
|
||||
overrideErrorMax = getParamValue(argc, argv, "-em", "--errorMax", 0);
|
||||
}
|
||||
|
||||
void printResult(bool aubMode, bool outputValidationSuccessful, const std::string &blackBoxName, const std::string ¤tTest) {
|
||||
std::cout << std::endl
|
||||
<< blackBoxName;
|
||||
|
||||
@@ -79,6 +79,8 @@ void selectQueueMode(ze_command_queue_desc_t &desc, bool useSync);
|
||||
|
||||
uint32_t getBufferLength(int argc, char *argv[], uint32_t defaultLength);
|
||||
|
||||
void getErrorMax(int argc, char *argv[]);
|
||||
|
||||
void printResult(bool aubMode, bool outputValidationSuccessful, const std::string &blackBoxName, const std::string ¤tTest);
|
||||
|
||||
void printResult(bool aubMode, bool outputValidationSuccessful, const std::string &blackBoxName);
|
||||
@@ -224,6 +226,8 @@ inline bool validate(const void *expected, const void *tested, size_t len) {
|
||||
return resultsAreOk;
|
||||
}
|
||||
|
||||
extern uint32_t overrideErrorMax;
|
||||
|
||||
template <typename T>
|
||||
inline bool validateToValue(const T expected, const void *tested, size_t len) {
|
||||
bool resultsAreOk = true;
|
||||
@@ -232,7 +236,7 @@ inline bool validateToValue(const T expected, const void *tested, size_t len) {
|
||||
const T *testedT = reinterpret_cast<const T *>(tested);
|
||||
uint32_t errorsCount = 0;
|
||||
uint32_t errorsMax = verbose ? 20 : 1;
|
||||
|
||||
errorsMax = overrideErrorMax > 0 ? overrideErrorMax : errorsMax;
|
||||
while (offset < len) {
|
||||
if (expected != testedT[offset]) {
|
||||
resultsAreOk = false;
|
||||
|
||||
Reference in New Issue
Block a user