Felix Singer submitted this change.

View Change



16 is the latest approved patch-set.
No files were changed between the latest approved patch-set and the submitted one.

Approvals: build bot (Jenkins): Verified Angel Pons: Looks good to me, but someone else must approve Anastasia Klimchuk: Looks good to me, approved
meson: Move programmer test sources into programmer definition

Move the definition of the programmer test source files into the
dictionary defining the programmers itself. This way there is a better
overview about which of the available programmers have tests and which
don't.

Also, to keep the tests working, iterate over all programmers and add
their test source files to the list of sources that should be built.

Signed-off-by: Felix Singer <felixsinger@posteo.net>
Change-Id: I307faaf8a9f7ae3c54bd96e7d871a3abb8aadea3
Reviewed-on: https://review.coreboot.org/c/flashrom/+/68162
Reviewed-by: Angel Pons <th3fanbus@gmail.com>
Reviewed-by: Anastasia Klimchuk <aklm@chromium.org>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
---
M meson.build
M tests/meson.build
2 files changed, 36 insertions(+), 9 deletions(-)

diff --git a/meson.build b/meson.build
index 3a6cc41..d4a8ad1 100644
--- a/meson.build
+++ b/meson.build
@@ -188,6 +188,7 @@
'deps' : [ libusb1 ],
'groups' : [ group_usb, group_external ],
'srcs' : files('dediprog.c', 'usbdev.c'),
+ 'test_srcs' : files('tests/dediprog.c'),
'flags' : [ '-DCONFIG_DEDIPROG=1' ],
},
'developerbox_spi' : {
@@ -217,6 +218,7 @@
},
'dummy' : {
'srcs' : files('dummyflasher.c'),
+ 'test_srcs' : files('tests/dummyflasher.c'),
'flags' : [ '-DCONFIG_DUMMY=1' ],
},
'ft2232_spi' : {
@@ -285,6 +287,7 @@
'deps' : [ linux_headers ],
'groups' : [ group_internal ],
'srcs' : files('linux_mtd.c'),
+ 'test_srcs' : files('tests/linux_mtd.c'),
'flags' : [ '-DCONFIG_LINUX_MTD=1' ],
},
'linux_spi' : {
@@ -292,6 +295,7 @@
'deps' : [ linux_headers ],
# internal / external?
'srcs' : files('linux_spi.c'),
+ 'test_srcs' : files('tests/linux_spi.c'),
'flags' : [ '-DCONFIG_LINUX_SPI=1' ],
},
'parade_lspcon' : {
@@ -299,6 +303,7 @@
'deps' : [ linux_headers ],
'groups' : [ group_i2c ],
'srcs' : files('parade_lspcon.c', 'i2c_helper_linux.c'),
+ 'test_srcs' : files('tests/parade_lspcon.c'),
'flags' : [ '-DCONFIG_PARADE_LSPCON=1' ],
'default' : false
},
@@ -307,6 +312,7 @@
'deps' : [ linux_headers ],
'groups' : [ group_i2c ],
'srcs' : files('mediatek_i2c_spi.c', 'i2c_helper_linux.c'),
+ 'test_srcs' : files('tests/mediatek_i2c_spi.c'),
'flags' : [ '-DCONFIG_MEDIATEK_I2C_SPI=1' ],
'default' : false,
},
@@ -362,6 +368,7 @@
'deps' : [ libpci ],
'groups' : [ group_pci, group_internal ],
'srcs' : files('nicrealtek.c', 'pcidev.c'),
+ 'test_srcs' : files('tests/nicrealtek.c'),
'flags' : [ '-DCONFIG_NICREALTEK=1' ],
},
'ogp_spi' : {
@@ -387,6 +394,7 @@
'deps' : [ libusb1 ],
'groups' : [ group_usb, group_external ],
'srcs' : files('raiden_debug_spi.c', 'usb_device.c'),
+ 'test_srcs' : files('tests/raiden_debug_spi.c'),
'flags' : [ '-DCONFIG_RAIDEN_DEBUG_SPI=1' ],
},
'rayer_spi' : {
@@ -401,6 +409,7 @@
'deps' : [ linux_headers ],
'groups' : [ group_i2c ],
'srcs' : files('realtek_mst_i2c_spi.c', 'i2c_helper_linux.c'),
+ 'test_srcs' : files('tests/realtek_mst_i2c_spi.c'),
'flags' : [ '-DCONFIG_REALTEK_MST_I2C_SPI=1' ],
'default' : false,
},
@@ -447,6 +456,7 @@
'deps' : p_data.get('deps', []),
'groups' : p_data.get('groups', []),
'srcs' : p_data.get('srcs', []),
+ 'test_srcs': p_data.get('test_srcs', []),
'flags' : p_data.get('flags', []),
'default' : p_data.get('default', true),
}
diff --git a/tests/meson.build b/tests/meson.build
index 66adb92..893cca8 100644
--- a/tests/meson.build
+++ b/tests/meson.build
@@ -19,15 +19,6 @@
'flashrom.c',
'spi25.c',
'lifecycle.c',
- 'dummyflasher.c',
- 'nicrealtek.c',
- 'raiden_debug_spi.c',
- 'dediprog.c',
- 'linux_mtd.c',
- 'linux_spi.c',
- 'parade_lspcon.c',
- 'mediatek_i2c_spi.c',
- 'realtek_mst_i2c_spi.c',
'layout.c',
'chip.c',
'chip_wp.c',
@@ -37,6 +28,10 @@
test_srcs += programmer.get('dummy').get('srcs')
endif

+foreach p_name, p_data : programmer
+ test_srcs += p_data.get('test_srcs')
+endforeach
+
mocks = [
'-Wl,--wrap=strdup',
'-Wl,--wrap=physunmap',

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

Gerrit-Project: flashrom
Gerrit-Branch: master
Gerrit-Change-Id: I307faaf8a9f7ae3c54bd96e7d871a3abb8aadea3
Gerrit-Change-Number: 68162
Gerrit-PatchSet: 18
Gerrit-Owner: Felix Singer <felixsinger@posteo.net>
Gerrit-Reviewer: Anastasia Klimchuk <aklm@chromium.org>
Gerrit-Reviewer: Angel Pons <th3fanbus@gmail.com>
Gerrit-Reviewer: Felix Singer <felixsinger@posteo.net>
Gerrit-Reviewer: Thomas Heijligen <src@posteo.de>
Gerrit-Reviewer: build bot (Jenkins) <no-reply@coreboot.org>
Gerrit-MessageType: merged