From e624e270e646a9443024428a7aefe69f6b429fbf Mon Sep 17 00:00:00 2001 From: Martin Roth Date: Mon, 31 Jul 2017 11:52:58 -0600 Subject: Make: Move testing into a subdirectory In preparation for expanding the testing, move the test targets out of the top level Makefile.inc and into a separate subdirectory. Change-Id: Ie252c7555223f9ce76b54e6f7b66d03f3cf60500 Signed-off-by: Martin Roth Reviewed-on: https://review.coreboot.org/20873 Tested-by: build bot (Jenkins) Reviewed-by: Chris Ching --- Makefile | 1 + Makefile.inc | 46 +------------------------------------- util/testing/Makefile.inc | 56 +++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 58 insertions(+), 45 deletions(-) create mode 100644 util/testing/Makefile.inc diff --git a/Makefile b/Makefile index 31fb3ad6f1..ff9a6b81cf 100644 --- a/Makefile +++ b/Makefile @@ -124,6 +124,7 @@ endif ifeq ($(NOCOMPILE),1) include $(TOPLEVEL)/Makefile.inc include $(TOPLEVEL)/payloads/Makefile.inc +include $(TOPLEVEL)/util/testing/Makefile.inc real-all: @echo "Error: Expected config file ($(DOTCONFIG)) not present." >&2 @echo "Please specify a config file or run 'make menuconfig' to" >&2 diff --git a/Makefile.inc b/Makefile.inc index 573020123a..9decd65830 100644 --- a/Makefile.inc +++ b/Makefile.inc @@ -93,7 +93,7 @@ subdirs-y += src/vboot subdirs-y += payloads payloads/external subdirs-y += site-local -subdirs-y += util/checklist +subdirs-y += util/checklist util/testing ####################################################################### # Add source classes and their build options @@ -1041,47 +1041,3 @@ check-ramstage-overlaps: $(obj)/coreboot.pre INTERMEDIATE+=check-ramstage-overlaps PHONY+=check-ramstage-overlaps endif - -junit.xml: - echo "Building $(BLD)" - echo '' > $@.tmp - echo "" >> $@.tmp - -$(MAKE) -j $(CPUS) -C "$(BLD_DIR)$(BLD)" clean distclean > $@.tmp.2 2>&1 - $(MAKE) -j $(CPUS) -C "$(BLD_DIR)$(BLD)" $(MAKETARGET) >> $@.tmp.2 2>&1 && type="system-out" || type="failure"; \ - cat $@.tmp.2; \ - if [ "$$type" = "failure" ]; then \ - echo "" >> $@.tmp; \ - echo "Building $(BLD) Failed"; \ - else \ - echo "<$$type>" >> $@.tmp; \ - echo "Building $(BLD) Succeeded"; \ - fi; \ - echo '> $@.tmp; \ - cat $@.tmp.2 >> $@.tmp; \ - echo "]]>" >>$@.tmp - rm -f $@.tmp.2 - echo "" >> $@.tmp - echo "" >> $@.tmp - mv $@.tmp "$(BLD_DIR)$(BLD)/$@" - echo - -TOOLLIST= \ - cbmem \ - ectool \ - futility \ - inteltool \ - intelvbttool \ - nvramtool \ - superiotool \ - viatool -JENKINS_PAYLOAD?=none -CPUS?=4 -what-jenkins-does: - util/lint/lint lint-stable --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) - $(foreach tool, $(TOOLLIST), $(MAKE) CPUS=$(CPUS) V=$(V) Q=$(Q) BLD_DIR=util/ BLD="$(tool)" MFLAGS= MAKEFLAGS= MAKETARGET= junit.xml; ) - unset COREBOOT_BUILD_DIR;$(MAKE) CPUS=$(CPUS) V=$(V) Q=$(Q) BLD_DIR=payloads/ BLD=nvramcui MFLAGS= MAKEFLAGS= MAKETARGET=all junit.xml - unset COREBOOT_BUILD_DIR;$(MAKE) CPUS=$(CPUS) V=$(V) Q=$(Q) BLD_DIR=payloads/ BLD=coreinfo MFLAGS= MAKEFLAGS= MAKETARGET=defaultbuild junit.xml - $(MAKE) CPUS=$(CPUS) V=$(V) Q=$(Q) BLD_DIR=util/ BLD=romcc MFLAGS= MAKEFLAGS= MAKETARGET=test junit.xml diff --git a/util/testing/Makefile.inc b/util/testing/Makefile.inc new file mode 100644 index 0000000000..f5a4c5e6fc --- /dev/null +++ b/util/testing/Makefile.inc @@ -0,0 +1,56 @@ +## +## This file is part of the coreboot project. +## +## 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. +## + +junit.xml: + echo "Building $(BLD)" + echo '' > $@.tmp + echo "" >> $@.tmp + -$(MAKE) -j $(CPUS) -C "$(BLD_DIR)$(BLD)" clean distclean > $@.tmp.2 2>&1 + $(MAKE) -j $(CPUS) -C "$(BLD_DIR)$(BLD)" $(MAKETARGET) >> $@.tmp.2 2>&1 && type="system-out" || type="failure"; \ + cat $@.tmp.2; \ + if [ "$$type" = "failure" ]; then \ + echo "" >> $@.tmp; \ + echo "Building $(BLD) Failed"; \ + else \ + echo "<$$type>" >> $@.tmp; \ + echo "Building $(BLD) Succeeded"; \ + fi; \ + echo '> $@.tmp; \ + cat $@.tmp.2 >> $@.tmp; \ + echo "]]>" >>$@.tmp + rm -f $@.tmp.2 + echo "" >> $@.tmp + echo "" >> $@.tmp + mv $@.tmp "$(BLD_DIR)$(BLD)/$@" + echo + +TOOLLIST= \ + cbmem \ + ectool \ + futility \ + inteltool \ + intelvbttool \ + nvramtool \ + superiotool \ + viatool +JENKINS_PAYLOAD?=none +CPUS?=4 +what-jenkins-does: + util/lint/lint lint-stable --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) + $(foreach tool, $(TOOLLIST), $(MAKE) CPUS=$(CPUS) V=$(V) Q=$(Q) BLD_DIR=util/ BLD="$(tool)" MFLAGS= MAKEFLAGS= MAKETARGET= junit.xml; ) + unset COREBOOT_BUILD_DIR;$(MAKE) CPUS=$(CPUS) V=$(V) Q=$(Q) BLD_DIR=payloads/ BLD=nvramcui MFLAGS= MAKEFLAGS= MAKETARGET=all junit.xml + unset COREBOOT_BUILD_DIR;$(MAKE) CPUS=$(CPUS) V=$(V) Q=$(Q) BLD_DIR=payloads/ BLD=coreinfo MFLAGS= MAKEFLAGS= MAKETARGET=defaultbuild junit.xml + $(MAKE) CPUS=$(CPUS) V=$(V) Q=$(Q) BLD_DIR=util/ BLD=romcc MFLAGS= MAKEFLAGS= MAKETARGET=test junit.xml -- cgit v1.2.3