From 28bba92dc01b5f0f6f7bdc95448d06c10d7880bb Mon Sep 17 00:00:00 2001 From: Genaro Saucedo Tejada Date: Mon, 24 Oct 2016 18:00:58 -0500 Subject: [PATCH] sanity: Load arguments from files Python module argparse has a feature to load arguments from a file. This commit enables such feature on sanitycheck script so files prefixed by + (plus sign) are loaded during argument parsing stage and included as arguments to such script. Jira: ZEP-122 Change-Id: Ibb0a6e8464218a4f58ce4044a5a0860dc5b32480 Signed-off-by: Genaro Saucedo Tejada --- scripts/sanity_chk/sanity_daily.args | 3 +++ scripts/sanity_chk/sanity_verify.args | 3 +++ scripts/sanitycheck | 5 +++++ 3 files changed, 11 insertions(+) create mode 100644 scripts/sanity_chk/sanity_daily.args create mode 100644 scripts/sanity_chk/sanity_verify.args diff --git a/scripts/sanity_chk/sanity_daily.args b/scripts/sanity_chk/sanity_daily.args new file mode 100644 index 00000000000..05939a67cd3 --- /dev/null +++ b/scripts/sanity_chk/sanity_daily.args @@ -0,0 +1,3 @@ +--inline-logs +--all +--enable-slow \ No newline at end of file diff --git a/scripts/sanity_chk/sanity_verify.args b/scripts/sanity_chk/sanity_verify.args new file mode 100644 index 00000000000..54657ac41eb --- /dev/null +++ b/scripts/sanity_chk/sanity_verify.args @@ -0,0 +1,3 @@ +--inline-logs +--exclude-tag +footprint \ No newline at end of file diff --git a/scripts/sanitycheck b/scripts/sanitycheck index beaae8cad46..2af518f7515 100755 --- a/scripts/sanitycheck +++ b/scripts/sanitycheck @@ -150,6 +150,10 @@ Metrics (such as pass/fail state and binary size) for the last code release are stored in scripts/sanity_chk/sanity_last_release.csv. To update this, pass the --all --release options. +To load arguments from a file, write '+' before the file name, e.g., ++file_name. File content must be one or more valid arguments separated by +line break instead of white spaces. + Most everyday users will run with no arguments. """ @@ -1607,6 +1611,7 @@ def parse_arguments(): parser = argparse.ArgumentParser(description = __doc__, formatter_class = argparse.RawDescriptionHelpFormatter) + parser.fromfile_prefix_chars = "+" parser.add_argument("-p", "--platform", action="append", help="Platform filter for testing. This option may be used multiple "