summaryrefslogtreecommitdiff
path: root/test/stress.c
diff options
context:
space:
mode:
authorVic Yang <victoryang@chromium.org>2013-05-09 07:16:01 +0800
committerChromeBot <chrome-bot@google.com>2013-05-08 18:11:01 -0700
commite71f008388b3c69cf01a534c5084d7e3a441149b (patch)
treec68a0ba7443eef434ca3799ae85b4207ccfbc68c /test/stress.c
parent4f463ebc46463d397e8a4c5296ad2168ce881bde (diff)
downloadchrome-ec-e71f008388b3c69cf01a534c5084d7e3a441149b.tar.gz
Put test utility macros in header
Several test utility macros have been duplicated across tests. Let's put them in a single place. BUG=chrome-os-partner:19236 TEST='make runtests', 'BOARD=spring make tests' BRANCH=None Change-Id: Ib0c9f829715425cc23e33b8ef456b17dfadab13c Signed-off-by: Vic Yang <victoryang@chromium.org> Reviewed-on: https://gerrit.chromium.org/gerrit/50513 Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
Diffstat (limited to 'test/stress.c')
-rw-r--r--test/stress.c15
1 files changed, 4 insertions, 11 deletions
diff --git a/test/stress.c b/test/stress.c
index 8a69d84b19..e62212e69f 100644
--- a/test/stress.c
+++ b/test/stress.c
@@ -9,6 +9,7 @@
#include "console.h"
#include "ec_commands.h"
#include "i2c.h"
+#include "test_util.h"
#include "timer.h"
#include "util.h"
@@ -147,9 +148,9 @@ static int test_adc(void)
}
#endif
-static int command_run_test(int argc, char **argv)
+void run_test(void)
{
- error_count = 0;
+ test_reset();
#ifdef CONFIG_I2C
RUN_STRESS_TEST("I2C Stress Test", test_i2c, I2C_TEST_ITERATION);
@@ -158,13 +159,5 @@ static int command_run_test(int argc, char **argv)
RUN_STRESS_TEST("ADC Stress Test", test_adc, ADC_TEST_ITERATION);
#endif
- if (error_count) {
- ccprintf("Failed %d tests!\n", error_count);
- return EC_ERROR_UNKNOWN;
- } else {
- ccprintf("Pass!\n");
- return EC_SUCCESS;
- }
+ test_print_result();
}
-DECLARE_CONSOLE_COMMAND(runtest, command_run_test,
- NULL, NULL, NULL);