Skip to content

Commit

Permalink
Enhancements to -t option (ARM-software#385)
Browse files Browse the repository at this point in the history
- Resolves: ARM-software#381
 - No console prints for tests not mentioned in -t options
 - Total test count aligns with the tests that are actually being run.
 - Module skip prints verbosity changed to INFO.

Signed-off-by: Srikar Josyula <srikar.josyula@arm.com>
  • Loading branch information
SrikarJosyula authored Sep 6, 2023
1 parent 3b6e10a commit ba345d5
Show file tree
Hide file tree
Showing 16 changed files with 50 additions and 41 deletions.
4 changes: 2 additions & 2 deletions val/src/avs_exerciser.c
Original file line number Diff line number Diff line change
Expand Up @@ -286,15 +286,15 @@ val_exerciser_execute_tests(uint32_t level)

for (i = 0; i < g_num_skip; i++) {
if (g_skip_test_num[i] == AVS_EXERCISER_TEST_NUM_BASE) {
val_print(AVS_PRINT_TEST, "\n USER Override - Skipping the Exerciser tests \n", 0);
val_print(AVS_PRINT_INFO, "\n USER Override - Skipping the Exerciser tests \n", 0);
return AVS_STATUS_SKIP;
}
}

/* Check if there are any tests to be executed in current module with user override options*/
status = val_check_skip_module(AVS_EXERCISER_TEST_NUM_BASE);
if (status) {
val_print(AVS_PRINT_TEST, "\n USER Override - Skipping all Exerciser tests \n", 0);
val_print(AVS_PRINT_INFO, "\n USER Override - Skipping all Exerciser tests \n", 0);
return AVS_STATUS_SKIP;
}

Expand Down
4 changes: 2 additions & 2 deletions val/src/avs_gic.c
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ val_gic_execute_tests(uint32_t level, uint32_t num_pe)

for (i = 0; i < g_num_skip; i++) {
if (g_skip_test_num[i] == AVS_GIC_TEST_NUM_BASE) {
val_print(AVS_PRINT_TEST, " USER Override - Skipping all GIC tests \n", 0);
val_print(AVS_PRINT_INFO, " USER Override - Skipping all GIC tests \n", 0);
return AVS_STATUS_SKIP;
}
}
Expand All @@ -49,7 +49,7 @@ val_gic_execute_tests(uint32_t level, uint32_t num_pe)
/* Check if there are any tests to be executed in current module with user override options*/
module_skip = val_check_skip_module(AVS_GIC_TEST_NUM_BASE);
if (module_skip) {
val_print(AVS_PRINT_TEST, "\n USER Override - Skipping all GIC tests \n", 0);
val_print(AVS_PRINT_INFO, "\n USER Override - Skipping all GIC tests \n", 0);
return AVS_STATUS_SKIP;
}

Expand Down
4 changes: 2 additions & 2 deletions val/src/avs_memory.c
Original file line number Diff line number Diff line change
Expand Up @@ -40,15 +40,15 @@ val_memory_execute_tests(uint32_t level, uint32_t num_pe)

for (i = 0 ; i < g_num_skip ; i++) {
if (g_skip_test_num[i] == AVS_MEM_MAP_TEST_NUM_BASE) {
val_print(AVS_PRINT_TEST, " USER Override - Skipping all memory tests \n", 0);
val_print(AVS_PRINT_INFO, " USER Override - Skipping all memory tests \n", 0);
return AVS_STATUS_SKIP;
}
}

/* Check if there are any tests to be executed in the current module with user override*/
status = val_check_skip_module(AVS_MEM_MAP_TEST_NUM_BASE);
if (status) {
val_print(AVS_PRINT_TEST, "\n USER Override - Skipping all memory tests \n", 0);
val_print(AVS_PRINT_INFO, "\n USER Override - Skipping all memory tests \n", 0);
return AVS_STATUS_SKIP;
}

Expand Down
4 changes: 2 additions & 2 deletions val/src/avs_mpam.c
Original file line number Diff line number Diff line change
Expand Up @@ -41,15 +41,15 @@ val_mpam_execute_tests(uint32_t level, uint32_t num_pe)

for (i = 0; i < g_num_skip; i++) {
if (g_skip_test_num[i] == AVS_MPAM_TEST_NUM_BASE) {
val_print(AVS_PRINT_TEST, " USER Override - Skipping all MPAM tests \n", 0);
val_print(AVS_PRINT_INFO, " USER Override - Skipping all MPAM tests \n", 0);
return AVS_STATUS_SKIP;
}
}

/* Check if there are any tests to be executed in the current module with user override*/
skip_module = val_check_skip_module(AVS_MPAM_TEST_NUM_BASE);
if (skip_module) {
val_print(AVS_PRINT_TEST, "\n USER Override - Skipping all MPAM tests \n", 0);
val_print(AVS_PRINT_INFO, "\n USER Override - Skipping all MPAM tests \n", 0);
return AVS_STATUS_SKIP;
}

Expand Down
4 changes: 2 additions & 2 deletions val/src/avs_nist.c
Original file line number Diff line number Diff line change
Expand Up @@ -34,15 +34,15 @@ val_nist_execute_tests(uint32_t level, uint32_t num_pe)

for (i = 0; i < g_num_skip; i++) {
if (g_skip_test_num[i] == AVS_NIST_TEST_NUM_BASE) {
val_print(AVS_PRINT_TEST, " USER Override - Skipping all NIST tests \n", 0);
val_print(AVS_PRINT_INFO, " USER Override - Skipping all NIST tests \n", 0);
return AVS_STATUS_SKIP;
}
}

/* Check if there are any tests to be executed in current module with user override options*/
status = val_check_skip_module(AVS_NIST_TEST_NUM_BASE);
if (status) {
val_print(AVS_PRINT_TEST, "\n USER Override - Skipping all NIST tests \n", 0);
val_print(AVS_PRINT_INFO, "\n USER Override - Skipping all NIST tests \n", 0);
return AVS_STATUS_SKIP;
}

Expand Down
4 changes: 2 additions & 2 deletions val/src/avs_pcie.c
Original file line number Diff line number Diff line change
Expand Up @@ -290,15 +290,15 @@ val_pcie_execute_tests(uint32_t level, uint32_t num_pe)

for (i = 0; i < g_num_skip; i++) {
if (g_skip_test_num[i] == AVS_PCIE_TEST_NUM_BASE) {
val_print(AVS_PRINT_TEST, "\n USER Override - Skipping all PCIe tests \n", 0);
val_print(AVS_PRINT_INFO, "\n USER Override - Skipping all PCIe tests \n", 0);
return AVS_STATUS_SKIP;
}
}

/* Check if there are any tests to be executed in current module with user override options*/
status = val_check_skip_module(AVS_PCIE_TEST_NUM_BASE);
if (status) {
val_print(AVS_PRINT_TEST, "\n USER Override - Skipping all PCIe tests \n", 0);
val_print(AVS_PRINT_INFO, "\n USER Override - Skipping all PCIe tests \n", 0);
return AVS_STATUS_SKIP;
}

Expand Down
4 changes: 2 additions & 2 deletions val/src/avs_pe.c
Original file line number Diff line number Diff line change
Expand Up @@ -46,15 +46,15 @@ val_pe_execute_tests(uint32_t level, uint32_t num_pe)

for (i = 0; i < g_num_skip; i++) {
if (g_skip_test_num[i] == AVS_PE_TEST_NUM_BASE) {
val_print(AVS_PRINT_TEST, "\n USER Override - Skipping all PE tests \n", 0);
val_print(AVS_PRINT_INFO, "\n USER Override - Skipping all PE tests \n", 0);
return AVS_STATUS_SKIP;
}
}

/* Check if there are any tests to be executed in current module with user override options*/
status = val_check_skip_module(AVS_PE_TEST_NUM_BASE);
if (status) {
val_print(AVS_PRINT_TEST, "\n USER Override - Skipping all PE tests \n", 0);
val_print(AVS_PRINT_INFO, "\n USER Override - Skipping all PE tests \n", 0);
return AVS_STATUS_SKIP;
}

Expand Down
4 changes: 2 additions & 2 deletions val/src/avs_peripherals.c
Original file line number Diff line number Diff line change
Expand Up @@ -41,15 +41,15 @@ val_peripheral_execute_tests(uint32_t level, uint32_t num_pe)

for (i = 0; i < g_num_skip; i++) {
if (g_skip_test_num[i] == AVS_PER_TEST_NUM_BASE) {
val_print(AVS_PRINT_TEST, " USER Override - Skipping all Peripheral tests \n", 0);
val_print(AVS_PRINT_INFO, " USER Override - Skipping all Peripheral tests \n", 0);
return AVS_STATUS_SKIP;
}
}

/* Check if there are any tests to be executed in current module with user override options*/
skip_module = val_check_skip_module(AVS_PER_TEST_NUM_BASE);
if (skip_module) {
val_print(AVS_PRINT_TEST, "\n USER Override - Skipping all Peripheral tests \n", 0);
val_print(AVS_PRINT_INFO, "\n USER Override - Skipping all Peripheral tests \n", 0);
return AVS_STATUS_SKIP;
}

Expand Down
4 changes: 2 additions & 2 deletions val/src/avs_pmu.c
Original file line number Diff line number Diff line change
Expand Up @@ -40,15 +40,15 @@ val_pmu_execute_tests(uint32_t level, uint32_t num_pe)

for (i = 0; i < g_num_skip; i++) {
if (g_skip_test_num[i] == AVS_PMU_TEST_NUM_BASE) {
val_print(AVS_PRINT_TEST, " USER Override - Skipping all PMU tests \n", 0);
val_print(AVS_PRINT_INFO, " USER Override - Skipping all PMU tests \n", 0);
return AVS_STATUS_SKIP;
}
}

/* Check if there are any tests to be executed in current module with user override options*/
skip_module = val_check_skip_module(AVS_PMU_TEST_NUM_BASE);
if (skip_module) {
val_print(AVS_PRINT_TEST, "\n USER Override - Skipping all PMU tests \n", 0);
val_print(AVS_PRINT_INFO, "\n USER Override - Skipping all PMU tests \n", 0);
return AVS_STATUS_SKIP;
}

Expand Down
4 changes: 2 additions & 2 deletions val/src/avs_ras.c
Original file line number Diff line number Diff line change
Expand Up @@ -40,15 +40,15 @@ val_ras_execute_tests(uint32_t level, uint32_t num_pe)

for (i = 0; i < g_num_skip; i++) {
if (g_skip_test_num[i] == AVS_RAS_TEST_NUM_BASE) {
val_print(AVS_PRINT_TEST, "\n USER Override - Skipping all RAS tests \n", 0);
val_print(AVS_PRINT_INFO, "\n USER Override - Skipping all RAS tests \n", 0);
return AVS_STATUS_SKIP;
}
}

/* Check if there are any tests to be executed in current module with user override options*/
skip_module = val_check_skip_module(AVS_RAS_TEST_NUM_BASE);
if (skip_module) {
val_print(AVS_PRINT_TEST, "\n USER Override - Skipping all RAS tests \n", 0);
val_print(AVS_PRINT_INFO, "\n USER Override - Skipping all RAS tests \n", 0);
return AVS_STATUS_SKIP;
}

Expand Down
6 changes: 3 additions & 3 deletions val/src/avs_smmu.c
Original file line number Diff line number Diff line change
Expand Up @@ -59,15 +59,15 @@ val_smmu_execute_tests(uint32_t level, uint32_t num_pe)

for (i = 0; i < g_num_skip; i++) {
if (g_skip_test_num[i] == AVS_SMMU_TEST_NUM_BASE) {
val_print(AVS_PRINT_TEST, " USER Override - Skipping all SMMU tests \n", 0);
val_print(AVS_PRINT_INFO, " USER Override - Skipping all SMMU tests \n", 0);
return AVS_STATUS_SKIP;
}
}

/* Check if there are any tests to be executed in current module with user override options*/
status = val_check_skip_module(AVS_SMMU_TEST_NUM_BASE);
if (status) {
val_print(AVS_PRINT_TEST, "\n USER Override - Skipping all SMMU tests \n", 0);
val_print(AVS_PRINT_INFO, "\n USER Override - Skipping all SMMU tests \n", 0);
return AVS_STATUS_SKIP;
}

Expand Down Expand Up @@ -224,4 +224,4 @@ val_smmu_pa2iova(uint32_t smmu_index, uint64_t pa)

smmu_base = val_smmu_get_info(SMMU_CTRL_BASE, smmu_index);
return pal_smmu_pa2iova(smmu_base, pa);
}
}
5 changes: 5 additions & 0 deletions val/src/avs_status.c
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
#include "include/sbsa_avs_val.h"
#include "include/sbsa_avs_common.h"

