diff options
-rw-r--r-- | meson.build | 10 | ||||
-rw-r--r-- | tests/meson.build | 13 |
2 files changed, 14 insertions, 9 deletions
diff --git a/meson.build b/meson.build index 3a6cc411..d4a8ad17 100644 --- a/meson.build +++ b/meson.build @@ -188,6 +188,7 @@ programmer = { '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 @@ programmer = { }, 'dummy' : { 'srcs' : files('dummyflasher.c'), + 'test_srcs' : files('tests/dummyflasher.c'), 'flags' : [ '-DCONFIG_DUMMY=1' ], }, 'ft2232_spi' : { @@ -285,6 +287,7 @@ programmer = { '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 @@ programmer = { '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 @@ programmer = { '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 @@ programmer = { '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 @@ programmer = { '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 @@ programmer = { '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 @@ programmer = { '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 @@ foreach p_name, p_data : programmer '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 66adb92b..893cca88 100644 --- a/tests/meson.build +++ b/tests/meson.build @@ -19,15 +19,6 @@ test_srcs = files( '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 @@ if not programmer.get('dummy').get('active') 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', |