[2/6] app/test: link unit test binary against all available libs

Message ID 20220113173918.2700651-3-bruce.richardson@intel.com (mailing list archive)
State Superseded, archived
Delegated to: Thomas Monjalon
Headers
Series allow more DPDK libraries to be disabled on build |

Checks

Context Check Description
ci/checkpatch success coding style OK

Commit Message

Bruce Richardson Jan. 13, 2022, 5:39 p.m. UTC
  Rather than maintaining a list of the libraries the unit tests need, and
having to conditionally include/omit optional libs from the list, we can
just link against all available libraries, simplifying the code
considerably.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
---
 app/test/meson.build | 47 +-------------------------------------------
 1 file changed, 1 insertion(+), 46 deletions(-)
  

Comments

David Marchand Jan. 19, 2022, 4:51 p.m. UTC | #1
On Thu, Jan 13, 2022 at 6:40 PM Bruce Richardson
<bruce.richardson@intel.com> wrote:
>
> Rather than maintaining a list of the libraries the unit tests need, and
> having to conditionally include/omit optional libs from the list, we can
> just link against all available libraries, simplifying the code
> considerably.
>
> Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
> ---
>  app/test/meson.build | 47 +-------------------------------------------
>  1 file changed, 1 insertion(+), 46 deletions(-)
>
> diff --git a/app/test/meson.build b/app/test/meson.build
> index 344a609a4d..9919de4307 100644
> --- a/app/test/meson.build
> +++ b/app/test/meson.build
> @@ -157,39 +157,7 @@ test_sources = files(
>          'virtual_pmd.c',
>  )
>
> -test_deps = [
> -        'acl',
> -        'bus_pci',
> -        'bus_vdev',

bus_pci and bus_vdev are not "libraries", but "drivers" dependencies
and must be kept.
This probably explains an error seen in UNH test report for a job that
disables all but those bus drivers and net/hns3:
http://mails.dpdk.org/archives/test-report/2022-January/251477.html
  
Bruce Richardson Jan. 19, 2022, 5:25 p.m. UTC | #2
On Wed, Jan 19, 2022 at 05:51:20PM +0100, David Marchand wrote:
> On Thu, Jan 13, 2022 at 6:40 PM Bruce Richardson
> <bruce.richardson@intel.com> wrote:
> >
> > Rather than maintaining a list of the libraries the unit tests need, and
> > having to conditionally include/omit optional libs from the list, we can
> > just link against all available libraries, simplifying the code
> > considerably.
> >
> > Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
> > ---
> >  app/test/meson.build | 47 +-------------------------------------------
> >  1 file changed, 1 insertion(+), 46 deletions(-)
> >
> > diff --git a/app/test/meson.build b/app/test/meson.build
> > index 344a609a4d..9919de4307 100644
> > --- a/app/test/meson.build
> > +++ b/app/test/meson.build
> > @@ -157,39 +157,7 @@ test_sources = files(
> >          'virtual_pmd.c',
> >  )
> >
> > -test_deps = [
> > -        'acl',
> > -        'bus_pci',
> > -        'bus_vdev',
> 
> bus_pci and bus_vdev are not "libraries", but "drivers" dependencies
> and must be kept.
> This probably explains an error seen in UNH test report for a job that
> disables all but those bus drivers and net/hns3:
> http://mails.dpdk.org/archives/test-report/2022-January/251477.html
>
Thanks for flagging this, I'll update the set.

/Bruce
  

Patch

diff --git a/app/test/meson.build b/app/test/meson.build
index 344a609a4d..9919de4307 100644
--- a/app/test/meson.build
+++ b/app/test/meson.build
@@ -157,39 +157,7 @@  test_sources = files(
         'virtual_pmd.c',
 )
 
-test_deps = [
-        'acl',
-        'bus_pci',
-        'bus_vdev',
-        'bpf',
-        'cfgfile',
-        'cmdline',
-        'cryptodev',
-        'distributor',
-        'dmadev',
-        'efd',
-        'ethdev',
-        'eventdev',
-        'fib',
-        'flow_classify',
-        'graph',
-        'hash',
-        'ipsec',
-        'lpm',
-        'member',
-        'node',
-        'pipeline',
-        'port',
-        'rawdev',
-        'rcu',
-        'reorder',
-        'rib',
-        'ring',
-        'security',
-        'stack',
-        'telemetry',
-        'timer',
-]
+test_deps = enabled_libs
 
 # Each test is marked with flag true/false
 # to indicate whether it can run in no-huge mode.
@@ -380,7 +348,6 @@  if dpdk_conf.has('RTE_EVENT_SKELETON')
     test_deps += 'event_skeleton'
 endif
 if dpdk_conf.has('RTE_LIB_METRICS')
-    test_deps += 'metrics'
     test_sources += ['test_metrics.c']
     fast_tests += [['metrics_autotest', true]]
 endif
@@ -410,17 +377,14 @@  if dpdk_conf.has('RTE_NET_RING')
     perf_test_names += 'ring_pmd_perf_autotest'
     fast_tests += [['event_eth_tx_adapter_autotest', false]]
     if dpdk_conf.has('RTE_LIB_BITRATESTATS')
-        test_deps += 'bitratestats'
         test_sources += 'test_bitratestats.c'
         fast_tests += [['bitratestats_autotest', true]]
     endif
     if dpdk_conf.has('RTE_LIB_LATENCYSTATS')
-        test_deps += 'latencystats'
         test_sources += 'test_latencystats.c'
         fast_tests += [['latencystats_autotest', true]]
     endif
     if dpdk_conf.has('RTE_LIB_PDUMP')
-        test_deps += 'pdump'
         test_sources += 'test_pdump.c'
         fast_tests += [['pdump_autotest', true]]
     endif
@@ -434,18 +398,10 @@  endif
 if dpdk_conf.has('RTE_HAS_LIBPCAP')
     ext_deps += pcap_dep
     if dpdk_conf.has('RTE_LIB_PCAPNG')
-        test_deps += 'pcapng'
         test_sources += 'test_pcapng.c'
     endif
 endif
 
-if dpdk_conf.has('RTE_LIB_POWER')
-    test_deps += 'power'
-endif
-if dpdk_conf.has('RTE_LIB_KNI')
-    test_deps += 'kni'
-endif
-
 if cc.has_argument('-Wno-format-truncation')
     cflags += '-Wno-format-truncation'
 endif
@@ -462,7 +418,6 @@  if dpdk_conf.has('RTE_LIB_COMPRESSDEV')
     if compress_test_dep.found()
         test_dep_objs += compress_test_dep
         test_sources += 'test_compressdev.c'
-        test_deps += 'compressdev'
         fast_tests += [['compressdev_autotest', false]]
     endif
 endif