Martin Roth | e624e27 | 2017-07-31 11:52:58 -0600 | [diff] [blame] | 1 | ## |
| 2 | ## This file is part of the coreboot project. |
| 3 | ## |
| 4 | ## This program is free software; you can redistribute it and/or modify |
| 5 | ## it under the terms of the GNU General Public License as published by |
| 6 | ## the Free Software Foundation; version 2 of the License. |
| 7 | ## |
| 8 | ## This program is distributed in the hope that it will be useful, |
| 9 | ## but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 10 | ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 11 | ## GNU General Public License for more details. |
| 12 | ## |
| 13 | |
Martin Roth | 6c9c196 | 2017-08-03 09:25:43 -0600 | [diff] [blame] | 14 | test-help help:: |
| 15 | @echo '*** coreboot test targets ***' |
| 16 | @echo ' what-jenkins-does - Run platform build tests with junit output' |
| 17 | @echo ' lint / lint-stable - run coreboot lint tools (all / minimal)' |
| 18 | @echo ' test-basic - Run stardard build tests. All expected to pass.' |
| 19 | @echo ' test-lint - basic: Run stable and extended lint tests.' |
| 20 | @echo ' test-tools - basic: Tests a basic list of tools.' |
| 21 | @echo ' test-abuild - basic: Builds all platforms' |
| 22 | @echo ' test-payloads - basic: Builds internal payloads' |
| 23 | @echo ' test-cleanup - basic: Cleans coreboot directories' |
| 24 | |
| 25 | # junit.xml is a helper target to wrap builds that don't create junit.xml output |
Martin Roth | c32c054 | 2018-05-19 17:51:20 -0600 | [diff] [blame] | 26 | # BLD = The name of the build |
Martin Roth | 6c9c196 | 2017-08-03 09:25:43 -0600 | [diff] [blame] | 27 | # BLD_DIR = Top path from coreboot to the build subdirectory |
| 28 | # MAKETARGET = target to build |
Martin Roth | e624e27 | 2017-07-31 11:52:58 -0600 | [diff] [blame] | 29 | junit.xml: |
| 30 | echo "Building $(BLD)" |
| 31 | echo '<?xml version="1.0" encoding="utf-8"?><testsuite>' > $@.tmp |
| 32 | echo "<testcase classname='$(BLD)' name='$(BLD)'>" >> $@.tmp |
Martin Roth | c32c054 | 2018-05-19 17:51:20 -0600 | [diff] [blame] | 33 | -if [ -z "$(BLD_DIR)" ]; then \ |
| 34 | projdir=""; \ |
| 35 | xmlfile=junit_$(BLD).xml; \ |
| 36 | else \ |
| 37 | projdir="-C $(BLD_DIR)"; \ |
| 38 | xmlfile="$(BLD_DIR)/$@"; \ |
| 39 | fi; \ |
| 40 | if [ -z "$(SKIP_DISTCLEAN)" ]; then \ |
| 41 | $(MAKE) -j $(CPUS) $$projdir clean distclean > $@.tmp.2 2>&1 ; \ |
| 42 | fi; \ |
| 43 | if $(MAKE) -j $(CPUS) $$projdir $(MAKETARGET) >> $@.tmp.2 2>&1; then \ |
| 44 | type="system-out"; \ |
| 45 | echo "<$$type>" >> $@.tmp; \ |
| 46 | echo "Building $(BLD) Succeeded"; \ |
| 47 | else \ |
| 48 | type="failure"; \ |
| 49 | echo "<failure type='buildFailed'>" >> $@.tmp; \ |
| 50 | echo "Building $(BLD) Failed"; \ |
| 51 | fi; \ |
| 52 | cat $@.tmp.2; \ |
| 53 | echo '<![CDATA[' >> $@.tmp; \ |
| 54 | cat $@.tmp.2 >> $@.tmp; \ |
| 55 | echo "]]></$$type>" >>$@.tmp; \ |
| 56 | rm -f $@.tmp.2; \ |
| 57 | echo "</testcase>" >> $@.tmp; \ |
| 58 | echo "</testsuite>" >> $@.tmp; \ |
| 59 | mv $@.tmp "$$xmlfile" |
Martin Roth | e624e27 | 2017-07-31 11:52:58 -0600 | [diff] [blame] | 60 | echo |
| 61 | |
| 62 | TOOLLIST= \ |
Alex Thiessen | 457d1c8 | 2018-01-03 19:09:50 +0000 | [diff] [blame] | 63 | broadcom/secimage \ |
Martin Roth | 6c9c196 | 2017-08-03 09:25:43 -0600 | [diff] [blame] | 64 | cbmem \ |
| 65 | ectool \ |
| 66 | futility \ |
| 67 | inteltool \ |
| 68 | intelvbttool \ |
| 69 | nvramtool \ |
| 70 | superiotool \ |
| 71 | viatool |
| 72 | |
| 73 | TEST_PAYLOADLIST_INTERNAL= \ |
| 74 | coreinfo \ |
| 75 | nvramcui |
| 76 | |
Martin Roth | e624e27 | 2017-07-31 11:52:58 -0600 | [diff] [blame] | 77 | JENKINS_PAYLOAD?=none |
Martin Roth | 6c9c196 | 2017-08-03 09:25:43 -0600 | [diff] [blame] | 78 | TEST_PAYLOAD?=$(JENKINS_PAYLOAD) |
Martin Roth | e624e27 | 2017-07-31 11:52:58 -0600 | [diff] [blame] | 79 | CPUS?=4 |
Martin Roth | 6c9c196 | 2017-08-03 09:25:43 -0600 | [diff] [blame] | 80 | |
Martin Roth | ea38367 | 2016-08-30 09:39:48 -0600 | [diff] [blame] | 81 | lint lint-stable lint-extended: |
Martin Roth | 6c9c196 | 2017-08-03 09:25:43 -0600 | [diff] [blame] | 82 | util/lint/lint $@ |
| 83 | |
Martin Roth | e624e27 | 2017-07-31 11:52:58 -0600 | [diff] [blame] | 84 | what-jenkins-does: |
| 85 | util/lint/lint lint-stable --junit |
Martin Roth | ea38367 | 2016-08-30 09:39:48 -0600 | [diff] [blame] | 86 | util/lint/lint lint-extended --junit |
Martin Roth | e624e27 | 2017-07-31 11:52:58 -0600 | [diff] [blame] | 87 | util/abuild/abuild -B -J $(if $(JENKINS_NOCCACHE),,-y) -c $(CPUS) -z -p $(JENKINS_PAYLOAD) -x -X $(top)/abuild-chromeos.xml |
| 88 | util/abuild/abuild -B -J $(if $(JENKINS_NOCCACHE),,-y) -c $(CPUS) -z -p $(JENKINS_PAYLOAD) |
| 89 | (cd payloads/libpayload; unset COREBOOT_BUILD_DIR; $(MAKE) $(if $(JENKINS_NOCCACHE),,CONFIG_LP_CCACHE=y) V=$(V) Q=$(Q) junit.xml) |
Martin Roth | c32c054 | 2018-05-19 17:51:20 -0600 | [diff] [blame] | 90 | $(foreach tool, $(TOOLLIST), $(MAKE) CPUS=$(CPUS) V=$(V) Q=$(Q) BLD_DIR="util/$(tool)" BLD="$(tool)" MFLAGS= MAKEFLAGS= MAKETARGET= junit.xml; ) |
| 91 | unset COREBOOT_BUILD_DIR;$(MAKE) CPUS=$(CPUS) V=$(V) Q=$(Q) BLD_DIR=payloads/nvramcui BLD=nvramcui MFLAGS= MAKEFLAGS= MAKETARGET=all junit.xml |
| 92 | unset COREBOOT_BUILD_DIR;$(MAKE) CPUS=$(CPUS) V=$(V) Q=$(Q) BLD_DIR=payloads/coreinfo BLD=coreinfo MFLAGS= MAKEFLAGS= MAKETARGET=defaultbuild junit.xml |
| 93 | $(MAKE) CPUS=$(CPUS) V=$(V) Q=$(Q) BLD_DIR=util/romcc BLD=romcc MFLAGS= MAKEFLAGS= MAKETARGET=test junit.xml |
Patrick Georgi | e41b0d0 | 2017-09-06 13:22:59 +0200 | [diff] [blame] | 94 | $(MAKE) -C src/soc/nvidia/tegra124/lp0 all clean |
| 95 | $(MAKE) -C src/soc/nvidia/tegra210/lp0 all clean |
Martin Roth | 6c9c196 | 2017-08-03 09:25:43 -0600 | [diff] [blame] | 96 | |
| 97 | test-basic: test-lint test-tools test-abuild test-payloads test-cleanup |
| 98 | |
| 99 | test-lint: |
| 100 | util/lint/lint lint-stable |
Martin Roth | ea38367 | 2016-08-30 09:39:48 -0600 | [diff] [blame] | 101 | util/lint/lint lint-extended |
Martin Roth | 6c9c196 | 2017-08-03 09:25:43 -0600 | [diff] [blame] | 102 | |
| 103 | test-abuild: |
| 104 | rm -rf coreboot-builds-chromeos coreboot-builds |
| 105 | export COREBOOT_BUILD_DIR=coreboot-builds-chromeos; util/abuild/abuild -B -e $(if $(TEST_NOCCACHE),,-y) -c $(CPUS) -p $(TEST_PAYLOAD) -x |
| 106 | util/abuild/abuild -B -e $(if $(TEST_NOCCACHE),,-y) -c $(CPUS) -p $(TEST_PAYLOAD) |
| 107 | |
| 108 | test-payloads: |
| 109 | $(MAKE) -C payloads/libpayload test-configs -j $(CPUS) V=$(V) Q=$(Q) MFLAGS= MAKEFLAGS= $(if $(TEST_NOCCACHE),,CONFIG_LP_CCACHE=y) |
| 110 | export MFLAGS=;export MAKEFLAGS=; \ |
| 111 | $(foreach payload, $(TEST_PAYLOADLIST_INTERNAL), \ |
| 112 | echo "*** Making payload $(payload) ***"; \ |
| 113 | $(MAKE) -C payloads/$(payload) distclean ;\ |
| 114 | $(MAKE) $(payload) -j $(CPUS) V=$(V) Q=$(Q)\ |
| 115 | || exit 1; ) |
| 116 | |
| 117 | test-tools: |
| 118 | @echo "Build testing $(TOOLLIST)" |
| 119 | $(foreach tool, $(TOOLLIST), $(MAKE) -C util/$(tool) clean ; ) |
| 120 | $(MAKE) -C util/romcc clean |
| 121 | $(foreach tool, $(TOOLLIST), echo "Building $(tool)";export MFLAGS= ;export MAKEFLAGS= ;$(MAKE) -C util/$(tool) all V=$(V) Q=$(Q) || exit 1; ) |
| 122 | echo "Building romcc" |
| 123 | $(MAKE) -C util/romcc all test -j $(CPUS) V=$(V) Q=$(Q) |
Alex Thiessen | 457d1c8 | 2018-01-03 19:09:50 +0000 | [diff] [blame] | 124 | echo "Testing broadcom/secimage" |
| 125 | $(MAKE) -C util/broadcom/secimage test |
Martin Roth | 6c9c196 | 2017-08-03 09:25:43 -0600 | [diff] [blame] | 126 | |
| 127 | test-cleanup: |
| 128 | rm -rf coreboot-builds coreboot-builds-chromeos |
| 129 | $(MAKE) clean |
| 130 | $(MAKE) distclean |
| 131 | $(foreach tool, $(TOOLLIST), $(MAKE) -C util/$(tool) clean ; ) |
| 132 | $(MAKE) -C util/romcc clean |
| 133 | |
| 134 | .PHONY: test-basic test-lint test-abuild test-payloads |
| 135 | .PHONY: test-tools test-cleanup test-help |
| 136 | .PHONY: lint lint-stable what-jenkins-does |