Felix Singer has uploaded this change for review.

View Change

[WIP] test_build.sh: Rework programmer selection using Meson

Signed-off-by: Felix Singer <felixsinger@posteo.net>
Change-Id: Iaa1f9ea493ea91979b27219d762256c5952f2f29
---
M meson.build
M test_build.sh
2 files changed, 40 insertions(+), 11 deletions(-)

git pull ssh://review.coreboot.org:29418/flashrom refs/changes/48/68248/1
diff --git a/meson.build b/meson.build
index 56ab55c..da4ea14 100644
--- a/meson.build
+++ b/meson.build
@@ -11,6 +11,8 @@
],
)

+devenv = environment()
+
# libtool versioning
lt_current = '1'
lt_revision = '0'
@@ -636,9 +638,11 @@
endif
endif

+programmers_available = []
programmer_names_active = []
programmer_names_not_active = []
foreach p_name, p_data : programmer
+ programmers_available += p_name
if p_data.get('active')
programmer_names_active += p_name
else
@@ -646,6 +650,9 @@
endif
endforeach

+devenv.set('FLASHROM_ALL_PROGRAMMERS', programmers_available)
+meson.add_devenv(devenv)
+
summary({
'active' : [programmer_names_active],
'non active' : [programmer_names_not_active],
diff --git a/test_build.sh b/test_build.sh
index c9726a1..02ac619 100755
--- a/test_build.sh
+++ b/test_build.sh
@@ -5,15 +5,6 @@

is_scan_build_env=0

-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
fi
@@ -49,6 +40,20 @@
}


+generate_meson_programmer_list () {
+ build_dir="tmpbuild"
+ programmer_list_var="FLASHROM_ALL_PROGRAMMERS"
+
+ meson ${build_dir} -Dprogrammer=all > /dev/null
+
+ programmer_list=$(meson devenv -C ${build_dir} env | grep ${programmer_list_var} | sed "s/${programmer_list_var}=//" | sed 's/:/ /g')
+
+ rm -rf ${build_dir}
+
+ echo ${programmer_list}
+}
+
+
build_meson () {
build_dir=out
meson_opts="-Dtests=enabled"
@@ -56,7 +61,14 @@

rm -rf ${build_dir}

- for programmer in ${meson_programmer_opts}; do
+ programmer_list=$(generate_meson_programmer_list)
+ programmer_list_count=$(echo ${programmer_list} | tr ' ' '\n' | wc -l)
+
+ if [ ${programmer_list_count} -eq 0 ]; then
+ exit 1
+ fi
+
+ for programmer in ${programmer_list}; do
programmer_dir="${build_dir}/${programmer}"

# In case of clang analyzer we don't want to run it on
@@ -72,5 +84,5 @@
}


-build_make
+#build_make
build_meson

To view, visit change 68248. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: flashrom
Gerrit-Branch: master
Gerrit-Change-Id: Iaa1f9ea493ea91979b27219d762256c5952f2f29
Gerrit-Change-Number: 68248
Gerrit-PatchSet: 1
Gerrit-Owner: Felix Singer <felixsinger@posteo.net>
Gerrit-MessageType: newchange