From patchwork Wed Feb 22 12:56:01 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christophe Milard X-Patchwork-Id: 94324 Delivered-To: patch@linaro.org Received: by 10.182.3.34 with SMTP id 2csp927663obz; Wed, 22 Feb 2017 04:11:44 -0800 (PST) X-Received: by 10.55.189.197 with SMTP id n188mr1442812qkf.252.1487765503987; Wed, 22 Feb 2017 04:11:43 -0800 (PST) Return-Path: Received: from lists.linaro.org (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id u13si718672qki.218.2017.02.22.04.11.43; Wed, 22 Feb 2017 04:11:43 -0800 (PST) Received-SPF: pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.225.227.206 as permitted sender) client-ip=54.225.227.206; Authentication-Results: mx.google.com; spf=pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.225.227.206 as permitted sender) smtp.mailfrom=lng-odp-bounces@lists.linaro.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: by lists.linaro.org (Postfix, from userid 109) id A007560E3E; Wed, 22 Feb 2017 12:11:43 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on ip-10-142-244-252 X-Spam-Level: X-Spam-Status: No, score=-1.4 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,URIBL_BLOCKED,URI_NOVOWEL autolearn=disabled version=3.4.0 Received: from [127.0.0.1] (localhost [127.0.0.1]) by lists.linaro.org (Postfix) with ESMTP id D77926352A; Wed, 22 Feb 2017 11:59:44 +0000 (UTC) X-Original-To: lng-odp@lists.linaro.org Delivered-To: lng-odp@lists.linaro.org Received: by lists.linaro.org (Postfix, from userid 109) id E5F1D60F22; Wed, 22 Feb 2017 11:59:32 +0000 (UTC) Received: from mail-lf0-f43.google.com (mail-lf0-f43.google.com [209.85.215.43]) by lists.linaro.org (Postfix) with ESMTPS id 5155D60F22 for ; Wed, 22 Feb 2017 11:57:39 +0000 (UTC) Received: by mail-lf0-f43.google.com with SMTP id l12so180877lfe.0 for ; Wed, 22 Feb 2017 03:57:39 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=8MFxnA7nHDYByuwXD1+dIRvUcttaWwgP8BUD3dEugfc=; b=fR44Mvs9x4jXJOhT25g7NOMcWpyd2uOWqqKpa96o51oq5wuBHD8zGB1h8VD7fREUil fZyg33ZIM574zWSbXvHStccF5KV8oVTZuR1YJ0741f7Av0hUNkspym0Ty1hEYJUzQx78 BhOXeos+i3aWoGI7fQO8BYsQWy1kcFJfIMamOmjoxVGqOwS/FbMXT1jle0BZNeBSACcN rw1qIW2yrWJk14j43lLnKdpDr8uv7L0Iqz89oJpJEfURc+I23wrImhh1oPq4Gpc/byxd /xzow73XCHJF+8QGyPQ3oGTG4ChjakOhsez3JbjJxOtMqYEs05KoDc4tnZi7kbbKW5bT NoeQ== X-Gm-Message-State: AMke39mr9ovJNLALSNLGkjvaNmoV2ePHzt4xDIZwn2+SalPRNtRrYuGL8Sqj2YC//5Mg2rwEDV8= X-Received: by 10.25.207.81 with SMTP id f78mr8941852lfg.4.1487764658024; Wed, 22 Feb 2017 03:57:38 -0800 (PST) Received: from erachmi-ericsson.ki.sw.ericsson.se (c-83-233-76-66.cust.bredband2.com. [83.233.76.66]) by smtp.gmail.com with ESMTPSA id v21sm7035187ljd.9.2017.02.22.03.57.36 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 22 Feb 2017 03:57:37 -0800 (PST) From: Christophe Milard To: mike.holmes@linaro.org, yi.he@linaro.org, forrest.shi@linaro.org, sachin.saxena@linaro.com, bill.fischofer@linaro.org, lng-odp@lists.linaro.org Date: Wed, 22 Feb 2017 13:56:01 +0100 Message-Id: <1487768164-43184-19-git-send-email-christophe.milard@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1487768164-43184-1-git-send-email-christophe.milard@linaro.org> References: <1487768164-43184-1-git-send-email-christophe.milard@linaro.org> Subject: [lng-odp] [API-NEXT PATCH 18/21] test: drv: driver registration and probing X-BeenThere: lng-odp@lists.linaro.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: "The OpenDataPlane \(ODP\) List" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: lng-odp-bounces@lists.linaro.org Sender: "lng-odp" Register driver, devios, enumerators, create devices, and check that probing occurs correctely. Signed-off-by: Christophe Milard --- .../validation/drv/drvdriver/.gitignore | 1 + .../validation/drv/drvdriver/Makefile.am | 11 + .../validation/drv/drvdriver/drvdriver_driver.c | 515 +++++++++++++++++++++ .../validation/drv/drvdriver/drvdriver_driver.h | 24 + .../drv/drvdriver/drvdriver_driver_main.c | 12 + test/linux-generic/Makefile.am | 1 + 6 files changed, 564 insertions(+) create mode 100644 test/common_plat/validation/drv/drvdriver/drvdriver_driver.c create mode 100644 test/common_plat/validation/drv/drvdriver/drvdriver_driver.h create mode 100644 test/common_plat/validation/drv/drvdriver/drvdriver_driver_main.c -- 2.7.4 diff --git a/test/common_plat/validation/drv/drvdriver/.gitignore b/test/common_plat/validation/drv/drvdriver/.gitignore index 829c8b4..76bb6ba 100644 --- a/test/common_plat/validation/drv/drvdriver/.gitignore +++ b/test/common_plat/validation/drv/drvdriver/.gitignore @@ -2,3 +2,4 @@ drvdriver_enumr_class_main drvdriver_enumr_main drvdriver_device_main drvdriver_devio_main +drvdriver_driver_main diff --git a/test/common_plat/validation/drv/drvdriver/Makefile.am b/test/common_plat/validation/drv/drvdriver/Makefile.am index 8e695ba..88bd828 100644 --- a/test/common_plat/validation/drv/drvdriver/Makefile.am +++ b/test/common_plat/validation/drv/drvdriver/Makefile.am @@ -47,3 +47,14 @@ drvdriver_devio_main_LDADD = libtestdrvdriverdevio.la \ $(LIBCUNIT_COMMON) $(LIBODP) EXTRA_DIST += drvdriver_devio.h + +#tests for driver registration and probing: +noinst_LTLIBRARIES += libtestdrvdriverdriver.la +libtestdrvdriverdriver_la_SOURCES = drvdriver_driver.c + +test_PROGRAMS += drvdriver_driver_main$(EXEEXT) +dist_drvdriver_driver_main_SOURCES = drvdriver_driver_main.c +drvdriver_driver_main_LDADD = libtestdrvdriverdriver.la \ + $(LIBCUNIT_COMMON) $(LIBODP) + +EXTRA_DIST += drvdriver_driver.h diff --git a/test/common_plat/validation/drv/drvdriver/drvdriver_driver.c b/test/common_plat/validation/drv/drvdriver/drvdriver_driver.c new file mode 100644 index 0000000..c293b06 --- /dev/null +++ b/test/common_plat/validation/drv/drvdriver/drvdriver_driver.c @@ -0,0 +1,515 @@ +/* Copyright (c) 2017, Linaro Limited + * All rights reserved. + * + * SPDX-License-Identifier: BSD-3-Clause + */ + +/* This file is a bit long as it tries to simulate the presence of 2 + * enumerator classes, 2 enumerators, and 3 drivers in one go to + * see how things are handled by the driver framework. + * The following is done: + * - create 2 enumerator classes, + * - each with its own enumerator providing interfaces: E1 and E2. + * - E1 and E2 create 4 devices each. + * - the following devio are created: + * devio1 enabling device handling from DRVIF-1 to E1 + * devio2 enabling device handling from DRVIF-2 to E2 + * devio3 enabling device handling from DRVIF-3 to E2 + * devio4 enabling device handling from DRVIF-3 to E3 (does not exist) + * devio5 enabling device handling from DRVIF-4 to E3 (does not exist) + * + * -then the following driver are created: + * driver1, requiring devio DRVIF-1 + * driver2, requiring devio DRVIF-2 (preferred) and DRVIF-3 + * driver3, requiring devio DRVIF-4 + * + * The test amkes sure that: + * driver 1 is probed (and accepts) the 4 devices of E1 with devio1 + * driver 2 is probed (and rejects) the 4 devices of E2 with devio2 and devio4 + * driver3 is never probed. + */ + +#include +#include +#include +#include "drvdriver_driver.h" +#include + +static odp_instance_t odp_instance; +static odpdrv_enumr_class_t enumr_class1; +static odpdrv_enumr_class_t enumr_class2; +static odpdrv_enumr_t enumr1; +static odpdrv_enumr_t enumr2; +#define NB_DEVICES 4 +static odpdrv_device_t E1_devs[NB_DEVICES]; +static odpdrv_device_t E2_devs[NB_DEVICES]; +static odpdrv_devio_t devio1; +static odpdrv_devio_t devio2; +static odpdrv_devio_t devio3; +static odpdrv_devio_t devio4; +static odpdrv_devio_t devio5; +static odpdrv_driver_t driver1; +static odpdrv_driver_t driver2; +static odpdrv_driver_t driver3; + +static int driver1_probed_index; +static int driver2_probed_index; + +/* forward declaration */ +static int enumr1_probe(void); +static int enumr2_probe(void); +static int enumr1_remove(void); +static int enumr2_remove(void); +static int enumr_class1_probe(void); +static int enumr_class2_probe(void); +static int driver1_probe(odpdrv_device_t dev, odpdrv_devio_t devio, int idx); +static int driver2_probe(odpdrv_device_t dev, odpdrv_devio_t devio, int idx); +static int driver3_probe(odpdrv_device_t dev, odpdrv_devio_t devio, int idx); +static int driver1_unbind(odpdrv_device_t dev, + void (*callback)(odpdrv_device_t dev), + uint32_t flags); +static int driver2_unbind(odpdrv_device_t dev, + void (*callback)(odpdrv_device_t dev), + uint32_t flags); +static int driver3_unbind(odpdrv_device_t dev, + void (*callback)(odpdrv_device_t dev), + uint32_t flags); + +/* because many things to be checked are performed during ODP initialisation, + * the initialisation functions have to be a part of the test + */ +static int tests_global_init(void) +{ + if (0 != odp_init_global(&odp_instance, NULL, NULL)) { + fprintf(stderr, "error: odp_init_global() failed.\n"); + return -1; + } + if (0 != odp_init_local(odp_instance, ODP_THREAD_CONTROL)) { + fprintf(stderr, "error: odp_init_local() failed.\n"); + return -1; + } + + return 0; +} + +static int tests_global_term(void) +{ + if (0 != odp_term_local()) { + fprintf(stderr, "error: odp_term_local() failed.\n"); + return -1; + } + + if (0 != odp_term_global(odp_instance)) { + fprintf(stderr, "error: odp_term_global() failed.\n"); + return -1; + } + + return 0; +} + +/*enumerator class register functions, all "statically linked" + *(i.e. directely run at start), due to the fact that platorm independent + * shared lib loading in autotools is a mess */ +static void __attribute__ ((constructor)) enumr_class1_register(void) +{ + odpdrv_enumr_class_param_t param = { + .name = "C1", + .probe = enumr_class1_probe, + .remove = NULL + }; + + enumr_class1 = odpdrv_enumr_class_register(¶m); +} + +static void __attribute__ ((constructor)) enumr_class2_register(void) +{ + odpdrv_enumr_class_param_t param = { + .name = "C2", + .probe = enumr_class2_probe, + .remove = NULL + }; + + enumr_class2 = odpdrv_enumr_class_register(¶m); +} + +/*enumerator class probe functions, registering enumerators E1 and E2: */ +static int enumr_class1_probe(void) +{ + odpdrv_enumr_param_t param = { + .enumr_class = enumr_class1, + .api_name = "E1", + .api_version = 1, + .probe = enumr1_probe, + .remove = enumr1_remove, + .register_notifier = NULL + }; + + enumr1 = odpdrv_enumr_register(¶m); + CU_ASSERT(enumr1 != ODPDRV_ENUMR_INVALID); + + return 0; +} + +static int enumr_class2_probe(void) +{ + odpdrv_enumr_param_t param = { + .enumr_class = enumr_class2, + .api_name = "E2", + .api_version = 1, + .probe = enumr2_probe, + .remove = enumr2_remove, + .register_notifier = NULL + }; + + enumr2 = odpdrv_enumr_register(¶m); + CU_ASSERT(enumr2 != ODPDRV_ENUMR_INVALID); + + return 0; +} + +/*enumerator probe functions, creating four devices each: */ +static int enumr1_probe(void) +{ + int dev; + + odpdrv_device_param_t param = { + .enumerator = enumr1, + .address = "E1:00:0X", + .enum_dev = NULL + }; + + /* create devices: */ + for (dev = 0; dev < NB_DEVICES; dev++) { + param.address[7] = '0' + dev; /* change X in the address */ + param.enum_dev = NULL; + E1_devs[dev] = odpdrv_device_create(¶m); + CU_ASSERT(E1_devs[dev] != ODPDRV_DEVICE_INVALID); + } + + return 0; +} + +static int enumr2_probe(void) +{ + int dev; + + odpdrv_device_param_t param = { + .enumerator = enumr2, + .address = "E2:00:0X", + .enum_dev = NULL + }; + + /* create devices: */ + for (dev = 0; dev < NB_DEVICES; dev++) { + param.address[7] = '0' + dev; /* change X in the address */ + param.enum_dev = NULL; + E2_devs[dev] = odpdrv_device_create(¶m); + CU_ASSERT(E1_devs[dev] != ODPDRV_DEVICE_INVALID); + } + + return 0; +} + +/*enumerator remove functions, to remove the enumerated devices: */ +static int enumr1_remove(void) +{ + odpdrv_device_t *my_devices; + odpdrv_device_t *dev; + int count = 0; + + /* destroy all devices created by enumerator 5: */ + my_devices = odpdrv_device_query(enumr1, NULL); + + for (dev = my_devices; *dev != ODPDRV_DEVICE_INVALID; dev++) { + odpdrv_device_destroy(*dev, NULL, 0); + count++; + } + + CU_ASSERT(count == NB_DEVICES); + + free(my_devices); + return 0; +} + +static int enumr2_remove(void) +{ + odpdrv_device_t *my_devices; + odpdrv_device_t *dev; + int count = 0; + + /* destroy all devices created by enumerator 5: */ + my_devices = odpdrv_device_query(enumr2, NULL); + + for (dev = my_devices; *dev != ODPDRV_DEVICE_INVALID; dev++) { + odpdrv_device_destroy(*dev, NULL, 0); + count++; + } + + CU_ASSERT(count == NB_DEVICES); + + free(my_devices); + return 0; +} + +/* devios: */ +static void __attribute__ ((constructor)) devio1_register(void) +{ + odpdrv_devio_param_t param = { + .api_name = "DRVIF-1", + .api_version = 1, + .enumr_api_name = "E1", + .enumr_api_version = 1, + .probe = NULL, + .remove = NULL, + .ops = NULL, + }; + + devio1 = odpdrv_devio_register(¶m); +} + +static void __attribute__ ((constructor)) devio2_register(void) +{ + odpdrv_devio_param_t param = { + .api_name = "DRVIF-2", + .api_version = 1, + .enumr_api_name = "E2", + .enumr_api_version = 1, + .probe = NULL, + .remove = NULL, + .ops = NULL, + }; + + devio2 = odpdrv_devio_register(¶m); +} + +static void __attribute__ ((constructor)) devio3_register(void) +{ + odpdrv_devio_param_t param = { + .api_name = "DRVIF-3", + .api_version = 1, + .enumr_api_name = "E2", + .enumr_api_version = 1, + .probe = NULL, + .remove = NULL, + .ops = NULL, + }; + + devio3 = odpdrv_devio_register(¶m); +} + +static void __attribute__ ((constructor)) devio4_register(void) +{ + odpdrv_devio_param_t param = { + .api_name = "DRVIF-3", + .api_version = 1, + .enumr_api_name = "E3", + .enumr_api_version = 1, + .probe = NULL, + .remove = NULL, + .ops = NULL, + }; + + devio4 = odpdrv_devio_register(¶m); +} + +static void __attribute__ ((constructor)) devio5_register(void) +{ + odpdrv_devio_param_t param = { + .api_name = "DRVIF-4", + .api_version = 1, + .enumr_api_name = "E3", + .enumr_api_version = 1, + .probe = NULL, + .remove = NULL, + .ops = NULL, + }; + + devio5 = odpdrv_devio_register(¶m); +} + +static void __attribute__ ((constructor)) driver1_register(void) +{ + odpdrv_driver_param_t param = { + .name = "driver1", + .devios = { {"DRVIF-1", 1}, {"", -1}, {"", -1} }, + .probe = driver1_probe, + .unbind = driver1_unbind, + .remove = NULL, + }; + + driver1 = odpdrv_driver_register(¶m); +} + +static void __attribute__ ((constructor)) driver2_register(void) +{ + odpdrv_driver_param_t param = { + .name = "driver2", + .devios = { {"DRVIF-2", 1}, {"DRVIF-3", 1}, {"", -1} }, + .probe = driver2_probe, + .unbind = driver2_unbind, + .remove = NULL, + }; + + driver2 = odpdrv_driver_register(¶m); +} + +static void __attribute__ ((constructor)) driver3_register(void) +{ + odpdrv_driver_param_t param = { + .name = "driver3", + .devios = { {"DRVIF-4", 1}, {"", -1}, {"", -1} }, + .probe = driver3_probe, + .unbind = driver3_unbind, + .remove = NULL, + }; + + driver3 = odpdrv_driver_register(¶m); +} + +static int driver1_probe(odpdrv_device_t dev, odpdrv_devio_t devio, int idx) +{ + int i; + int dev_found = 0; + + CU_ASSERT(dev != ODPDRV_DEVICE_INVALID); + CU_ASSERT(devio == devio1); + CU_ASSERT(idx < 1); + + /*makes sure the device is from E1 */ + for (i = 0; i < NB_DEVICES; i++) { + if (dev == E1_devs[i]) { + driver1_probed_index |= (1 << i); + dev_found = 1; + } + } + CU_ASSERT(dev_found); + return 0; /* accept the device */ +} + +static int driver2_probe(odpdrv_device_t dev, odpdrv_devio_t devio, int idx) +{ + int i; + int dev_found = 0; + + CU_ASSERT(dev != ODPDRV_DEVICE_INVALID); + + /* check that we are probed with one of the required deviios */ + CU_ASSERT(((devio == devio2) && (idx == 0)) || + ((devio == devio3) && (idx == 1))); + + /*make sure the device is from E2, and probed twice */ + for (i = 0; i < NB_DEVICES; i++) { + if (dev == E2_devs[i]) { + /* check that device was probed with idx=0 first */ + if (idx > 0) + CU_ASSERT(driver2_probed_index & (1 << i)); + /* marked as probed: */ + driver2_probed_index |= (1 << (i + idx * NB_DEVICES)); + dev_found = 1; + } + } + CU_ASSERT(dev_found); + if (idx == 0) + return -1; /* reject the device, when probed with idx = 0 */ + return 0; /* accept second probe*/ +} + +static int driver3_probe(odpdrv_device_t dev, odpdrv_devio_t devio, int idx) +{ + /* we can look for some strangeness here ... */ + CU_ASSERT(dev != ODPDRV_DEVICE_INVALID); + CU_ASSERT(devio != ODPDRV_DEVIO_INVALID); + CU_ASSERT(idx >= 0); + + /* but we should not be probing this driver anyway! */ + CU_FAIL("This driver should not be probed"); + return -1; /* reject the device */ +} + +static int driver1_unbind(odpdrv_device_t dev, + void (*callback)(odpdrv_device_t dev), + uint32_t flags) +{ + CU_ASSERT(dev != ODPDRV_DEVICE_INVALID); + CU_ASSERT(flags == ODPDRV_DRV_UNBIND_IMMEDIATE); + callback(dev); + + return 0; +} + +static int driver2_unbind(odpdrv_device_t dev, + void (*callback)(odpdrv_device_t dev), + uint32_t flags) +{ + CU_ASSERT(dev != ODPDRV_DEVICE_INVALID); + CU_ASSERT(flags == ODPDRV_DRV_UNBIND_IMMEDIATE); + callback(dev); + + return 0; +} + +static int driver3_unbind(odpdrv_device_t dev, + void (*callback)(odpdrv_device_t dev), + uint32_t flags) +{ + CU_ASSERT(dev != ODPDRV_DEVICE_INVALID); + CU_ASSERT(flags == ODPDRV_DRV_UNBIND_IMMEDIATE); + callback(dev); + + return 0; +} + +void drvdriver_test_driver_register(void) +{ + CU_ASSERT(enumr_class1 != ODPDRV_ENUMR_CLASS_INVALID); + CU_ASSERT(enumr_class2 != ODPDRV_ENUMR_CLASS_INVALID); + CU_ASSERT(devio1 != ODPDRV_DEVIO_INVALID); + CU_ASSERT(devio2 != ODPDRV_DEVIO_INVALID); + CU_ASSERT(devio3 != ODPDRV_DEVIO_INVALID); + CU_ASSERT(devio4 != ODPDRV_DEVIO_INVALID); + CU_ASSERT(devio5 != ODPDRV_DEVIO_INVALID); + CU_ASSERT(driver1 != ODPDRV_DRIVER_INVALID); + CU_ASSERT(driver2 != ODPDRV_DRIVER_INVALID); + CU_ASSERT(driver3 != ODPDRV_DRIVER_INVALID); + + CU_ASSERT(tests_global_init() == 0); + + CU_ASSERT(odpdrv_print_all() == 0); + + /* check that expected probing occurred: */ + CU_ASSERT(driver1_probed_index == (1 << NB_DEVICES) - 1); + CU_ASSERT(driver2_probed_index == (1 << (NB_DEVICES * 2)) - 1); + + CU_ASSERT(tests_global_term() == 0); +} + +odp_testinfo_t drvdriver_suite_driver[] = { + ODP_TEST_INFO(drvdriver_test_driver_register), + ODP_TEST_INFO_NULL, +}; + +odp_suiteinfo_t drvdriver_suites_driver[] = { + {"Enumerator registration", NULL, NULL, drvdriver_suite_driver}, + ODP_SUITE_INFO_NULL, +}; + +int drvdriver_driver_main(int argc, char *argv[]) +{ + int ret; + + /* parse common options: */ + if (odp_cunit_parse_options(argc, argv)) + return -1; + + /* prevent default ODP init: */ + odp_cunit_register_global_init(NULL); + odp_cunit_register_global_term(NULL); + + /* register the tests: */ + ret = odp_cunit_register(drvdriver_suites_driver); + + if (ret == 0) + ret = odp_cunit_run(); + + return ret; +} diff --git a/test/common_plat/validation/drv/drvdriver/drvdriver_driver.h b/test/common_plat/validation/drv/drvdriver/drvdriver_driver.h new file mode 100644 index 0000000..d80c689 --- /dev/null +++ b/test/common_plat/validation/drv/drvdriver/drvdriver_driver.h @@ -0,0 +1,24 @@ +/* Copyright (c) 2017, Linaro Limited + * All rights reserved. + * + * SPDX-License-Identifier: BSD-3-Clause + */ + +#ifndef _ODP_TEST_DRVDRIVER_DRIVER_H_ +#define _ODP_TEST_DRVDRIVER_DRIVER_H_ + +#include + +/* test functions: */ +void drvdriver_test_driver_register(void); + +/* test arrays: */ +extern odp_testinfo_t drvdriver_suite_driver[]; + +/* test registry: */ +extern odp_suiteinfo_t drvdriver_suites_driver[]; + +/* main test program: */ +int drvdriver_driver_main(int argc, char *argv[]); + +#endif diff --git a/test/common_plat/validation/drv/drvdriver/drvdriver_driver_main.c b/test/common_plat/validation/drv/drvdriver/drvdriver_driver_main.c new file mode 100644 index 0000000..671689c --- /dev/null +++ b/test/common_plat/validation/drv/drvdriver/drvdriver_driver_main.c @@ -0,0 +1,12 @@ +/* Copyright (c) 2017, Linaro Limited + * All rights reserved. + * + * SPDX-License-Identifier: BSD-3-Clause + */ + +#include "drvdriver_driver.h" + +int main(int argc, char *argv[]) +{ + return drvdriver_driver_main(argc, argv); +} diff --git a/test/linux-generic/Makefile.am b/test/linux-generic/Makefile.am index 55db05c..03f9a8d 100644 --- a/test/linux-generic/Makefile.am +++ b/test/linux-generic/Makefile.am @@ -38,6 +38,7 @@ TESTS = validation/api/pktio/pktio_run.sh \ $(ALL_DRV_VALIDATION_DIR)/drvatomic/drvatomic_main$(EXEEXT) \ $(ALL_DRV_VALIDATION_DIR)/drvdriver/drvdriver_device_main$(EXEEXT)\ $(ALL_DRV_VALIDATION_DIR)/drvdriver/drvdriver_devio_main$(EXEEXT)\ + $(ALL_DRV_VALIDATION_DIR)/drvdriver/drvdriver_driver_main$(EXEEXT)\ $(ALL_DRV_VALIDATION_DIR)/drvdriver/drvdriver_enumr_class_main$(EXEEXT)\ $(ALL_DRV_VALIDATION_DIR)/drvdriver/drvdriver_enumr_main$(EXEEXT)\ $(ALL_DRV_VALIDATION_DIR)/drvshmem/drvshmem_main$(EXEEXT) \