2 ## This file is part of the coreboot project.
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.
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.
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'
25 # junit.xml is a helper target to wrap builds that don't create junit.xml output
26 # BLD = The name of the build
27 # BLD_DIR = Top path from coreboot to the build subdirectory
28 # MAKETARGET = target to build
30 echo "Building $(BLD)"
31 echo '<?xml version="1.0" encoding="utf-8"?><testsuite>' > $@.tmp
32 echo "<testcase classname='$(BLD)' name='$(BLD)'>" >> $@.tmp
33 -if [ -z "$(BLD_DIR)" ]; then \
35 xmlfile=junit_$(BLD).xml; \
37 projdir="-C $(BLD_DIR)"; \
38 xmlfile="$(BLD_DIR)/$@"; \
40 if [ -z "$(SKIP_DISTCLEAN)" ]; then \
41 $(MAKE) -j $(CPUS) $$projdir clean distclean > $@.tmp.2 2>&1 ; \
43 if $(MAKE) -j $(CPUS) $$projdir $(MAKETARGET) >> $@.tmp.2 2>&1; then \
45 echo "<$$type>" >> $@.tmp; \
46 echo "Building $(BLD) Succeeded"; \
49 echo "<failure type='buildFailed'>" >> $@.tmp; \
50 echo "Building $(BLD) Failed"; \
53 echo '<![CDATA[' >> $@.tmp; \
54 cat $@.tmp.2 >> $@.tmp; \
55 echo "]]></$$type>" >>$@.tmp; \
57 echo "</testcase>" >> $@.tmp; \
58 echo "</testsuite>" >> $@.tmp; \
73 TEST_PAYLOADLIST_INTERNAL= \
78 TEST_PAYLOAD?=$(JENKINS_PAYLOAD)
81 lint lint-stable lint-extended:
85 util/lint/lint lint-stable --junit
86 util/lint/lint lint-extended --junit
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)
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
94 $(MAKE) -C src/soc/nvidia/tegra124/lp0 all clean
95 $(MAKE) -C src/soc/nvidia/tegra210/lp0 all clean
97 test-basic: test-lint test-tools test-abuild test-payloads test-cleanup
100 util/lint/lint lint-stable
101 util/lint/lint lint-extended
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)
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)\
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)
124 echo "Testing broadcom/secimage"
125 $(MAKE) -C util/broadcom/secimage test
128 rm -rf coreboot-builds coreboot-builds-chromeos
131 $(foreach tool, $(TOOLLIST), $(MAKE) -C util/$(tool) clean ; )
132 $(MAKE) -C util/romcc clean
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