[dpdk-dev] [PATCH v2 01/11] eal: add common test assert macros

Pavan Nikhilesh Bhagavatula pbhagavatula at caviumnetworks.com
Fri Dec 15 12:32:42 CET 2017


On Fri, Dec 15, 2017 at 10:58:10AM +0000, Ananyev, Konstantin wrote:
>
>
> > -----Original Message-----
> > From: Pavan Nikhilesh Bhagavatula [mailto:pbhagavatula at caviumnetworks.com]
> > Sent: Friday, December 15, 2017 9:05 AM
> > To: Ananyev, Konstantin <konstantin.ananyev at intel.com>; jerin.jacob at caviumnetworks.com; santosh.shukla at caviumnetworks.com;
> > Richardson, Bruce <bruce.richardson at intel.com>; Van Haaren, Harry <harry.van.haaren at intel.com>; Eads, Gage <gage.eads at intel.com>;
> > hemant.agrawal at nxp.com; nipun.gupta at nxp.com; Ma, Liang J <liang.j.ma at intel.com>
> > Cc: dev at dpdk.org
> > Subject: Re: [dpdk-dev] [PATCH v2 01/11] eal: add common test assert macros
> >
> > On Thu, Dec 14, 2017 at 06:43:24PM +0000, Ananyev, Konstantin wrote:
> > >
> > >
> > > > -----Original Message-----
> > > > From: dev [mailto:dev-bounces at dpdk.org] On Behalf Of Pavan Nikhilesh
> > > > Sent: Thursday, December 14, 2017 3:01 PM
> > > > To: jerin.jacob at caviumnetworks.com; santosh.shukla at caviumnetworks.com; Richardson, Bruce <bruce.richardson at intel.com>; Van
> > > > Haaren, Harry <harry.van.haaren at intel.com>; Eads, Gage <gage.eads at intel.com>; hemant.agrawal at nxp.com; nipun.gupta at nxp.com;
> > > > Ma, Liang J <liang.j.ma at intel.com>
> > > > Cc: dev at dpdk.org; Pavan Nikhilesh <pbhagavatula at caviumnetworks.com>
> > > > Subject: [dpdk-dev] [PATCH v2 01/11] eal: add common test assert macros
> > > >
> > > > Adding common test assertion macros for unit testing.
> > >
> > > Wonder what's wrong with existing RTE_ASSERT() and RTE_VERIFY()?
> > > Konstantin
> >
> > The existing RTE_ASSERT/VERIFY use rte_panic().
>
> Yes, and wouldn't you expect that behavior from assert() call?

We need to print out the number of successful/failure tests so, we need the
test to proceed even if an assert fails.
In case of `event_octeontx` we have added a new devargs 'selftest' that can be
used to test the driver from any given application.

> Seriously where do you plan to use it outside auto test framework?

We are moving pmd specific tests to respective pmd folder to reduce
clutter in auto test area (event devices for now) [1]. So, we need to access
the asserts from driver location instead of using CFLAGS to directly include
test.h for all the drivers it would be better to have it in eal/common as
rte_test.

[1] http://dpdk.org/ml/archives/dev/2017-December/083740.html

> Konstantin

Regards,
Pavan
>
> >
> > Pavan
> > >
> > > > Taken from test/test.h.
> > > >
> > > > Signed-off-by: Pavan Nikhilesh <pbhagavatula at caviumnetworks.com>
> > > > ---
> > > >  lib/librte_eal/common/Makefile           |  2 +-
> > > >  lib/librte_eal/common/include/rte_test.h | 97 ++++++++++++++++++++++++++++++++
> > > >  2 files changed, 98 insertions(+), 1 deletion(-)
> > > >  create mode 100644 lib/librte_eal/common/include/rte_test.h
> > > >
> > > > diff --git a/lib/librte_eal/common/Makefile b/lib/librte_eal/common/Makefile
> > > > index 9effd0d45..eba1059f2 100644
> > > > --- a/lib/librte_eal/common/Makefile
> > > > +++ b/lib/librte_eal/common/Makefile
> > > > @@ -43,7 +43,7 @@ INC += rte_hexdump.h rte_devargs.h rte_bus.h rte_dev.h
> > > >  INC += rte_pci_dev_feature_defs.h rte_pci_dev_features.h
> > > >  INC += rte_malloc.h rte_keepalive.h rte_time.h
> > > >  INC += rte_service.h rte_service_component.h
> > > > -INC += rte_bitmap.h rte_vfio.h
> > > > +INC += rte_bitmap.h rte_vfio.h rte_test.h
> > > >
> > > >  GENERIC_INC := rte_atomic.h rte_byteorder.h rte_cycles.h rte_prefetch.h
> > > >  GENERIC_INC += rte_spinlock.h rte_memcpy.h rte_cpuflags.h rte_rwlock.h
> > > > diff --git a/lib/librte_eal/common/include/rte_test.h b/lib/librte_eal/common/include/rte_test.h
> > > > new file mode 100644
> > > > index 000000000..256117f79
> > > > --- /dev/null
> > > > +++ b/lib/librte_eal/common/include/rte_test.h
> > > > @@ -0,0 +1,97 @@
> > [...]


More information about the dev mailing list