[v2,1/2] tests: Fix unit tests for shared builds
Checks
Commit Message
From: Michael Santana <msantana@redhat.com>
Currently many unit tests fail when running tests under shared builds.
This happens because of missing driver dependencies. This is fixed by
explicitly linking in missing drivers for the test application.
before and after (clang):
https://travis-ci.com/Maickii/dpdk-2/jobs/212329160#L623
https://travis-ci.com/Maickii/dpdk-2/jobs/212335912#L620
Suggested-by: Bruce Richardson <bruce.richardson@intel.com>
Suggested-by: David Marchand <david.marchand@redhat.com>
Signed-off-by: Michael Santana <msantana@redhat.com>
Signed-off-by: Aaron Conole <aconole@redhat.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
Reviewed-by: David Marchand <david.marchand at redhat.com>
---
app/test/meson.build | 13 +++++++++++++
1 file changed, 13 insertions(+)
Comments
02/08/2019 23:25, Aaron Conole:
> From: Michael Santana <msantana@redhat.com>
>
> Currently many unit tests fail when running tests under shared builds.
> This happens because of missing driver dependencies. This is fixed by
> explicitly linking in missing drivers for the test application.
>
> before and after (clang):
> https://travis-ci.com/Maickii/dpdk-2/jobs/212329160#L623
> https://travis-ci.com/Maickii/dpdk-2/jobs/212335912#L620
>
> Suggested-by: Bruce Richardson <bruce.richardson@intel.com>
> Suggested-by: David Marchand <david.marchand@redhat.com>
> Signed-off-by: Michael Santana <msantana@redhat.com>
> Signed-off-by: Aaron Conole <aconole@redhat.com>
> Acked-by: Bruce Richardson <bruce.richardson@intel.com>
> Reviewed-by: David Marchand <david.marchand at redhat.com>
> ---
> app/test/meson.build | 13 +++++++++++++
> 1 file changed, 13 insertions(+)
>
> diff --git a/app/test/meson.build b/app/test/meson.build
> index e8a898eb6..8afd21dff 100644
> --- a/app/test/meson.build
> +++ b/app/test/meson.build
> +# The following linkages are an exception to allow running the
> +# unit tests without requiring that the developer install the
> +# DPDK libraries. Explicit linkage in applications should not
> +# be used.
> +if dpdk_conf.has('RTE_LIBRTE_RING_MEMPOOL')
> + test_deps += 'mempool_ring'
> +endif
> +if dpdk_conf.has('RTE_LIBRTE_STACK_MEMPOOL')
> + test_deps += 'mempool_stack'
> +endif
> +if dpdk_conf.has('RTE_LIBRTE_SKELETON_EVENTDEV_PMD')
> + test_deps += 'pmd_skeleton_event'
> +endif
> if dpdk_conf.has('RTE_LIBRTE_PDUMP')
> test_deps += 'pdump'
> endif
I did some changes in comments and line spacing, so it looks like below.
Sorry for doing this change myself, I want to allow you running this CI
as soon as possible.
# The following linkages are an exception to allow running the
# unit tests without requiring that the developer install the
# DPDK libraries. Explicit linkage of drivers (plugin libraries)
# in applications should not be used.
if dpdk_conf.has('RTE_LIBRTE_RING_MEMPOOL')
test_deps += 'mempool_ring'
endif
if dpdk_conf.has('RTE_LIBRTE_STACK_MEMPOOL')
test_deps += 'mempool_stack'
endif
if dpdk_conf.has('RTE_LIBRTE_SKELETON_EVENTDEV_PMD')
test_deps += 'pmd_skeleton_event'
endif
# The following linkages of drivers are required because
# they are used via a driver-specific API.
if dpdk_conf.has('RTE_LIBRTE_BOND_PMD')
test_deps += 'pmd_bond'
endif
if dpdk_conf.has('RTE_LIBRTE_RING_PMD')
test_deps += 'pmd_ring'
endif
if dpdk_conf.has('RTE_LIBRTE_POWER')
test_deps += 'power'
endif
if dpdk_conf.has('RTE_LIBRTE_KNI')
test_deps += 'kni'
endif
if dpdk_conf.has('RTE_LIBRTE_PDUMP')
test_deps += 'pdump'
endif
@@ -297,6 +297,19 @@ dump_test_names = [
'dump_memzone',
]
+# The following linkages are an exception to allow running the
+# unit tests without requiring that the developer install the
+# DPDK libraries. Explicit linkage in applications should not
+# be used.
+if dpdk_conf.has('RTE_LIBRTE_RING_MEMPOOL')
+ test_deps += 'mempool_ring'
+endif
+if dpdk_conf.has('RTE_LIBRTE_STACK_MEMPOOL')
+ test_deps += 'mempool_stack'
+endif
+if dpdk_conf.has('RTE_LIBRTE_SKELETON_EVENTDEV_PMD')
+ test_deps += 'pmd_skeleton_event'
+endif
if dpdk_conf.has('RTE_LIBRTE_PDUMP')
test_deps += 'pdump'
endif