mirror of
https://github.com/intel/compute-runtime.git
synced 2025-09-10 12:53:42 +08:00
Add param to print number of tests
Related-To: NEO-6407 Signed-off-by: Mateusz Hoppe <mateusz.hoppe@intel.com>
This commit is contained in:

committed by
Compute-Runtime-Automation

parent
9dabc2db0c
commit
5d4771a31b
@ -21,6 +21,7 @@
|
||||
#include "shared/test/common/mocks/mock_gmm_client_context.h"
|
||||
#include "shared/test/common/mocks/mock_sip.h"
|
||||
#include "shared/test/unit_test/base_ult_config_listener.h"
|
||||
#include "shared/test/unit_test/test_stats.h"
|
||||
|
||||
#include "level_zero/core/source/cmdlist/cmdlist.h"
|
||||
#include "level_zero/core/source/compiler_interface/l0_reg_path.h"
|
||||
@ -146,6 +147,7 @@ void applyWorkarounds() {
|
||||
int main(int argc, char **argv) {
|
||||
bool useDefaultListener = false;
|
||||
bool setupFeatureTableAndWorkaroundTable = testMode == TestMode::AubTests ? true : false;
|
||||
bool showTestStats = false;
|
||||
applyWorkarounds();
|
||||
|
||||
testing::InitGoogleMock(&argc, argv);
|
||||
@ -230,9 +232,16 @@ int main(int argc, char **argv) {
|
||||
}
|
||||
} else if (!strcmp("--enable_default_listener", argv[i])) {
|
||||
useDefaultListener = true;
|
||||
} else if (!strcmp("--show_test_stats", argv[i])) {
|
||||
showTestStats = true;
|
||||
}
|
||||
}
|
||||
|
||||
if (showTestStats) {
|
||||
std::cout << getTestStats() << std::endl;
|
||||
return 0;
|
||||
}
|
||||
|
||||
productFamily = hwInfoForTests.platform.eProductFamily;
|
||||
renderCoreFamily = hwInfoForTests.platform.eRenderCoreFamily;
|
||||
uint32_t threadsPerEu = hwInfoConfigFactory[productFamily]->threadsPerEu;
|
||||
|
@ -22,6 +22,7 @@
|
||||
#include "shared/test/common/mocks/mock_gmm_client_context.h"
|
||||
#include "shared/test/common/mocks/mock_sip.h"
|
||||
#include "shared/test/common/test_macros/test_checks_shared.h"
|
||||
#include "shared/test/unit_test/test_stats.h"
|
||||
#include "shared/test/unit_test/tests_configuration.h"
|
||||
|
||||
#include "opencl/source/os_interface/ocl_reg_path.h"
|
||||
@ -195,7 +196,7 @@ int main(int argc, char **argv) {
|
||||
bool enable_alarm = true;
|
||||
bool enable_abrt = true;
|
||||
bool setupFeatureTableAndWorkaroundTable = testMode == TestMode::AubTests ? true : false;
|
||||
|
||||
bool showTestStats = false;
|
||||
applyWorkarounds();
|
||||
|
||||
#if defined(__linux__)
|
||||
@ -242,6 +243,8 @@ int main(int argc, char **argv) {
|
||||
useDefaultListener = true;
|
||||
} else if (!strcmp("--disable_alarm", argv[i])) {
|
||||
enable_alarm = false;
|
||||
} else if (!strcmp("--show_test_stats", argv[i])) {
|
||||
showTestStats = true;
|
||||
} else if (!strcmp("--disable_pagefaulting_tests", argv[i])) { //disable tests which raise page fault signal during execution
|
||||
NEO::PagaFaultManagerTestConfig::disabled = true;
|
||||
} else if (!strcmp("--tbx", argv[i])) {
|
||||
@ -323,6 +326,11 @@ int main(int argc, char **argv) {
|
||||
}
|
||||
}
|
||||
|
||||
if (showTestStats) {
|
||||
std::cout << getTestStats() << std::endl;
|
||||
return 0;
|
||||
}
|
||||
|
||||
productFamily = hwInfoForTests.platform.eProductFamily;
|
||||
renderCoreFamily = hwInfoForTests.platform.eRenderCoreFamily;
|
||||
uint32_t threadsPerEu = hwInfoConfigFactory[productFamily]->threadsPerEu;
|
||||
|
@ -8,6 +8,7 @@
|
||||
#include "shared/source/os_interface/os_library.h"
|
||||
#include "shared/test/common/helpers/custom_event_listener.h"
|
||||
#include "shared/test/common/helpers/test_files.h"
|
||||
#include "shared/test/unit_test/test_stats.h"
|
||||
|
||||
#include "environment.h"
|
||||
#include "limits.h"
|
||||
@ -37,6 +38,8 @@ std::string getRunPath() {
|
||||
int main(int argc, char **argv) {
|
||||
int retVal = 0;
|
||||
bool useDefaultListener = false;
|
||||
bool showTestStats = false;
|
||||
|
||||
std::string devicePrefix("skl");
|
||||
std::string familyNameWithType("Gen9core");
|
||||
std::string revId("0");
|
||||
@ -76,10 +79,17 @@ int main(int argc, char **argv) {
|
||||
} else if (strcmp("--rev_id", argv[i]) == 0) {
|
||||
++i;
|
||||
revId = argv[i];
|
||||
} else if (!strcmp("--show_test_stats", argv[i])) {
|
||||
showTestStats = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (showTestStats) {
|
||||
std::cout << getTestStats() << std::endl;
|
||||
return 0;
|
||||
}
|
||||
|
||||
for (unsigned int productId = 0; productId < IGFX_MAX_PRODUCT; ++productId) {
|
||||
if (NEO::hardwarePrefix[productId] && (0 == strcmp(devicePrefix.c_str(), NEO::hardwarePrefix[productId]))) {
|
||||
if (NEO::hardwareInfoTable[productId]) {
|
||||
|
@ -24,6 +24,7 @@
|
||||
#include "shared/test/common/mocks/mock_sip.h"
|
||||
#include "shared/test/common/test_macros/test_checks_shared.h"
|
||||
#include "shared/test/unit_test/base_ult_config_listener.h"
|
||||
#include "shared/test/unit_test/test_stats.h"
|
||||
#include "shared/test/unit_test/tests_configuration.h"
|
||||
|
||||
#include "gmock/gmock.h"
|
||||
@ -180,7 +181,7 @@ int main(int argc, char **argv) {
|
||||
bool useDefaultListener = false;
|
||||
bool enable_alarm = true;
|
||||
bool setupFeatureTableAndWorkaroundTable = testMode == TestMode::AubTests ? true : false;
|
||||
|
||||
bool showTestStats = false;
|
||||
applyWorkarounds();
|
||||
|
||||
#if defined(__linux__)
|
||||
@ -220,6 +221,8 @@ int main(int argc, char **argv) {
|
||||
useDefaultListener = true;
|
||||
} else if (!strcmp("--disable_alarm", argv[i])) {
|
||||
enable_alarm = false;
|
||||
} else if (!strcmp("--show_test_stats", argv[i])) {
|
||||
showTestStats = true;
|
||||
} else if (!strcmp("--disable_pagefaulting_tests", argv[i])) { //disable tests which raise page fault signal during execution
|
||||
NEO::PagaFaultManagerTestConfig::disabled = true;
|
||||
} else if (!strcmp("--tbx", argv[i])) {
|
||||
@ -301,6 +304,11 @@ int main(int argc, char **argv) {
|
||||
}
|
||||
}
|
||||
|
||||
if (showTestStats) {
|
||||
std::cout << getTestStats() << std::endl;
|
||||
return 0;
|
||||
}
|
||||
|
||||
productFamily = hwInfoForTests.platform.eProductFamily;
|
||||
renderCoreFamily = hwInfoForTests.platform.eRenderCoreFamily;
|
||||
uint32_t threadsPerEu = hwInfoConfigFactory[productFamily]->threadsPerEu;
|
||||
|
25
shared/test/unit_test/test_stats.h
Normal file
25
shared/test/unit_test/test_stats.h
Normal file
@ -0,0 +1,25 @@
|
||||
/*
|
||||
* Copyright (C) 2021 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
#include "gmock/gmock.h"
|
||||
|
||||
#include <sstream>
|
||||
#include <string>
|
||||
|
||||
std::string getTestStats() {
|
||||
std::string output;
|
||||
std::stringstream stream;
|
||||
|
||||
stream << "Total test count: " << ::testing::UnitTest::GetInstance()->total_test_count() << std::endl;
|
||||
stream << "Test to run count: " << ::testing::UnitTest::GetInstance()->test_to_run_count() << std::endl;
|
||||
stream << "Reportable test count: " << ::testing::UnitTest::GetInstance()->reportable_test_count() << std::endl;
|
||||
stream << "Disabled test count: " << ::testing::UnitTest::GetInstance()->disabled_test_count() << std::endl;
|
||||
stream << "Reportable disabled test count: " << ::testing::UnitTest::GetInstance()->reportable_disabled_test_count() << std::endl;
|
||||
|
||||
return stream.str();
|
||||
}
|
Reference in New Issue
Block a user