summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJacob Keller <jacob.e.keller@intel.com>2014-03-06 17:12:51 -0800
committerArtem Bityutskiy <artem.bityutskiy@linux.intel.com>2014-03-10 17:03:35 +0200
commit850416c8c388497a4c897c5a8d409d00fa3ac502 (patch)
tree2dbbb2891b67e0e881b2be2fda80c08ad3c3c875
parent9d1b83c78d1a9862713b448c7f8b5caa768ce0ac (diff)
downloadaiaiai-850416c8c388497a4c897c5a8d409d00fa3ac502.tar.gz
aiaiai-email: move test-patchset options into the configuration file
This patch modifies the configuration file to include most of the options around the validator command, so that those no longer have to be specified manually. This does break compatability with the current validator setup, since those old options must now be specified on the command line. - v2 * Fix typo in coccinelle variable Signed-off-by: Jacob Keller <jacob.e.keller@intel.com>
-rw-r--r--doc/TODO.txt6
-rw-r--r--doc/email/example-aiaiai.cfg28
-rw-r--r--email/aiaiai-email-sh-functions31
-rwxr-xr-xemail/aiaiai-email-test-patchset58
4 files changed, 70 insertions, 53 deletions
diff --git a/doc/TODO.txt b/doc/TODO.txt
index adc9a97..204825e 100644
--- a/doc/TODO.txt
+++ b/doc/TODO.txt
@@ -10,12 +10,6 @@ implementing them.
containing the text for end-users to refer instead. Just like
email.preamble refers the file, which contains the preamble. This is more
flexible and consistent.
- * Move command-line options of 'aiaiai-email-*' scripts to the configuration
- file. This should make it simpler for users to configure the whole thing
- when all the knobs are in one place. Just make each script to parse the
- config file and pick own configuration from there. Namely, most of
- the 'aiaiai-email-dispatcher', 'aiaiai-email-testpatchset', and
- 'aiaiai-email-lda' options have to go away.
* Eventually make non-email scripts (aiaiai-test-patchset) also
support the config file. This could be an alternative to specifying
everythig via options. E.g., would could run
diff --git a/doc/email/example-aiaiai.cfg b/doc/email/example-aiaiai.cfg
index 8b3c9b3..9e63160 100644
--- a/doc/email/example-aiaiai.cfg
+++ b/doc/email/example-aiaiai.cfg
@@ -85,6 +85,34 @@
# "make" command. For example, W=2 KALLSYMS_EXTRA_PASS=1.
kmake_opts =
+ # List of targets (space seperated) for which to run a kernel make.
+ # Leaving this empty will default to "all" as the only target. However,
+ # the "all" target is not implicit so you should explicitly have it in
+ # the list if you want it to run.
+ targets = all namespacecheck
+
+ # Path to the directory containing the deconfig files (those specified
+ # for each project). Leave empty to use the kernel tree default
+ # configs.
+ defconfigdir =
+
+ # Whether to test bisectability between patches in a series (1), or
+ # only to check results of the squished patch-set (0)
+ bisectability = 0
+
+ # Set to (1) to enable sparse during kernel builds
+ sparse = 1
+
+ # Set to (1) to enable smatch during kernel builds
+ smatch = 0
+
+ # Set to (1) to enable cppcheck during kernel builds
+ cppcheck = 0
+
+ # Set to (1) to enable coccinelle scripts during kernel builds
+ coccinelle = 1
+
+
# The e-mail front-end may operate on several project. Each project has its
# own kernel tree, kernel configuration, and some other settings. These are
# configured in per-project sections. Section names have to start with "prj_"
diff --git a/email/aiaiai-email-sh-functions b/email/aiaiai-email-sh-functions
index c3d396c..f21884b 100644
--- a/email/aiaiai-email-sh-functions
+++ b/email/aiaiai-email-sh-functions
@@ -174,7 +174,9 @@ parse_config()
# file:
#
# __dcfg_configs, __dcfg_branch, __dcfg_always_cc, __dcfg_reply_to_all,
-# __dcfg_accept_notify, __dcfg_unwanted_keywords, __dcfg_kmake_opts
+# __dcfg_accept_notify, __dcfg_unwanted_keywords, __dcfg_kmake_opts,
+# __dcfg_targets, __dcfg_defconfigdir, __dcfg_bisectability, __dcfg_sparse,
+# __dcfg_smatch, __dcfg_cppcheck, __dcfg_coccinelle
#
# It is expected that this is used internally by the parse_prj_config and
# should not normally be called outside of this file.
@@ -191,6 +193,13 @@ __parse_default_config()
__dcfg_accept_notify="$(ini_config_get "$cfgfile" "defaults" "accept_notify")"
__dcfg_unwanted_keywords="$(ini_config_get "$cfgfile" "defaults" "unwanted_keywords")"
__dcfg_kmake_opts="$(ini_config_get "$cfgfile" "defaults" "kmake_opts")"
+ __dcfg_targets="$(ini_config_get "$cfgfile" "defaults" "targets")"
+ __dcfg_defconfigdir="$(ini_config_get "$cfgfile" "defaults" "defconfigdir")"
+ __dcfg_bisectability="$(ini_config_get "$cfgfile" "defaults" "bisectability")"
+ __dcfg_sparse="$(ini_config_get "$cfgfile" "defaults" "sparse")"
+ __dcfg_smatch="$(ini_config_get "$cfgfile" "defaults" "smatch")"
+ __dcfg_cppcheck="$(ini_config_get "$cfgfile" "defaults" "cppcheck")"
+ __dcfg_coccinelle="$(ini_config_get "$cfgfile" "defaults" "coccinelle")"
}
# Similar to "parse_config", but parses a project configuration section. If the
@@ -201,8 +210,10 @@ __parse_default_config()
# The following variables are defined, but receive default values from the
# [defaults] section, if they are not specified in the project section:
#
-# pcfg_configs, pcfg_branch, pcfg_reply_to_all, pcfg_accept_notify,
-# pcfg_always_cc, pcfg_unwanted_keywords, and pcfg_kmake_opts.
+# pcfg_configs, pcfg_branch, pcfg_always_cc, pcfg_reply_to_all,
+# pcfg_accept_notify, pcfg_unwanted_keywords, pcfg_kmake_opts, pcfg_targets,
+# pcfg_defconfigdir, pcfg_bisectability, pcfg_sparse, pcfg_smatch,
+# pcfg_cppcheck, pcfg_coccinelle
#
# If the project is not found, this function only defined an empty "pcfg_name"
# variable.
@@ -245,6 +256,20 @@ parse_prj_config()
ini_config_is_set "$cfgfile" "prj_$prj" "unwanted_keywords" || pcfg_unwanted_keywords="$__dcfg_unwanted_keywords"
pcfg_kmake_opts="$(ini_config_get "$cfgfile" "prj_$prj" "kmake_opts")"
ini_config_is_set "$cfgfile" "prj_$prj" "kmake_opts" || pcfg_kmake_opts="$__dcfg_kmake_opts"
+ pcfg_targets="$(ini_config_get "$cfgfile" "prj_$prj" "targets")"
+ ini_config_is_set "$cfgfile" "prj_$prj" "targets" || pcfg_targets="$__dcfg_targets"
+ pcfg_defconfigdir="$(ini_config_get "$cfgfile" "prj_$prj" "defconfigdir")"
+ ini_config_is_set "$cfgfile" "prj_$prj" "defconfigdir" || pcfg_defconfigdir="$__dcfg_defconfigdir"
+ pcfg_bisectability="$(ini_config_get "$cfgfile" "prj_$prj" "bisectability")"
+ ini_config_is_set "$cfgfile" "prj_$prj" "bisectability" || pcfg_bisectability="$__dcfg_bisectability"
+ pcfg_sparse="$(ini_config_get "$cfgfile" "prj_$prj" "sparse")"
+ ini_config_is_set "$cfgfile" "prj_$prj" "sparse" || pcfg_sparse="$__dcfg_sparse"
+ pcfg_smatch="$(ini_config_get "$cfgfile" "prj_$prj" "smatch")"
+ ini_config_is_set "$cfgfile" "prj_$prj" "smatch" || pcfg_smatch="$__dcfg_smatch"
+ pcfg_cppcheck="$(ini_config_get "$cfgfile" "prj_$prj" "cppcheck")"
+ ini_config_is_set "$cfgfile" "prj_$prj" "cppcheck" || pcfg_cppcheck="$__dcfg_cppcheck"
+ pcfg_coccinelle="$(ini_config_get "$cfgfile" "prj_$prj" "coccinelle")"
+ ini_config_is_set "$cfgfile" "prj_$prj" "coccinelle" || pcfg_coccinelle="$__dcfg_coccinelle"
}
# Compose (but not send) e-mail reply. This function assumes that the following
diff --git a/email/aiaiai-email-test-patchset b/email/aiaiai-email-test-patchset
index cb177db..a55b481 100755
--- a/email/aiaiai-email-test-patchset
+++ b/email/aiaiai-email-test-patchset
@@ -35,20 +35,9 @@ The mbox file containing the patches to test is expected to come from stdin
Options:
-i, --input=MBOX use the MBOX file instead of stdin;
- -C, --confdir=CDIR path to the directory containing the defconfig files
- (those you specify in the config file); by default the
- defconfig files are assumed to be part of the
- <kernel-tree>; this option makes it possible to use
- stand-alone defconfig files instead;
-p, --preserve preserve all the temporary files - do not clean up;
--test-mode test mode - work as usually, but do not actually
send replies;
- --bisectability test bisectability;
- --targets list of make targets to build (defaults to all);
- --sparse check with sparse while building;
- --smatch check with smatch while building;
- --cppcheck check with cppcheck;
- --coccinelle check with coccinelle;
-v, --verbose be verbose;
-h, --help show this text and exit.
EOF
@@ -187,19 +176,12 @@ $(cat -- $tmpdir/test-patchset.log)
EOF
}
-TEMP=`getopt -n $PROG -o i:,C:,p,v,h --long test-mode,input:,confdir:,preserve,bisectability,targets,sparse,smatch,cppcheck,coccinelle,verbose,help -- "$@"` ||
+TEMP=`getopt -n $PROG -o i:,C:,p,v,h --long test-mode,input:,preserve,verbose,help -- "$@"` ||
fail_usage ""
eval set -- "$TEMP"
mbox=
-confdir=
test_mode=
-bisectability=
-targets="all"
-sparse=
-smatch=
-cppcheck=
-coccinelle=
while true; do
case "$1" in
@@ -207,35 +189,12 @@ while true; do
mbox="$(opt_check_read "$1" "$2")"
shift
;;
- -C|--confdir)
- confdir="$(opt_check_dir "$1" "$2")"
- shift
- ;;
-p|--preserve)
preserve="--preserve"
;;
--test-mode)
test_mode=y
;;
- --bisectability)
- bisectability="--bisectability"
- ;;
- --targets)
- targets="$2"
- shift
- ;;
- --sparse)
- sparse="--sparse"
- ;;
- --smatch)
- smatch="--smatch"
- ;;
- --cppcheck)
- cppcheck="--cppcheck"
- ;;
- --coccinelle)
- coccinelle="--coccinelle"
- ;;
-v|--verbose) verbose=-v
;;
-h|--help)
@@ -325,6 +284,17 @@ if [ -z "$pcfg_name" ]; then
error_project_not_found
fi
+bisectability=
+sparse=
+smatch=
+cppcheck=
+coccinelle=
+[ "$pcfg_bisectability" != "1" ] || bisectablity="--bisectability"
+[ "$pcfg_sparse" != "1" ] || sparse="--sparse"
+[ "$pcfg_smatch" != "1" ] || smatch="--smatch"
+[ "$pcfg_cppcheck" != "1" ] || cppcheck="--cppcheck"
+[ "$pcfg_coccinelle" != "1" ] || coccinelle="--coccinelle"
+
# Create the Cc list for replies that we'll be sending
if [ "$pcfg_reply_to_all" = "1" ]; then
# All the patch recipients will be CCed
@@ -343,9 +313,9 @@ fi
# Test the path (or patch-set)
verbose "Test configs \"$pcfg_configs\" branch \"$pcfg_branch\" of \"$pcfg_path\""
aiaiai-test-patchset $verbose $preserve \
- $bisectability ${targets:--targets "$targets"} $sparse $smatch $cppcheck $coccinelle \
+ ${pcfg_targets:--targets "$pcfg_targets"} $bisectability $sparse $smatch $cppcheck $coccinelle \
-i "$mbox" -j "$cfg_jobs" -c "$pcfg_branch" -w "$tmpdir" \
- ${confdir:+-C "$confdir"} \
+ ${pcfg_defconfigdir:+-C "$pcfg_defconfigdir"} \
${pcfg_unwanted_keywords:+-K "$pcfg_unwanted_keywords"} -- \
${pcfg_kmake_opts:+-M "$pcfg_kmake_opts"} \
"$pcfg_path" "$pcfg_configs" > "$tmpdir/test-patchset.log" ||