summaryrefslogtreecommitdiff
path: root/fuzz
diff options
context:
space:
mode:
authorTom Hughes <tomhughes@chromium.org>2020-05-19 14:05:12 -0700
committerCommit Bot <commit-bot@chromium.org>2020-05-30 05:16:26 +0000
commit99434726be49517332272752af6dffefdea7bb8a (patch)
tree0a4ae6f5e1e847a1b13d63310e31b297c9f6d387 /fuzz
parent3590a14bcf9a1a575d41464285efe981f21dfdb6 (diff)
downloadchrome-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 'fuzz')
-rw-r--r--fuzz/host_command_fuzz.c2
-rw-r--r--fuzz/usb_pd_fuzz.c2
2 files changed, 2 insertions, 2 deletions
diff --git a/fuzz/host_command_fuzz.c b/fuzz/host_command_fuzz.c
index 5d490bc192..c4f49c9525 100644
--- a/fuzz/host_command_fuzz.c
+++ b/fuzz/host_command_fuzz.c
@@ -131,7 +131,7 @@ static int hostcmd_fill(const uint8_t *data, size_t size)
static pthread_cond_t done_cond;
static pthread_mutex_t lock;
-void run_test(void)
+void run_test(int argc, char **argv)
{
ccprints("Fuzzing task started");
wait_for_task_started();
diff --git a/fuzz/usb_pd_fuzz.c b/fuzz/usb_pd_fuzz.c
index 22c856ccff..1c0a40f225 100644
--- a/fuzz/usb_pd_fuzz.c
+++ b/fuzz/usb_pd_fuzz.c
@@ -161,7 +161,7 @@ enum tcpc_cc_voltage_status next_cc1, next_cc2;
const int MAX_MESSAGES = 8;
static struct message messages[MAX_MESSAGES];
-void run_test(void)
+void run_test(int argc, char **argv)
{
uint8_t port = PORT0;
int i;