summaryrefslogtreecommitdiff
path: root/cts/gpio/dut.c
diff options
context:
space:
mode:
Diffstat (limited to 'cts/gpio/dut.c')
-rw-r--r--cts/gpio/dut.c34
1 files changed, 14 insertions, 20 deletions
diff --git a/cts/gpio/dut.c b/cts/gpio/dut.c
index c1b32ef0de..20248f2642 100644
--- a/cts/gpio/dut.c
+++ b/cts/gpio/dut.c
@@ -10,7 +10,6 @@
#include "watchdog.h"
#include "dut_common.h"
#include "cts_common.h"
-#include "gpio_common.h"
enum cts_error_code sync_test(void)
{
@@ -72,43 +71,38 @@ enum cts_error_code od_read_high_test(void)
return FAILURE;
}
+#include "cts_testlist.h"
+
void cts_task(void)
{
- enum cts_error_code results[GPIO_CTS_TEST_COUNT];
+ enum cts_error_code results[CTS_TEST_ID_COUNT];
int i;
- sync();
- results[0] = sync_test();
- sync();
- results[1] = set_low_test();
- sync();
- results[2] = set_high_test();
- sync();
- results[3] = read_high_test();
- sync();
- results[4] = read_low_test();
- sync();
- results[5] = od_read_high_test();
+ for (i = 0; i < CTS_TEST_ID_COUNT; i++) {
+ sync();
+ results[i] = tests[i].run();
+ }
CPRINTS("GPIO test suite finished");
uart_flush_output();
CPRINTS("Results:");
- for (i = 0; i < GPIO_CTS_TEST_COUNT; i++) {
+ for (i = 0; i < CTS_TEST_ID_COUNT; i++) {
switch (results[i]) {
case SUCCESS:
- CPRINTS("%d) Passed", i);
+ CPRINTS("%s) Passed", tests[i].name);
break;
case FAILURE:
- CPRINTS("%d) Failed", i);
+ CPRINTS("%s) Failed", tests[i].name);
break;
case BAD_SYNC:
- CPRINTS("%d) Bad sync", i);
+ CPRINTS("%s) Bad sync", tests[i].name);
break;
case UNKNOWN:
- CPRINTS("%d) Test result unknown", i);
+ CPRINTS("%s) Test result unknown", tests[i].name);
break;
default:
- CPRINTS("%d) ErrorCode not recognized", i);
+ CPRINTS("%s) ErrorCode (%d) not recognized",
+ tests[i].name, results[i]);
break;
}
}