extern uint32_t g_override_skip;

/**
@brief Parse the input status and print the appropriate information to console
Expand All @@ -32,6 +33,10 @@ void
val_report_status(uint32_t index, uint32_t status, char8_t *ruleid)
{

/* Test stays quiet if it is overridden by any of the user options */
if (!g_override_skip)
return;

if (IS_TEST_FAIL(status)) {
val_print(AVS_PRINT_ERR, "\n Failed on PE - %4d ", index);
val_print(AVS_PRINT_ERR, "for Level= %2d ", (status >> LEVEL_BIT) & LEVEL_MASK);
Expand Down
28 changes: 16 additions & 12 deletions val/src/avs_test_infra.c
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@
#include "include/sbsa_avs_pe.h"
#include "include/sbsa_avs_common.h"

uint32_t g_override_skip;

/**
@brief This API calls PAL layer to print a formatted string
to the output console.
Expand Down Expand Up @@ -295,22 +297,16 @@ val_initialize_test(uint32_t test_num, char8_t *desc, uint32_t num_pe, uint32_t
{

uint32_t i;
uint32_t override_skip = 0;
uint32_t index = val_pe_get_index_mpid(val_pe_get_mpid());

val_print(AVS_PRINT_ERR, "%4d : ", test_num); //Always print this
val_print(AVS_PRINT_TEST, desc, 0);
val_report_status(0, SBSA_AVS_START(level, test_num), ruleid);
val_pe_initialize_default_exception_handler(val_pe_default_esr);

g_sbsa_tests_total++;
g_override_skip = 0;

for (i = 0; i < num_pe; i++)
val_set_status(i, RESULT_PENDING(level, test_num));

/* Skip the test if it one of the -skip option parameters */
for (i = 0; i < g_num_skip ; i++) {
if (g_skip_test_num[i] == test_num) {
val_print(AVS_PRINT_TEST, "\n USER OVERRIDE - Skip Test ", 0);
val_set_status(index, RESULT_SKIP(g_sbsa_level, test_num, 0));
return AVS_STATUS_SKIP;
}
Expand All @@ -319,7 +315,7 @@ val_initialize_test(uint32_t test_num, char8_t *desc, uint32_t num_pe, uint32_t
/* Don't skip if test_num is one of the -t option parameters */
for (i = 0; i < g_num_tests; i++) {
if (test_num == g_execute_tests[i]) {
override_skip++;
g_override_skip++;
}
}

Expand All @@ -328,16 +324,24 @@ val_initialize_test(uint32_t test_num, char8_t *desc, uint32_t num_pe, uint32_t
if ((test_num - g_execute_modules[i]) > 0 &&
(test_num - g_execute_modules[i]) < 100)
{
override_skip++;
g_override_skip++;
}
}

if ((!override_skip) && (g_num_tests || g_num_modules)) {
val_print(AVS_PRINT_TEST, "\n USER OVERRIDE VIA SPECIFIC TESTS - Skip Test ", 0);
if ((!g_override_skip) && (g_num_tests || g_num_modules)) {
val_set_status(index, RESULT_SKIP(g_sbsa_level, test_num, 0));
return AVS_STATUS_SKIP;
}

g_override_skip = 1;

val_print(AVS_PRINT_ERR, "%4d : ", test_num);
val_print(AVS_PRINT_TEST, desc, 0);
val_report_status(0, SBSA_AVS_START(level, test_num), ruleid);
val_pe_initialize_default_exception_handler(val_pe_default_esr);

g_sbsa_tests_total++;

return AVS_STATUS_PASS;
}

Expand Down
4 changes: 2 additions & 2 deletions val/src/avs_timer.c
Original file line number Diff line number Diff line change
Expand Up @@ -40,15 +40,15 @@ val_timer_execute_tests(uint32_t level, uint32_t num_pe)

for (i = 0; i < g_num_skip; i++) {
if (g_skip_test_num[i] == AVS_TIMER_TEST_NUM_BASE) {
val_print(AVS_PRINT_TEST, " USER Override - Skipping all Timer tests \n", 0);
val_print(AVS_PRINT_INFO, " USER Override - Skipping all Timer tests \n", 0);
return AVS_STATUS_SKIP;
}
}

/* Check if there are any tests to be executed in current module with user override options*/
skip_module = val_check_skip_module(AVS_TIMER_TEST_NUM_BASE);
if (skip_module) {
val_print(AVS_PRINT_TEST, "\n USER Override - Skipping all Timer tests \n", 0);
val_print(AVS_PRINT_INFO, "\n USER Override - Skipping all Timer tests \n", 0);
return AVS_STATUS_SKIP;
}

Expand Down
4 changes: 2 additions & 2 deletions val/src/avs_wakeup.c
Original file line number Diff line number Diff line change
Expand Up @@ -41,15 +41,15 @@ val_wakeup_execute_tests(uint32_t level, uint32_t num_pe)

for (i = 0; i < g_num_skip; i++) {
if (g_skip_test_num[i] == AVS_WAKEUP_TEST_NUM_BASE) {
val_print(AVS_PRINT_TEST, " USER Override - Skipping all Wakeup tests \n", 0);
val_print(AVS_PRINT_INFO, " USER Override - Skipping all Wakeup tests \n", 0);
return AVS_STATUS_SKIP;
}
}

/* Check if there are any tests to be executed in current module with user override options*/
skip_module = val_check_skip_module(AVS_WAKEUP_TEST_NUM_BASE);
if (skip_module) {
val_print(AVS_PRINT_TEST, "\n USER Override - Skipping all Wakeup tests \n", 0);
val_print(AVS_PRINT_INFO, "\n USER Override - Skipping all Wakeup tests \n", 0);
return AVS_STATUS_SKIP;
}

Expand Down
4 changes: 2 additions & 2 deletions val/src/avs_wd.c
Original file line number Diff line number Diff line change
Expand Up @@ -38,15 +38,15 @@ val_wd_execute_tests(uint32_t level, uint32_t num_pe)

for (i = 0; i < g_num_skip; i++) {
if (g_skip_test_num[i] == AVS_WD_TEST_NUM_BASE) {
val_print(AVS_PRINT_TEST, " USER Override - Skipping all Watchdog tests \n", 0);
val_print(AVS_PRINT_INFO, " USER Override - Skipping all Watchdog tests \n", 0);
return AVS_STATUS_SKIP;
}
}

/* Check if there are any tests to be executed in current module with user override options*/
status = val_check_skip_module(AVS_WD_TEST_NUM_BASE);
if (status) {
val_print(AVS_PRINT_TEST, "\n USER Override - Skipping all Watchdog tests \n", 0);
val_print(AVS_PRINT_INFO, "\n USER Override - Skipping all Watchdog tests \n", 0);
return AVS_STATUS_SKIP;
}

Expand Down

0 comments on commit ba345d5

Please sign in to comment.