From patchwork Wed Oct 14 09:28:17 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stuart Haslam X-Patchwork-Id: 54892 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-lb0-f197.google.com (mail-lb0-f197.google.com [209.85.217.197]) by patches.linaro.org (Postfix) with ESMTPS id CC6FC20490 for ; Wed, 14 Oct 2015 09:31:32 +0000 (UTC) Received: by lbbti1 with SMTP id ti1sf22737563lbb.3 for ; Wed, 14 Oct 2015 02:31:31 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:delivered-to:from:to:date :message-id:in-reply-to:references:subject:precedence:list-id :list-unsubscribe:list-archive:list-post:list-help:list-subscribe :mime-version:content-type:content-transfer-encoding:errors-to :sender:x-original-sender:x-original-authentication-results :mailing-list; bh=YVW1/2GkEp8MWmSi8sFAYEvdGWb1u4kVj7ymVgYHhAQ=; b=dfMwgYR/+T2opLz4QRSevxasAeR7Ow8LvA9BtwyVOTfPUH64SKb1V5KfSFwy7d9kAl DYBykdk/xC797IoIdBdr1juKufDptqlKCvhi2ocxnfI0v4DzyQWXJX7UxBMpYKrspG1c luMGSnP6L/MwNCijYOKvwumt+CLAXbZOGLU3N4sf6H5DMicFeP3kI+H8wme47ZpbqQ+R 9UMPKFuFV/8Yyc0IosZyKQ4tJmsK3c2oAyuxRx39eLfmCrTMnPHWTpUozICP7/7JwJlc PIZJiXEXEv9M1s6DdzA+YSv5x1etBx6r9M0HfMNbrYGpYXii0x4OBAkqeMWx+ceGGMpZ udTw== X-Gm-Message-State: ALoCoQkn9vV6ZqgccDLjQYaf1QXpJtf4LfzMOL/3tft3OVGG/cD8D71/NltuBB5uH8l/89TKfJXP X-Received: by 10.112.130.41 with SMTP id ob9mr504255lbb.17.1444815091809; Wed, 14 Oct 2015 02:31:31 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.25.150.209 with SMTP id y200ls15977lfd.17.gmail; Wed, 14 Oct 2015 02:31:31 -0700 (PDT) X-Received: by 10.25.23.99 with SMTP id n96mr695079lfi.52.1444815091667; Wed, 14 Oct 2015 02:31:31 -0700 (PDT) Received: from mail-lf0-f46.google.com (mail-lf0-f46.google.com. [209.85.215.46]) by mx.google.com with ESMTPS id a188si4967158lfa.56.2015.10.14.02.31.31 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 14 Oct 2015 02:31:31 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.46 as permitted sender) client-ip=209.85.215.46; Received: by lffy185 with SMTP id y185so8276508lff.2 for ; Wed, 14 Oct 2015 02:31:31 -0700 (PDT) X-Received: by 10.25.145.132 with SMTP id t126mr680264lfd.88.1444815091512; Wed, 14 Oct 2015 02:31:31 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.112.59.35 with SMTP id w3csp2609632lbq; Wed, 14 Oct 2015 02:31:30 -0700 (PDT) X-Received: by 10.55.212.219 with SMTP id s88mr2624969qks.70.1444815090165; Wed, 14 Oct 2015 02:31:30 -0700 (PDT) Received: from lists.linaro.org (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id z16si7011488qge.71.2015.10.14.02.31.29; Wed, 14 Oct 2015 02:31:30 -0700 (PDT) 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; Received: by lists.linaro.org (Postfix, from userid 109) id AE9F561CB8; Wed, 14 Oct 2015 09:31:29 +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=-2.6 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, URIBL_BLOCKED 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 4021561D3E; Wed, 14 Oct 2015 09:29:17 +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 B698E61CB8; Wed, 14 Oct 2015 09:29:09 +0000 (UTC) Received: from mail-wi0-f169.google.com (mail-wi0-f169.google.com [209.85.212.169]) by lists.linaro.org (Postfix) with ESMTPS id B7C2561BAF for ; Wed, 14 Oct 2015 09:29:02 +0000 (UTC) Received: by wicge5 with SMTP id ge5so227409269wic.0 for ; Wed, 14 Oct 2015 02:29:02 -0700 (PDT) X-Received: by 10.180.187.141 with SMTP id fs13mr28506630wic.13.1444814941894; Wed, 14 Oct 2015 02:29:01 -0700 (PDT) Received: from e106441.emea.arm.com ([2001:41d0:a:3cb4::abcd]) by smtp.gmail.com with ESMTPSA id m6sm6323270wif.11.2015.10.14.02.29.01 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 14 Oct 2015 02:29:01 -0700 (PDT) From: Stuart Haslam To: lng-odp@lists.linaro.org Date: Wed, 14 Oct 2015 10:28:17 +0100 Message-Id: <1444814900-14384-3-git-send-email-stuart.haslam@linaro.org> X-Mailer: git-send-email 2.1.1 In-Reply-To: <1444814900-14384-1-git-send-email-stuart.haslam@linaro.org> References: <1444814900-14384-1-git-send-email-stuart.haslam@linaro.org> X-Topics: patch Subject: [lng-odp] [PATCHv3 2/5] validation: add odp_cunit_update() to modify registered tests X-BeenThere: lng-odp@lists.linaro.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: , List-Help: , List-Subscribe: , MIME-Version: 1.0 Errors-To: lng-odp-bounces@lists.linaro.org Sender: "lng-odp" X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: stuart.haslam@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.46 as permitted sender) smtp.mailfrom=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 Add an odp_cunit_update() function to allow some attributes of previously registered tests to be modified, such as whether it's active or not. Previously, registering and running tests was done in a single step; odp_cunit_run(testsuites); But this is now split; odp_cunit_register(testsuites); odp_cunit_update(testsuites_updates); odp_cunit_run(); The odp_cunit_update() is optional and none of the currently defined tests use it, so there's no functional change in this patch. Signed-off-by: Stuart Haslam Reviewed-by: Christophe Milard --- test/validation/buffer/buffer.c | 7 +- test/validation/classification/classification.c | 7 +- test/validation/common/odp_cunit_common.c | 139 +++++++++++++++++++++--- test/validation/common/odp_cunit_common.h | 10 +- test/validation/cpumask/cpumask.c | 7 +- test/validation/crypto/crypto.c | 10 +- test/validation/errno/errno.c | 7 +- test/validation/init/init.c | 29 ++++- test/validation/packet/packet.c | 7 +- test/validation/pktio/pktio.c | 7 +- test/validation/pool/pool.c | 7 +- test/validation/queue/queue.c | 7 +- test/validation/random/random.c | 7 +- test/validation/scheduler/scheduler.c | 7 +- test/validation/shmem/shmem.c | 7 +- test/validation/synchronizers/synchronizers.c | 10 +- test/validation/system/system.c | 7 +- test/validation/thread/thread.c | 7 +- test/validation/time/time.c | 7 +- test/validation/timer/timer.c | 7 +- 20 files changed, 267 insertions(+), 36 deletions(-) diff --git a/test/validation/buffer/buffer.c b/test/validation/buffer/buffer.c index 4600e59..257e95c 100644 --- a/test/validation/buffer/buffer.c +++ b/test/validation/buffer/buffer.c @@ -153,5 +153,10 @@ odp_suiteinfo_t buffer_suites[] = { int buffer_main(void) { - return odp_cunit_run(buffer_suites); + int ret = odp_cunit_register(buffer_suites); + + if (ret == 0) + odp_cunit_run(); + + return ret; } diff --git a/test/validation/classification/classification.c b/test/validation/classification/classification.c index b868c61..fe9a827 100644 --- a/test/validation/classification/classification.c +++ b/test/validation/classification/classification.c @@ -23,5 +23,10 @@ odp_suiteinfo_t classification_suites[] = { int classification_main(void) { - return odp_cunit_run(classification_suites); + int ret = odp_cunit_register(classification_suites); + + if (ret == 0) + ret = odp_cunit_run(); + + return ret; } diff --git a/test/validation/common/odp_cunit_common.c b/test/validation/common/odp_cunit_common.c index 95cbbc0..aade1c3 100644 --- a/test/validation/common/odp_cunit_common.c +++ b/test/validation/common/odp_cunit_common.c @@ -103,6 +103,18 @@ static odp_suiteinfo_t *cunit_get_suite_info(const char *suite_name) return NULL; } +static odp_testinfo_t *cunit_get_test_info(odp_suiteinfo_t *sinfo, + const char *test_name) +{ + odp_testinfo_t *tinfo; + + for (tinfo = sinfo->pTests; tinfo->testinfo.pName; tinfo++) + if (strcmp(tinfo->testinfo.pName, test_name) == 0) + return tinfo; + + return NULL; +} + /* A wrapper for the suite's init function. This is done to allow for a * potential runtime check to determine whether each test in the suite * is active (enabled by using ODP_TEST_INFO_CONDITIONAL()). If present, @@ -186,27 +198,90 @@ static int cunit_register_suites(odp_suiteinfo_t testsuites[]) return 0; } +static int cunit_update_test(CU_pSuite suite, + odp_suiteinfo_t *sinfo, + odp_testinfo_t *updated_tinfo) +{ + CU_pTest test = NULL; + CU_ErrorCode err; + odp_testinfo_t *tinfo; + const char *test_name = updated_tinfo->testinfo.pName; + + tinfo = cunit_get_test_info(sinfo, test_name); + if (tinfo) + test = CU_get_test(suite, test_name); + + if (!tinfo || !test) { + fprintf(stderr, "%s: unable to find existing test named %s\n", + __func__, test_name); + return -1; + } + + err = CU_set_test_func(test, updated_tinfo->testinfo.pTestFunc); + if (err != CUE_SUCCESS) { + fprintf(stderr, "%s: failed to update test func for %s\n", + __func__, test_name); + return -1; + } + + tinfo->check_active = updated_tinfo->check_active; + + return 0; +} + +static int cunit_update_suite(odp_suiteinfo_t *updated_sinfo) +{ + CU_pSuite suite = NULL; + CU_ErrorCode err; + odp_suiteinfo_t *sinfo; + odp_testinfo_t *tinfo; + + /* find previously registered suite with matching name */ + sinfo = cunit_get_suite_info(updated_sinfo->pName); + + if (sinfo) { + /* lookup the associated CUnit suite */ + suite = CU_get_suite_by_name(updated_sinfo->pName, + CU_get_registry()); + } + + if (!sinfo || !suite) { + fprintf(stderr, "%s: unable to find existing suite named %s\n", + __func__, updated_sinfo->pName); + return -1; + } + + sinfo->pInitFunc = updated_sinfo->pInitFunc; + sinfo->pCleanupFunc = updated_sinfo->pCleanupFunc; + + err = CU_set_suite_cleanupfunc(suite, updated_sinfo->pCleanupFunc); + if (err != CUE_SUCCESS) { + fprintf(stderr, "%s: failed to update cleanup func for %s\n", + __func__, updated_sinfo->pName); + return -1; + } + + for (tinfo = updated_sinfo->pTests; tinfo->testinfo.pName; tinfo++) { + int ret; + + ret = cunit_update_test(suite, sinfo, tinfo); + if (ret != 0) + return ret; + } + + return 0; +} + /* - * Register test suites to be run via odp_cunit_run() + * Run tests previously registered via odp_cunit_register() */ -int odp_cunit_run(odp_suiteinfo_t testsuites[]) +int odp_cunit_run(void) { int ret; printf("\tODP API version: %s\n", odp_version_api_str()); printf("\tODP implementation version: %s\n", odp_version_impl_str()); - /* call test executable init hook, if any */ - if (global_init_term.global_init_ptr && - ((*global_init_term.global_init_ptr)() != 0)) - return -1; - - CU_set_error_action(CUEA_ABORT); - - CU_initialize_registry(); - global_testsuites = testsuites; - cunit_register_suites(testsuites); - CU_set_fail_on_inactive(CU_FALSE); CU_basic_set_mode(CU_BRM_VERBOSE); CU_basic_run_tests(); @@ -221,3 +296,41 @@ int odp_cunit_run(odp_suiteinfo_t testsuites[]) return (ret) ? -1 : 0; } + +/* + * Update suites/tests previously registered via odp_cunit_register(). + * + * Note that this is intended for modifying the properties of already + * registered suites/tests. New suites/tests can only be registered via + * odp_cunit_register(). + */ +int odp_cunit_update(odp_suiteinfo_t testsuites[]) +{ + int ret = 0; + odp_suiteinfo_t *sinfo; + + for (sinfo = testsuites; sinfo->pName && ret == 0; sinfo++) + ret = cunit_update_suite(sinfo); + + return ret; +} + +/* + * Register test suites to be run via odp_cunit_run() + */ +int odp_cunit_register(odp_suiteinfo_t testsuites[]) +{ + /* call test executable init hook, if any */ + if (global_init_term.global_init_ptr && + ((*global_init_term.global_init_ptr)() != 0)) + return -1; + + CU_set_error_action(CUEA_ABORT); + + CU_initialize_registry(); + global_testsuites = testsuites; + cunit_register_suites(testsuites); + CU_set_fail_on_inactive(CU_FALSE); + + return 0; +} diff --git a/test/validation/common/odp_cunit_common.h b/test/validation/common/odp_cunit_common.h index 3421eea..c689054 100644 --- a/test/validation/common/odp_cunit_common.h +++ b/test/validation/common/odp_cunit_common.h @@ -68,12 +68,16 @@ typedef struct { int numthrds; /**< no of pthreads to create */ } pthrd_arg; +/* register suites to be run via odp_cunit_run() */ +int odp_cunit_register(odp_suiteinfo_t testsuites[]); +/* update tests previously registered via odp_cunit_register() */ +int odp_cunit_update(odp_suiteinfo_t testsuites[]); /* the function, called by module main(), to run the testsuites: */ -int odp_cunit_run(odp_suiteinfo_t testsuites[]); +int odp_cunit_run(void); /** create thread fro start_routine function */ -extern int odp_cunit_thread_create(void *func_ptr(void *), pthrd_arg *arg); -extern int odp_cunit_thread_exit(pthrd_arg *); +int odp_cunit_thread_create(void *func_ptr(void *), pthrd_arg *arg); +int odp_cunit_thread_exit(pthrd_arg *); /** * Global tests initialization/termination. diff --git a/test/validation/cpumask/cpumask.c b/test/validation/cpumask/cpumask.c index 37dee6a..bf5421e 100644 --- a/test/validation/cpumask/cpumask.c +++ b/test/validation/cpumask/cpumask.c @@ -101,5 +101,10 @@ odp_suiteinfo_t cpumask_suites[] = { int cpumask_main(void) { - return odp_cunit_run(cpumask_suites); + int ret = odp_cunit_register(cpumask_suites); + + if (ret == 0) + ret = odp_cunit_run(); + + return ret; } diff --git a/test/validation/crypto/crypto.c b/test/validation/crypto/crypto.c index b2f9d96..9229cab 100644 --- a/test/validation/crypto/crypto.c +++ b/test/validation/crypto/crypto.c @@ -94,7 +94,15 @@ int crypto_term(void) int crypto_main(void) { + int ret; + odp_cunit_register_global_init(crypto_init); odp_cunit_register_global_term(crypto_term); - return odp_cunit_run(crypto_suites); + + ret = odp_cunit_register(crypto_suites); + + if (ret == 0) + ret = odp_cunit_run(); + + return ret; } diff --git a/test/validation/errno/errno.c b/test/validation/errno/errno.c index 6196164..d0e2128 100644 --- a/test/validation/errno/errno.c +++ b/test/validation/errno/errno.c @@ -31,5 +31,10 @@ odp_suiteinfo_t errno_suites[] = { int errno_main(void) { - return odp_cunit_run(errno_suites); + int ret = odp_cunit_register(errno_suites); + + if (ret == 0) + ret = odp_cunit_run(); + + return ret; } diff --git a/test/validation/init/init.c b/test/validation/init/init.c index d5ec333..a8a5640 100644 --- a/test/validation/init/init.c +++ b/test/validation/init/init.c @@ -53,12 +53,19 @@ static void odp_init_abort(void) int init_main_abort(void) { + int ret; + /* prevent default ODP init: */ odp_cunit_register_global_init(NULL); odp_cunit_register_global_term(NULL); /* run the tests: */ - return odp_cunit_run(init_suites_abort); + ret = odp_cunit_register(init_suites_abort); + + if (ret == 0) + ret = odp_cunit_run(); + + return ret; } /* test ODP global init, with alternate log function */ @@ -109,12 +116,20 @@ static int odp_init_log(odp_log_level_e level __attribute__((unused)), int init_main_log(void) { + int ret; + /* prevent default ODP init: */ odp_cunit_register_global_init(NULL); odp_cunit_register_global_term(NULL); + /* register the tests: */ + ret = odp_cunit_register(init_suites_log); + /* run the tests: */ - return odp_cunit_run(init_suites_log); + if (ret == 0) + ret = odp_cunit_run(); + + return ret; } /* test normal ODP global init */ @@ -141,10 +156,18 @@ odp_suiteinfo_t init_suites_ok[] = { int init_main_ok(void) { + int ret; + /* prevent default ODP init: */ odp_cunit_register_global_init(NULL); odp_cunit_register_global_term(NULL); + /* register the tests: */ + ret = odp_cunit_register(init_suites_ok); + /* run the tests: */ - return odp_cunit_run(init_suites_ok); + if (ret == 0) + ret = odp_cunit_run(); + + return ret; } diff --git a/test/validation/packet/packet.c b/test/validation/packet/packet.c index 8a4f0a6..d9a543f 100644 --- a/test/validation/packet/packet.c +++ b/test/validation/packet/packet.c @@ -805,5 +805,10 @@ odp_suiteinfo_t packet_suites[] = { int packet_main(void) { - return odp_cunit_run(packet_suites); + int ret = odp_cunit_register(packet_suites); + + if (ret == 0) + ret = odp_cunit_run(); + + return ret; } diff --git a/test/validation/pktio/pktio.c b/test/validation/pktio/pktio.c index bfcaace..118fe89 100644 --- a/test/validation/pktio/pktio.c +++ b/test/validation/pktio/pktio.c @@ -908,5 +908,10 @@ odp_suiteinfo_t pktio_suites[] = { int pktio_main(void) { - return odp_cunit_run(pktio_suites); + int ret = odp_cunit_register(pktio_suites); + + if (ret == 0) + ret = odp_cunit_run(); + + return ret; } diff --git a/test/validation/pool/pool.c b/test/validation/pool/pool.c index 3de2714..bca210a 100644 --- a/test/validation/pool/pool.c +++ b/test/validation/pool/pool.c @@ -116,5 +116,10 @@ odp_suiteinfo_t pool_suites[] = { int pool_main(void) { - return odp_cunit_run(pool_suites); + int ret = odp_cunit_register(pool_suites); + + if (ret == 0) + ret = odp_cunit_run(); + + return ret; } diff --git a/test/validation/queue/queue.c b/test/validation/queue/queue.c index 7d6de54..98da2ec 100644 --- a/test/validation/queue/queue.c +++ b/test/validation/queue/queue.c @@ -137,5 +137,10 @@ odp_suiteinfo_t queue_suites[] = { int queue_main(void) { - return odp_cunit_run(queue_suites); + int ret = odp_cunit_register(queue_suites); + + if (ret == 0) + ret = odp_cunit_run(); + + return ret; } diff --git a/test/validation/random/random.c b/test/validation/random/random.c index a9a5a01..8ed5944 100644 --- a/test/validation/random/random.c +++ b/test/validation/random/random.c @@ -29,5 +29,10 @@ odp_suiteinfo_t random_suites[] = { int random_main(void) { - return odp_cunit_run(random_suites); + int ret = odp_cunit_register(random_suites); + + if (ret == 0) + ret = odp_cunit_run(); + + return ret; } diff --git a/test/validation/scheduler/scheduler.c b/test/validation/scheduler/scheduler.c index b8c92a0..5cddade 100644 --- a/test/validation/scheduler/scheduler.c +++ b/test/validation/scheduler/scheduler.c @@ -1147,5 +1147,10 @@ odp_suiteinfo_t scheduler_suites[] = { int scheduler_main(void) { - return odp_cunit_run(scheduler_suites); + int ret = odp_cunit_register(scheduler_suites); + + if (ret == 0) + ret = odp_cunit_run(); + + return ret; } diff --git a/test/validation/shmem/shmem.c b/test/validation/shmem/shmem.c index 41ec725..5524b5c 100644 --- a/test/validation/shmem/shmem.c +++ b/test/validation/shmem/shmem.c @@ -88,5 +88,10 @@ odp_suiteinfo_t shmem_suites[] = { int shmem_main(void) { - return odp_cunit_run(shmem_suites); + int ret = odp_cunit_register(shmem_suites); + + if (ret == 0) + ret = odp_cunit_run(); + + return ret; } diff --git a/test/validation/synchronizers/synchronizers.c b/test/validation/synchronizers/synchronizers.c index 49b7dad..7d8f6b0 100644 --- a/test/validation/synchronizers/synchronizers.c +++ b/test/validation/synchronizers/synchronizers.c @@ -1214,6 +1214,14 @@ odp_suiteinfo_t synchronizers_suites[] = { int synchronizers_main(void) { + int ret; + odp_cunit_register_global_init(synchronizers_init); - return odp_cunit_run(synchronizers_suites); + + ret = odp_cunit_register(synchronizers_suites); + + if (ret == 0) + ret = odp_cunit_run(); + + return ret; } diff --git a/test/validation/system/system.c b/test/validation/system/system.c index cf0ab0a..7dc2cc0 100644 --- a/test/validation/system/system.c +++ b/test/validation/system/system.c @@ -101,5 +101,10 @@ odp_suiteinfo_t system_suites[] = { int system_main(void) { - return odp_cunit_run(system_suites); + int ret = odp_cunit_register(system_suites); + + if (ret == 0) + ret = odp_cunit_run(); + + return ret; } diff --git a/test/validation/thread/thread.c b/test/validation/thread/thread.c index b86ebd3..9ba8322 100644 --- a/test/validation/thread/thread.c +++ b/test/validation/thread/thread.c @@ -125,5 +125,10 @@ odp_suiteinfo_t thread_suites[] = { int thread_main(void) { - return odp_cunit_run(thread_suites); + int ret = odp_cunit_register(thread_suites); + + if (ret == 0) + ret = odp_cunit_run(); + + return ret; } diff --git a/test/validation/time/time.c b/test/validation/time/time.c index f2c196c..41db0e9 100644 --- a/test/validation/time/time.c +++ b/test/validation/time/time.c @@ -75,5 +75,10 @@ odp_suiteinfo_t time_suites[] = { int time_main(void) { - return odp_cunit_run(time_suites); + int ret = odp_cunit_register(time_suites); + + if (ret == 0) + ret = odp_cunit_run(); + + return ret; } diff --git a/test/validation/timer/timer.c b/test/validation/timer/timer.c index 02398f7..645dc58 100644 --- a/test/validation/timer/timer.c +++ b/test/validation/timer/timer.c @@ -544,5 +544,10 @@ odp_suiteinfo_t timer_suites[] = { int timer_main(void) { - return odp_cunit_run(timer_suites); + int ret = odp_cunit_register(timer_suites); + + if (ret == 0) + ret = odp_cunit_run(); + + return ret; }