summaryrefslogtreecommitdiffstats
path: root/test_build.sh
diff options
context:
space:
mode:
authorFelix Singer <felixsinger@posteo.net>2022-08-06 06:06:07 +0200
committerFelix Singer <felixsinger@posteo.net>2022-09-23 20:40:58 +0000
commit46f94ba671afd9b1d21ac00b983d02c1cf4feada (patch)
tree6cdb356f57ab1988da133cbef7bcc53b39f7dcc1 /test_build.sh
parent2307053d1d397acab286389afdf42c0a5ecb2054 (diff)
downloadflashrom-46f94ba671afd9b1d21ac00b983d02c1cf4feada.tar.gz
flashrom-46f94ba671afd9b1d21ac00b983d02c1cf4feada.tar.bz2
flashrom-46f94ba671afd9b1d21ac00b983d02c1cf4feada.zip
test_build.sh: Build all programmers individually using Meson
The test build script already builds each programmer individually when Make is used. To check if the Meson build system is working properly, build each programmer individually and in addition to that build-test the programmer groups individually. Builds are done in the directory `out`, while for each build a new subdirectory with the name of the programmer option is created. Also, return when scan-build is used and the group `all` isn't selected, since it's not needed to run scan-build in combination with the other options. Signed-off-by: Felix Singer <felixsinger@posteo.net> Change-Id: I703127a2dc31d316d3d1c842b5bcb0b22c39c0d4 Reviewed-on: https://review.coreboot.org/c/flashrom/+/66475 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Anastasia Klimchuk <aklm@chromium.org> Reviewed-by: Angel Pons <th3fanbus@gmail.com> Reviewed-by: Patrick Georgi <patrick@coreboot.org>
Diffstat (limited to 'test_build.sh')
-rwxr-xr-xtest_build.sh26
1 files changed, 23 insertions, 3 deletions
diff --git a/test_build.sh b/test_build.sh
index 8f48ba109..2ca8de581 100755
--- a/test_build.sh
+++ b/test_build.sh
@@ -12,6 +12,14 @@ make_programmer_opts="INTERNAL INTERNAL_X86 SERPROG RAYER_SPI RAIDEN_DEBUG_SPI P
BUSPIRATE_SPI DEDIPROG DEVELOPERBOX_SPI SATAMV LINUX_MTD LINUX_SPI IT8212 \
CH341A_SPI DIGILENT_SPI JLINK_SPI"
+meson_programmer_opts="all auto group_ftdi group_i2c group_jlink group_pci group_serial group_usb \
+ atahpt atapromise atavia buspirate_spi ch341a_spi dediprog developerbox_spi \
+ digilent_spi drkaiser dummy ft2232_spi gfxnvidia internal it8212 \
+ jlink_spi linux_mtd linux_spi parade_lspcon mediatek_i2c_spi mstarddc_spi \
+ nic3com nicintel nicintel_eeprom nicintel_spi nicnatsemi nicrealtek \
+ ogp_spi pickit2_spi pony_spi raiden_debug_spi rayer_spi realtek_mst_i2c_spi \
+ satamv satasii serprog stlinkv3_spi usbblaster_spi"
+
if [ "$(basename "${CC}")" = "ccc-analyzer" ] || [ -n "${COVERITY_OUTPUT}" ]; then
is_scan_build_env=1
@@ -38,12 +46,24 @@ build_make () {
build_meson () {
build_dir=out
+ meson_opts="-Dtests=enabled"
+ ninja_opts="-j $(nproc)"
rm -rf ${build_dir}
- meson $build_dir -Dtests=enabled
- ninja -C $build_dir
- ninja -C $build_dir test
+ for programmer in ${meson_programmer_opts}; do
+ programmer_dir="${build_dir}/${programmer}"
+
+ # In case of clang analyzer we don't want to run it on
+ # each programmer individually. Thus, just return here.
+ if [ ${is_scan_build_env} -eq 1 ] && [ "${programmer}" != "all" ]; then
+ return
+ fi
+
+ meson ${programmer_dir} ${meson_opts} -Dprogrammer=${programmer}
+ ninja ${ninja_opts} -C ${programmer_dir}
+ ninja ${ninja_opts} -C ${programmer_dir} test
+ done
}