From patchwork Mon Dec 1 06:16:06 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "yan.songming" X-Patchwork-Id: 41744 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-ee0-f69.google.com (mail-ee0-f69.google.com [74.125.83.69]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 7521D24001 for ; Mon, 1 Dec 2014 06:16:40 +0000 (UTC) Received: by mail-ee0-f69.google.com with SMTP id d49sf6199463eek.4 for ; Sun, 30 Nov 2014 22:16:39 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:from:to:date:message-id: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=WogUWxGda2UgiDf8JCuImHi/wjk0aANDmP3zqscjR1E=; b=Vy0sxGn2Awnnvh2QLDaCORdWneZi1gzAi6dmpUqPn7P9OSKvdr6He9t4q6abR/8ZdT TJZWkkAWd1B0BCYuPMj6+TBhY4OIFM4rYktoTQi5UUSGgVMBggXJ/+P5DdXec/Oq8viF OozLL6htn7CTzpmmbBFwaHzYiEi6386MvGq+0OBiow1BVzQAFXG+7dt+t5sgGnrB1VvP dk6nUKwTRExF1RtzF60r/fdv501nzUmB1iydax6nUfHL8gBo9RmyN1b1M4/94TBemwv3 qp2mPzrRlGHD5P7Y6hxPjDoTR1YhCT24dAgHLzSBiBndq2ALVIa9cowwuhKGhpjxqyGv m7kQ== X-Gm-Message-State: ALoCoQkN3lw+XvN7vRKwQq9pKwVCOjKw6QV8t7cO54Hc0WGWX7W2aaqZh8Xc1iMcdvORqQPAra4l X-Received: by 10.180.24.131 with SMTP id u3mr4074534wif.4.1417414599717; Sun, 30 Nov 2014 22:16:39 -0800 (PST) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.20.2 with SMTP id j2ls259867lae.21.gmail; Sun, 30 Nov 2014 22:16:39 -0800 (PST) X-Received: by 10.153.7.170 with SMTP id dd10mr54481362lad.44.1417414599461; Sun, 30 Nov 2014 22:16:39 -0800 (PST) Received: from mail-la0-f45.google.com (mail-la0-f45.google.com. [209.85.215.45]) by mx.google.com with ESMTPS id ui10si16683317lbb.62.2014.11.30.22.16.39 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sun, 30 Nov 2014 22:16:39 -0800 (PST) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.45 as permitted sender) client-ip=209.85.215.45; Received: by mail-la0-f45.google.com with SMTP id gq15so8249156lab.18 for ; Sun, 30 Nov 2014 22:16:39 -0800 (PST) X-Received: by 10.152.87.100 with SMTP id w4mr738337laz.71.1417414599343; Sun, 30 Nov 2014 22:16:39 -0800 (PST) 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.184.201 with SMTP id ew9csp233647lbc; Sun, 30 Nov 2014 22:16:37 -0800 (PST) X-Received: by 10.224.165.71 with SMTP id h7mr23788778qay.46.1417414597149; Sun, 30 Nov 2014 22:16:37 -0800 (PST) Received: from ip-10-35-177-41.ec2.internal (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTPS id cf7si19572247qcb.20.2014.11.30.22.16.35 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Sun, 30 Nov 2014 22:16:37 -0800 (PST) Received-SPF: none (google.com: lng-odp-bounces@lists.linaro.org does not designate permitted sender hosts) client-ip=54.225.227.206; Received: from localhost ([127.0.0.1] helo=ip-10-35-177-41.ec2.internal) by ip-10-35-177-41.ec2.internal with esmtp (Exim 4.76) (envelope-from ) id 1XvKHi-0006ho-41; Mon, 01 Dec 2014 06:16:34 +0000 Received: from mail-pa0-f53.google.com ([209.85.220.53]) by ip-10-35-177-41.ec2.internal with esmtp (Exim 4.76) (envelope-from ) id 1XvKHb-0006hj-EG for lng-odp@lists.linaro.org; Mon, 01 Dec 2014 06:16:27 +0000 Received: by mail-pa0-f53.google.com with SMTP id kq14so10423527pab.12 for ; Sun, 30 Nov 2014 22:16:22 -0800 (PST) X-Received: by 10.68.246.164 with SMTP id xx4mr97226855pbc.64.1417414581987; Sun, 30 Nov 2014 22:16:21 -0800 (PST) Received: from localhost.localdomain ([210.51.195.9]) by mx.google.com with ESMTPSA id tr8sm3700876pbc.30.2014.11.30.22.16.18 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 30 Nov 2014 22:16:20 -0800 (PST) From: Yan Sonming To: lng-odp@lists.linaro.org Date: Mon, 1 Dec 2014 01:16:06 -0500 Message-Id: <1417414566-11985-1-git-send-email-yan.songming@linaro.org> X-Mailer: git-send-email 1.8.3.1 X-Topics: patch Subject: [lng-odp] [PATCH] validation: add odp_version test X-BeenThere: lng-odp@lists.linaro.org X-Mailman-Version: 2.1.14 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-bounces@lists.linaro.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: yan.songming@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.45 as permitted sender) smtp.mail=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 odp_version.c to test api of odp_version.h. Signed-off-by: Yan Songming --- test/validation/.gitignore | 1 + test/validation/Makefile.am | 4 ++- test/validation/odp_version.c | 70 +++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 74 insertions(+), 1 deletion(-) create mode 100644 test/validation/odp_version.c diff --git a/test/validation/.gitignore b/test/validation/.gitignore index 696cf0a..dbf590c 100644 --- a/test/validation/.gitignore +++ b/test/validation/.gitignore @@ -3,3 +3,4 @@ odp_init odp_queue odp_crypto +odp_version diff --git a/test/validation/Makefile.am b/test/validation/Makefile.am index 0b831d0..f43554d 100644 --- a/test/validation/Makefile.am +++ b/test/validation/Makefile.am @@ -6,11 +6,12 @@ AM_LDFLAGS += -L$(CUNIT_PATH)/lib -static -lcunit if ODP_CUNIT_ENABLED TESTS = ${bin_PROGRAMS} check_PROGRAMS = ${bin_PROGRAMS} -bin_PROGRAMS = odp_init odp_queue odp_crypto +bin_PROGRAMS = odp_init odp_queue odp_crypto odp_version odp_init_LDFLAGS = $(AM_LDFLAGS) odp_queue_LDFLAGS = $(AM_LDFLAGS) odp_crypto_CFLAGS = $(AM_CFLAGS) -I$(srcdir)/crypto odp_crypto_LDFLAGS = $(AM_LDFLAGS) +odp_version_LDFLAGS = $(AM_LDFLAGS) endif dist_odp_init_SOURCES = odp_init.c @@ -18,3 +19,4 @@ dist_odp_queue_SOURCES = odp_queue.c dist_odp_crypto_SOURCES = crypto/odp_crypto_test_async_inp.c \ crypto/odp_crypto_test_sync_inp.c \ odp_crypto.c +dist_odp_version_SOURCES = odp_version.c diff --git a/test/validation/odp_version.c b/test/validation/odp_version.c new file mode 100644 index 0000000..b5c0a16 --- /dev/null +++ b/test/validation/odp_version.c @@ -0,0 +1,70 @@ +/* Copyright (c) 2014, Linaro Limited + * All rights reserved. + * + * SPDX-License-Identifier: BSD-3-Clause + */ + +#include "odp.h" +#include "CUnit/Basic.h" + +static void test_odp_version_impl_str(void) +{ + const char *impl; + + impl = odp_version_impl_str(); + CU_ASSERT(strlen(impl) > 0) +} + +static void test_odp_version_api_str(void) +{ + const char *api; + + api = odp_version_api_str(); + CU_ASSERT(strlen(api) > 0) +} + +static int init_suite(void) +{ + printf("\tODP API version: %s\n", odp_version_api_str()); + printf("\tODP implementation version: %s\n", odp_version_impl_str()); + + return 0; +} + +CU_TestInfo test_odp_version[] = { + {"odp_version_impl_str", test_odp_version_impl_str}, + {"odp_version_api_str", test_odp_version_api_str}, + CU_TEST_INFO_NULL, +}; + +CU_SuiteInfo suites[] = { + {"odp_system", init_suite, NULL, NULL, NULL, test_odp_version}, + CU_SUITE_INFO_NULL, +}; + +int main(void) +{ + int ret; + + if (odp_init_global(NULL, NULL)) { + printf("ODP global init failed.\n"); + return -1; + } + odp_init_local(); + + CU_set_error_action(CUEA_ABORT); + + CU_initialize_registry(); + CU_register_suites(suites); + CU_basic_set_mode(CU_BRM_VERBOSE); + CU_basic_run_tests(); + + ret = CU_get_number_of_failure_records(); + + CU_cleanup_registry(); + + odp_term_local(); + odp_term_global(); + + return ret; +}