From: Jan Viktorin Subject: Re: [PATCH v3 01/11] app/test: introduce resources for tests Date: Thu, 19 May 2016 10:51:08 +0200 Message-ID: <20160519105108.3879dd84@pcviktorin.fit.vutbr.cz> References: <1463510101-5633-1-git-send-email-viktorin@rehivetech.com> <1463510101-5633-2-git-send-email-viktorin@rehivetech.com> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: Thomas Monjalon , David Marchand , Bruce Richardson To: dev@dpdk.org Return-path: Received: from wes1-so1.wedos.net (wes1-so1.wedos.net [46.28.106.15]) by dpdk.org (Postfix) with ESMTP id 1130B91BF for ; Thu, 19 May 2016 10:52:52 +0200 (CEST) In-Reply-To: <1463510101-5633-2-git-send-email-viktorin@rehivetech.com> List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" I forgot to fix this: Check patch error: 12817: ERROR: space required after that ',' (ctx:VxV) #244: FILE: app/test/resource.h:93: +static void __attribute__((constructor,used)) resinitfn_ ##n(void) ^ total: 1 errors, 0 warnings, 259 lines checked will do for v4. Jan On Tue, 17 May 2016 20:34:51 +0200 Jan Viktorin wrote: > Certain internal mechanisms of DPDK access different file system structures > (e.g. /sys/bus/pci/devices). It is difficult to test those cases automatically > by a unit test when such path is not hard-coded and there is no simple way how > to distribute fake ones with the current testing environment. > > This patch adds a possibility to declare a resource embedded in the test binary > itself. The structure resource cover the generic situation - it provides a name > for lookup and pointers to the embedded data blob. A resource is registered > in a constructor by the macro REGISTER_RESOURCE. > > Some initial tests of simple resources is included and added into the group_1. > > Signed-off-by: Jan Viktorin > --- > v3: > * fixed doc comments > --- > app/test/Makefile | 2 + > app/test/autotest_data.py | 6 +++ > app/test/resource.c | 66 +++++++++++++++++++++++++++++++ > app/test/resource.h | 98 +++++++++++++++++++++++++++++++++++++++++++++++ > app/test/test_resource.c | 75 ++++++++++++++++++++++++++++++++++++ > 5 files changed, 247 insertions(+) > create mode 100644 app/test/resource.c > create mode 100644 app/test/resource.h > create mode 100644 app/test/test_resource.c [...]