diff options
| author | Alex Richardson <arichardson@FreeBSD.org> | 2020-10-18 18:35:23 +0000 |
|---|---|---|
| committer | Alex Richardson <arichardson@FreeBSD.org> | 2020-10-18 18:35:23 +0000 |
| commit | 3ac62888fc211e92785751c9bb6e73868101f65c (patch) | |
| tree | 3765298765360cd5847a1925b888abda4bc00564 /usr.bin | |
| parent | d061adc48d54ebb91b1709b16c59e8ceca895be2 (diff) | |
Notes
Diffstat (limited to 'usr.bin')
| -rw-r--r-- | usr.bin/mkimg/tests/Makefile | 20 | ||||
| -rwxr-xr-x | usr.bin/mkimg/tests/mkimg_test.sh | 2 |
2 files changed, 19 insertions, 3 deletions
diff --git a/usr.bin/mkimg/tests/Makefile b/usr.bin/mkimg/tests/Makefile index a11a912242cd2..f74ff03485a36 100644 --- a/usr.bin/mkimg/tests/Makefile +++ b/usr.bin/mkimg/tests/Makefile @@ -15,9 +15,25 @@ $f: $f.hex sed -e '/^#.*/D' < ${.ALLSRC} > ${.TARGET} .endfor +# Note: Pre-generating this test file saves a lot of time when building on +# emulated platforms such as QEMU. It can take about 2-5 seconds to generate +# the test file using jot (depending on the emulated architecture) and this +# is done for each of the 168 test configurations. +# The effect is even more pronounced on CHERI-RISCV QEMU (emulating CHERI inside +# QEMU adds additional run-time overhead): Running the apm_1x1_512_raw without +# the pre-generated file takes about 108 seconds of which 102 seconds (over 95%) +# were spent running jot -b. It's even worse on CHERI-MIPS QEMU: 187 seconds +# for jot -b P 2097152 > /dev/null. By using a pre-generated 4MB file, the +# slowest test variant (vtoc8_63x255_4096_vhdx) now only takes 29 seconds (of +# which 26s are spent in hexdump -C) instead of previously 2min30s. +${PACKAGE}FILES+= partition_data_4M.bin +partition_data_4M.bin: Makefile + jot -b P 2097152 > ${.TARGET} || rm -f ${.TARGET} + CLEANFILES+= ${${PACKAGE}FILES}} -rebase: .PHONY - (cd ${.CURDIR}; /usr/libexec/atf-sh ${_REBASE_SCRIPT}.sh rebase) +rebase: partition_data_4M.bin ${_REBASE_SCRIPT} .PHONY + cd ${.CURDIR}; PATH=${.OBJDIR}/..:$${PATH}:/usr/bin:/bin \ + /usr/libexec/atf-sh ${.OBJDIR}/${_REBASE_SCRIPT} -s ${.OBJDIR} rebase .include <bsd.test.mk> diff --git a/usr.bin/mkimg/tests/mkimg_test.sh b/usr.bin/mkimg/tests/mkimg_test.sh index 329f2684ac6f0..5d2e93ea144d1 100755 --- a/usr.bin/mkimg/tests/mkimg_test.sh +++ b/usr.bin/mkimg/tests/mkimg_test.sh @@ -56,7 +56,7 @@ makeimage() if test -z "$partarg"; then local swap ufs swap="-p freebsd-swap::128K" - ufs="-p freebsd-ufs:=`mkcontents P 4194304`" + ufs="-p freebsd-ufs:=$(atf_get_srcdir)/partition_data_4M.bin" partarg="$ufs $swap" fi |
