diff options
author | Tom Hughes <tomhughes@chromium.org> | 2020-05-19 14:05:12 -0700 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2020-05-30 05:16:26 +0000 |
commit | 99434726be49517332272752af6dffefdea7bb8a (patch) | |
tree | 0a4ae6f5e1e847a1b13d63310e31b297c9f6d387 /common/test_util.c | |
parent | 3590a14bcf9a1a575d41464285efe981f21dfdb6 (diff) | |
download | chrome-ec-99434726be49517332272752af6dffefdea7bb8a.tar.gz |
test: Pass commandline arguments to run_test
run_test is called by the "runtest" console command. Console commands
can take arguments, so pass along the arguments to run_test to allow
parameters to be passed to run_test.
The following command was used for automatic replacement:
git grep --name-only 'void run_test(void)' |\
xargs sed -i 's#void run_test(void)#void run_test(int argc, char **argv)##'
BRANCH=none
BUG=b:155897971
TEST=make buildall -j
TEST=Build and flash flash_write_protect test
> runtest 1
Signed-off-by: Tom Hughes <tomhughes@chromium.org>
Change-Id: Ib20b955d5ec6b98f525c94c24aadefd7a6a320a5
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2209418
Reviewed-by: Yicheng Li <yichengli@chromium.org>
Commit-Queue: Yicheng Li <yichengli@chromium.org>
Tested-by: Yicheng Li <yichengli@chromium.org>
Diffstat (limited to 'common/test_util.c')
-rw-r--r-- | common/test_util.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/common/test_util.c b/common/test_util.c index 6ad1474700..0fc6306c70 100644 --- a/common/test_util.c +++ b/common/test_util.c @@ -29,7 +29,7 @@ struct test_util_tag { int __test_error_count; /* Weak reference function as an entry point for unit test */ -test_mockable void run_test(void) { } +test_mockable void run_test(int argc, char **argv) { } /* Default dummy test init */ test_mockable void test_init(void) { } @@ -199,7 +199,7 @@ DECLARE_HOOK(HOOK_SYSJUMP, preserve_state, HOOK_PRIO_DEFAULT); static int command_run_test(int argc, char **argv) { - run_test(); + run_test(argc, argv); return EC_SUCCESS; } DECLARE_CONSOLE_COMMAND(runtest, command_run_test, |