[coreboot-gerrit] New patch to review for coreboot: build-system: create lint-jenkins set for jenkins to run
Martin Roth (martinroth@google.com)
gerrit at coreboot.org
Sun Jan 31 23:35:29 CET 2016
Martin Roth (martinroth at google.com) just uploaded a new patch set to gerrit, which you can find at https://review.coreboot.org/13543
-gerrit
commit 662c24956f1a60a47fe0f752c6d450896c6c70de
Author: Martin Roth <martinroth at google.com>
Date: Sun Jan 31 15:17:34 2016 -0700
build-system: create lint-jenkins set for jenkins to run
- Create a lint-jenkins target for lint scripts that are for jenkins,
but not a part of lint-stable
- Append lint-jenkins to the junit.xml file instead of overwriting it.
- Add lint-kconfig to lint-jenkins. I'm hesitant to add this to
lint-stable because lint-stable gets run by the git-hook. Because
the kconfig_lint tool is written in perl, and we don't currently have
any other perl scripts being run by the make, I don't want cause
artificial failures for people when they try to commit patches.
Change-Id: I679d98d75021d705d355a2708636983ca84d89b7
Signed-off-by: Martin Roth <martinroth at google.com>
---
Makefile.inc | 3 ++-
util/lint/lint | 14 +++++++++++---
util/lint/lint-jenkins-008-kconfig | 36 ++++++++++++++++++++++++++++++++++++
3 files changed, 49 insertions(+), 4 deletions(-)
diff --git a/Makefile.inc b/Makefile.inc
index 122b83a..a629ef3 100644
--- a/Makefile.inc
+++ b/Makefile.inc
@@ -447,7 +447,7 @@ printcrt0s:
update:
dongle.py -c /dev/term/1 $(obj)/coreboot.rom EOF
-lint lint-stable:
+lint lint-stable lint-jenkins:
util/lint/lint $@
gitconfig:
@@ -931,6 +931,7 @@ JENKINS_PAYLOAD?=none
CPUS?=4
what-jenkins-does:
util/lint/lint lint-stable --junit
+ util/lint/lint lint-jenkins --junit
util/abuild/abuild -B -J $(if $(JENKINS_NOCCACHE),,-y) -c $(CPUS) -z -p $(JENKINS_PAYLOAD) -x -X $(top)/abuild-chromeos.xml
util/abuild/abuild -B -J $(if $(JENKINS_NOCCACHE),,-y) -c $(CPUS) -z -p $(JENKINS_PAYLOAD)
(cd payloads/libpayload; unset COREBOOT_BUILD_DIR; $(MAKE) $(if $(JENKINS_NOCCACHE),,CONFIG_LP_CCACHE=y) V=$(V) Q=$(Q) junit.xml)
diff --git a/util/lint/lint b/util/lint/lint
index 826685d..03d5e2c 100755
--- a/util/lint/lint
+++ b/util/lint/lint
@@ -14,7 +14,7 @@
#set -x # uncomment for debug
usage () {
- printf "Usage: %s <lint|lint-stable> [--junit]\n" "$0"
+ printf "Usage: %s <lint|lint-stable|lint-jenkins> [--junit]\n" "$0"
}
#write to the junit xml file if --junit was specified
@@ -25,7 +25,8 @@ junit_write () {
}
#verify the first command line parameter
-if [ -z "$1" ] || [ "$1" != "lint" ] && [ "$1" != "lint-stable" ]; then
+if [ -z "$1" ] || [ "$1" != "lint" ] && [ "$1" != "lint-stable" ] &&
+ [ "$1" != "lint-jenkins" ]; then
usage
exit 1
fi
@@ -33,12 +34,19 @@ fi
LINTLOG=$(mktemp .tmpconfig.lintXXXXX);
XMLFILE="$(dirname "$0")/junit.xml"
FAILED=0;
+JUNIT_APPEND=0
+
+if [ "$1" = "lint-jenkins" ]; then
+ JUNIT_APPEND=1
+fi
#check optional second command line parameter.
#TODO: Add real command line handling if anything more is added
if [ "$2" = "--junit" ]; then
JUNIT=1
- echo '<?xml version="1.0" encoding="utf-8"?>' > "$XMLFILE"
+ if [ "$JUNIT_APPEND" -eq 0 ]; then
+ echo '<?xml version="1.0" encoding="utf-8"?>' > "$XMLFILE"
+ fi
junit_write '<testsuite>'
else
JUNIT=0
diff --git a/util/lint/lint-jenkins-008-kconfig b/util/lint/lint-jenkins-008-kconfig
new file mode 100755
index 0000000..53d3ab0
--- /dev/null
+++ b/util/lint/lint-jenkins-008-kconfig
@@ -0,0 +1,36 @@
+#!/bin/sh
+# This file is part of the coreboot project.
+#
+# Copyright 2016 Google Inc.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# DESCR: check Kconfig files
+
+LC_ALL=C export LC_ALL
+
+# Give users a way to disable the test locally if they don't have perl installed
+if [ -e "util/lint/.no_kconfig_lint_check" ]; then
+ exit 0
+fi
+
+# Verify that the test can run, tell users the issue
+if [ -z "$(command -v perl)" ]; then
+ echo "The kconfig lint tool uses perl. Please install it or create the"
+ echo "file util/lint/.no_kconfig_lint_check to disable this test locally"
+fi
+
+# If coreboot is in a git repo, use git grep to check as it will ignore any
+# files in the tree that aren't checked into git
+if [ -z "$(command -v git)" ] && [ -e ".git" ]; then
+ env perl util/lint/kconfig_lint --no_git_grep --warnings_off
+else
+ env perl util/lint/kconfig_lint --warnings_off
+fi
More information about the coreboot-gerrit
mailing list