From patchwork Tue Feb 27 20:00:29 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Github ODP bot X-Patchwork-Id: 129858 Delivered-To: patch@linaro.org Received: by 10.46.66.2 with SMTP id p2csp221662lja; Tue, 27 Feb 2018 12:13:52 -0800 (PST) X-Google-Smtp-Source: AG47ELsP8QqgtDUdattHxm/RFerSynoL/ERzeqFMh44duX7/xAkuIIuotq6VBJekV7vD/1Ye2eKC X-Received: by 10.237.49.43 with SMTP id 40mr20055715qtg.260.1519762432080; Tue, 27 Feb 2018 12:13:52 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519762432; cv=none; d=google.com; s=arc-20160816; b=QnjfElgC6fRnNpu/l4L80dSPzquSZ8ABW3OuzKAwK6kvtJ1yDwRXAHMkFcLKUVD3tr y5AMsSk3SjmV98CX8N8l0UhKGLlDoEwyg/RsxL0L1/1grITvLsfoyjNKMzF5oIOxvxTv NAzrefCzdxFbHsLaMBgef3VX3LUhdyJrAfWj5IVa+g4Curlot1///veCw5UEtvuc1NE1 IPqrJbke6uOuqFnA2Rl/ISPn5HJj2NNzKeZ9HOoKkCnBDXfEP6uj+LLt49XZEIfn9JdK 2ly0rrCVTc2dzdG2F4IwOJwEWPNdMBpDNIftdyxgZx60aeQpM1LsCTTiH8bsJpJkFfOm 6XiQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject:github-pr-num :references:in-reply-to:message-id:date:to:from:delivered-to :arc-authentication-results; bh=wqtrLSMBd9YgdYy3UrCmhDGOnHr15GrfKi0RYYTDdbw=; b=bPHfWeebguYKsyRfYx1yqjx/TT/MsrLYz/rg9GOI44UUSUXf6jbcZdC35wVpm7WQ1d rykfUTXDTzzw79JENMnXxtf9E43IvcEkC7uzB1NYRM0NKJS52z4r/dOgN9Du9NVKCVJ6 fvkcI1zfCOL1jZilk6f7EN41Xi3UQCsnF1QiBBhC0qH6hDGF6clqvmJKY/KC5T/PVOmE 8GRTQm6LyjqqJqMZdra69wvzRdvpoY+KDJ6z/NnpB01rkmx1aoq35LBO/YHRiyGcxSCi gyzL/P6I/JrnKhdemJ5AcFXWpmzVmgwChozF67YfLsAXMagHDaZ6owzmjT38eZop8BSS FaMA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.197.127.237 as permitted sender) smtp.mailfrom=lng-odp-bounces@lists.linaro.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=yandex.ru Return-Path: Received: from lists.linaro.org (ec2-54-197-127-237.compute-1.amazonaws.com. [54.197.127.237]) by mx.google.com with ESMTP id u124si657490qkf.327.2018.02.27.12.13.51; Tue, 27 Feb 2018 12:13:52 -0800 (PST) Received-SPF: pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.197.127.237 as permitted sender) client-ip=54.197.127.237; Authentication-Results: mx.google.com; spf=pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.197.127.237 as permitted sender) smtp.mailfrom=lng-odp-bounces@lists.linaro.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=yandex.ru Received: by lists.linaro.org (Postfix, from userid 109) id BE9B661736; Tue, 27 Feb 2018 20:13:51 +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,FREEMAIL_FROM, RCVD_IN_DNSWL_LOW 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 DC4366094D; Tue, 27 Feb 2018 20:02:23 +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 B1604617C3; Tue, 27 Feb 2018 20:02:18 +0000 (UTC) Received: from forward106o.mail.yandex.net (forward106o.mail.yandex.net [37.140.190.187]) by lists.linaro.org (Postfix) with ESMTPS id 14F816094D for ; Tue, 27 Feb 2018 20:00:34 +0000 (UTC) Received: from mxback3o.mail.yandex.net (mxback3o.mail.yandex.net [IPv6:2a02:6b8:0:1a2d::1d]) by forward106o.mail.yandex.net (Yandex) with ESMTP id E5E88783297 for ; Tue, 27 Feb 2018 23:00:32 +0300 (MSK) Received: from smtp1j.mail.yandex.net (smtp1j.mail.yandex.net [2a02:6b8:0:801::ab]) by mxback3o.mail.yandex.net (nwsmtp/Yandex) with ESMTP id 6eMvBSABIY-0WniQFc7; Tue, 27 Feb 2018 23:00:32 +0300 Received: by smtp1j.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id WjIPFWiFbg-0WOSbisB; Tue, 27 Feb 2018 23:00:32 +0300 (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (Client certificate not present) From: Github ODP bot To: lng-odp@lists.linaro.org Date: Tue, 27 Feb 2018 23:00:29 +0300 Message-Id: <1519761631-20986-2-git-send-email-odpbot@yandex.ru> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1519761631-20986-1-git-send-email-odpbot@yandex.ru> References: <1519761631-20986-1-git-send-email-odpbot@yandex.ru> Github-pr-num: 496 Subject: [lng-odp] [PATCH v10 1/3] example: generator: move script back to example directory 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" From: Dmitry Eremin-Solenikov Move script back to examples dir, so that platform other than linux-generic might be able to run this test/example, if they choose to implement null: PktIO type. Signed-off-by: Dmitry Eremin-Solenikov --- /** Email created from pull request 496 (lumag:tests-fix-2) ** https://github.com/Linaro/odp/pull/496 ** Patch: https://github.com/Linaro/odp/pull/496.patch ** Base sha: 3984ba4cd16a02e3fa98ccd432a06663de3fa993 ** Merge commit sha: f3d707b1140a4100cbdd6cefce48a89bee22b899 **/ example/generator/Makefile.am | 8 ++++ example/generator/generator_null_test.sh | 23 +++++++++++ platform/linux-generic/m4/configure.m4 | 2 - platform/linux-generic/test/Makefile.am | 4 -- platform/linux-generic/test/example/Makefile.am | 1 - .../test/example/generator/Makefile.am | 4 -- .../test/example/generator/generator_run.sh | 45 ---------------------- 7 files changed, 31 insertions(+), 56 deletions(-) create mode 100755 example/generator/generator_null_test.sh delete mode 100644 platform/linux-generic/test/example/Makefile.am delete mode 100644 platform/linux-generic/test/example/generator/Makefile.am delete mode 100755 platform/linux-generic/test/example/generator/generator_run.sh diff --git a/example/generator/Makefile.am b/example/generator/Makefile.am index 7deeef406..112ebbf63 100644 --- a/example/generator/Makefile.am +++ b/example/generator/Makefile.am @@ -3,3 +3,11 @@ include $(top_srcdir)/example/Makefile.inc bin_PROGRAMS = odp_generator odp_generator_SOURCES = odp_generator.c + +TEST_EXTENSIONS = .sh + +if test_example +TESTS = generator_null_test.sh +TESTS_ENVIRONMENT += ODP_PLATFORM=$(with_platform) +endif +EXTRA_DIST = generator_null_test.sh diff --git a/example/generator/generator_null_test.sh b/example/generator/generator_null_test.sh new file mode 100755 index 000000000..a598ffd92 --- /dev/null +++ b/example/generator/generator_null_test.sh @@ -0,0 +1,23 @@ +#!/bin/bash +# +# Copyright (c) 2018, Linaro Limited +# All rights reserved. +# +# SPDX-License-Identifier: BSD-3-Clause +# + +if [ -n "${ODP_PLATFORM}" -a "x${ODP_PLATFORM}" != "xlinux-generic" ] +then + echo "null pktio might be unsupported on this platform, skipping" + exit 77 +fi + +./odp_generator${EXEEXT} -w 1 -n 1 -I null:0 -m u +STATUS=$? + +if [ "$STATUS" -ne 0 ]; then + echo "Error: status was: $STATUS, expected 0" + exit 1 +fi + +exit 0 diff --git a/platform/linux-generic/m4/configure.m4 b/platform/linux-generic/m4/configure.m4 index 935894b8c..7fa3652e2 100644 --- a/platform/linux-generic/m4/configure.m4 +++ b/platform/linux-generic/m4/configure.m4 @@ -19,8 +19,6 @@ AM_CONDITIONAL([PLATFORM_IS_LINUX_GENERIC], AC_CONFIG_FILES([platform/linux-generic/Makefile platform/linux-generic/libodp-linux.pc platform/linux-generic/test/Makefile - platform/linux-generic/test/example/Makefile - platform/linux-generic/test/example/generator/Makefile platform/linux-generic/test/validation/api/shmem/Makefile platform/linux-generic/test/validation/api/pktio/Makefile platform/linux-generic/test/mmap_vlan_ins/Makefile diff --git a/platform/linux-generic/test/Makefile.am b/platform/linux-generic/test/Makefile.am index e317ff736..99934099a 100644 --- a/platform/linux-generic/test/Makefile.am +++ b/platform/linux-generic/test/Makefile.am @@ -3,10 +3,6 @@ TESTS_ENVIRONMENT += TEST_DIR=${top_builddir}/test/validation SUBDIRS = performance -if test_example -SUBDIRS += example -endif - if test_vald TESTS = validation/api/pktio/pktio_run.sh \ validation/api/pktio/pktio_run_tap.sh \ diff --git a/platform/linux-generic/test/example/Makefile.am b/platform/linux-generic/test/example/Makefile.am deleted file mode 100644 index 41d287522..000000000 --- a/platform/linux-generic/test/example/Makefile.am +++ /dev/null @@ -1 +0,0 @@ -SUBDIRS = generator diff --git a/platform/linux-generic/test/example/generator/Makefile.am b/platform/linux-generic/test/example/generator/Makefile.am deleted file mode 100644 index 3bdfdc69c..000000000 --- a/platform/linux-generic/test/example/generator/Makefile.am +++ /dev/null @@ -1,4 +0,0 @@ -TESTS_ENVIRONMENT = EXAMPLE_DIR=${top_builddir}/example/generator - -TESTS = generator_run.sh -EXTRA_DIST = generator_run.sh diff --git a/platform/linux-generic/test/example/generator/generator_run.sh b/platform/linux-generic/test/example/generator/generator_run.sh deleted file mode 100755 index 85368d2eb..000000000 --- a/platform/linux-generic/test/example/generator/generator_run.sh +++ /dev/null @@ -1,45 +0,0 @@ -#!/bin/bash -# -# Copyright (c) 2018-2018, Linaro Limited -# All rights reserved. -# -# SPDX-License-Identifier: BSD-3-Clause -# - -# directory where platform test sources are, including scripts -TEST_SRC_DIR=$(dirname $0) - -# exit codes expected by automake for skipped tests -TEST_SKIPPED=77 - -# directories where binary can be found: -# -in the validation dir when running make check (intree or out of tree) -# -in the script directory, when running after 'make install', or -# -in the validation when running standalone intree. -# -in the current directory. -# running stand alone out of tree requires setting PATH -PATH="${EXAMPLE_DIR}/:$PATH" -PATH="`pwd`/example/generator/:$PATH" -PATH="$(dirname $0)/../../../../../example/generator:$PATH" -PATH=".:$PATH" - -bin_path=$(which odp_generator${EXEEXT}) -if [ -x "$bin_path" ] ; then - echo "running with odp_generator: $bin_path" -else - echo "cannot odp_generator: please set you PATH for it." - pwd - echo $PATH - exit 1 -fi - - -odp_generator${EXEEXT} -w 1 -n 1 -I null:0 -m u -STATUS=$? - -if [ "$STATUS" -ne 0 ]; then - echo "Error: status was: $STATUS, expected 0" - exit 1 -fi - -exit 0 From patchwork Tue Feb 27 20:00:30 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Github ODP bot X-Patchwork-Id: 129859 Delivered-To: patch@linaro.org Received: by 10.46.66.2 with SMTP id p2csp222411lja; Tue, 27 Feb 2018 12:14:46 -0800 (PST) X-Google-Smtp-Source: AG47ELvE7h0ost+niVxndHImYAr32R5XCFsXedpW7mx4A7cRtT6wf3jmoB+IvvUa7Ozd2s8c6SlG X-Received: by 10.237.49.134 with SMTP id 6mr24551409qth.19.1519762486742; Tue, 27 Feb 2018 12:14:46 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519762486; cv=none; d=google.com; s=arc-20160816; b=J6Kt0peJWD5Su8sX+CDP4D3EPC4+w7hNFK4IULQk2LDYtH7Vf6ww68vsu+whyAgkYQ p3IeASona5irxe5PQfIwiEZTPdedOWlp92AQkr7chftippHMz/hWSkSbdNf62xjKfiXm 4ujXY/K4+gtbIYoQbeeKrP7hhiC1vNcgxBpc2HXc5UPNciLzNJv1wAYm5sAdb/21Bzrd abZl3N4GIuSUlj1XsOJRH1fTeKNI4bx3m5mTBvIqoUJT4qZjz0IvsUDELtN/ufZkJpD5 J7Oh2K3p/jCb3cdtVkwvrUfSWyPo5SJ2aTLtZLmr0joFamJzAX/PcztccInuqQ41F8n6 R/jQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject:github-pr-num :references:in-reply-to:message-id:date:to:from:delivered-to :arc-authentication-results; bh=GAg4tqJ3DmoB5lJV4O1MNpleb3LO5R7l7hab/8IUi00=; b=TABXuo40xfdhh8eUteny1xCerFHraC2uer/2Gpd81TuYEXPWfhwvud93x6OGXnrGal cbLS4HmyOm0CIB1hL77BbKgRZM9JPK+pcYFPqx80cv/TBsGqXRlHGFHkxrZ/H3o0ErW/ TiS2JwG1QA6qiiAyrxLFLyd6MEmR7zek8fmklj5xvbxzhsY/SLFvc4C/xkIBJt4+shCM OLk1Pz6chz2wG/ArUnGyIYwaqf8eMlIt7+w3+sSejFOxzX67ulACrvASQtrMeQ+t6Cj5 rldvvpnITPxHerScsQDxS9477VIj7DEzzIzvVT+3xo1IamOvq2/MhulACekOEoh6uyMd 8SWA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.197.127.237 as permitted sender) smtp.mailfrom=lng-odp-bounces@lists.linaro.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=yandex.ru Return-Path: Received: from lists.linaro.org (ec2-54-197-127-237.compute-1.amazonaws.com. [54.197.127.237]) by mx.google.com with ESMTP id r39si1143318qkh.429.2018.02.27.12.14.46; Tue, 27 Feb 2018 12:14:46 -0800 (PST) Received-SPF: pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.197.127.237 as permitted sender) client-ip=54.197.127.237; Authentication-Results: mx.google.com; spf=pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.197.127.237 as permitted sender) smtp.mailfrom=lng-odp-bounces@lists.linaro.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=yandex.ru Received: by lists.linaro.org (Postfix, from userid 109) id 6EF3361735; Tue, 27 Feb 2018 20:14:46 +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,FREEMAIL_FROM, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H2 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 3279861763; Tue, 27 Feb 2018 20:02:27 +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 3E7CD617A9; Tue, 27 Feb 2018 20:02:19 +0000 (UTC) Received: from forward100j.mail.yandex.net (forward100j.mail.yandex.net [5.45.198.240]) by lists.linaro.org (Postfix) with ESMTPS id EF76F60597 for ; Tue, 27 Feb 2018 20:00:34 +0000 (UTC) Received: from mxback1g.mail.yandex.net (mxback1g.mail.yandex.net [IPv6:2a02:6b8:0:1472:2741:0:8b7:162]) by forward100j.mail.yandex.net (Yandex) with ESMTP id 883975D82F12 for ; Tue, 27 Feb 2018 23:00:33 +0300 (MSK) Received: from smtp1j.mail.yandex.net (smtp1j.mail.yandex.net [2a02:6b8:0:801::ab]) by mxback1g.mail.yandex.net (nwsmtp/Yandex) with ESMTP id xxKyQvCj0x-0XKGE7R4; Tue, 27 Feb 2018 23:00:33 +0300 Received: by smtp1j.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id WjIPFWiFbg-0WOeONM4; Tue, 27 Feb 2018 23:00:32 +0300 (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (Client certificate not present) From: Github ODP bot To: lng-odp@lists.linaro.org Date: Tue, 27 Feb 2018 23:00:30 +0300 Message-Id: <1519761631-20986-3-git-send-email-odpbot@yandex.ru> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1519761631-20986-1-git-send-email-odpbot@yandex.ru> References: <1519761631-20986-1-git-send-email-odpbot@yandex.ru> Github-pr-num: 496 Subject: [lng-odp] [PATCH v10 2/3] build: change order of subdirectories 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" From: Dmitry Eremin-Solenikov Descend into examples after building/running tests. It is quite logical that first we build validation & performance tests, then we build platform tests, helper tests and only after that descend into examples. Signed-off-by: Dmitry Eremin-Solenikov --- /** Email created from pull request 496 (lumag:tests-fix-2) ** https://github.com/Linaro/odp/pull/496 ** Patch: https://github.com/Linaro/odp/pull/496.patch ** Base sha: 3984ba4cd16a02e3fa98ccd432a06663de3fa993 ** Merge commit sha: f3d707b1140a4100cbdd6cefce48a89bee22b899 **/ Makefile.am | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Makefile.am b/Makefile.am index dab8ca8c6..1e1988451 100644 --- a/Makefile.am +++ b/Makefile.am @@ -12,11 +12,11 @@ SUBDIRS = \ include \ $(PLATFORM_DIR) \ helper \ - helper/test \ doc \ - example . \ test \ - $(PLATFORM_TEST_DIR) + $(PLATFORM_TEST_DIR) \ + helper/test \ + example @DX_RULES@ From patchwork Tue Feb 27 20:00:31 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Github ODP bot X-Patchwork-Id: 129860 Delivered-To: patch@linaro.org Received: by 10.46.66.2 with SMTP id p2csp223033lja; Tue, 27 Feb 2018 12:15:26 -0800 (PST) X-Google-Smtp-Source: AG47ELsvOQbd/w5nDp4Kssgqj/9AtXUWbC1DWxuRbDmy//lk9IMjvWuPmOwWWouUPeEjKWHQEyYy X-Received: by 10.200.19.7 with SMTP id e7mr9615669qtj.204.1519762525901; Tue, 27 Feb 2018 12:15:25 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519762525; cv=none; d=google.com; s=arc-20160816; b=XurCBt529kVI5SIi/hJZlARfQ2xVyStuMH7DAcz1qMqUhXthj+X2zfl3oWuQOffZ98 zktreNLIkMhrMI54kk3ql9fegA4r+7GuT1sf529wofvv7ObyHlytJi/3L1OYzdWz25bb xLm2iEyIFEm8RbwRZcw9j7b2itS/+RyaWE0a14dVYZGm4bi991r5ZEBfle+wVQkcnUIL F+Nu+A4iWvYWc6qsmErq89HIqgZAO84z4kjVBeyJVBRioZxXu7I6enw1x+RmH33jY82d TKEGtSAAmzNrHYWB+T1z0/wtD0MhfPKbcNDv9vM7l+ySSnQV+waEkHPhoOfT4P/dKgWf J7CQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject:github-pr-num :references:in-reply-to:message-id:date:to:from:delivered-to :arc-authentication-results; bh=fZK2crtyVaacGFHCYiKELQIc6z2AXvnOFhkGJ9GLoyg=; b=YTcn4UntNY3wyFF8YzLzIvSryUpE/eHa2QREhGjE/U1XuUtA7SDyumHShdTN4bOKyw 5qHardrcC7jq+3tOi14LbIrb0uKNfqa1xqczG3xX4BQIgXP2qpI44FQyCE8wR6FJeJqf 52Pd1ekPW4t+cshQ/T2miyIY1ulqf+rycV2PPhYc3RmrJtkK6XAjl1SDwoYWYGb4XPUI EcIXm+UCa57/GxOdBUptEghaEvXOHRQmtbfS5rwD1xTS8lL0IJLRC6FuamM07UvTH1sz xbbRPENsLsGFwBqXeaX4MDZRsGiBoVUzVvAIytw9X/1PWH4YtZKu3b/Caaf3BldnCl4D hOUw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.197.127.237 as permitted sender) smtp.mailfrom=lng-odp-bounces@lists.linaro.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=yandex.ru Return-Path: Received: from lists.linaro.org (ec2-54-197-127-237.compute-1.amazonaws.com. [54.197.127.237]) by mx.google.com with ESMTP id w10si332515qkg.351.2018.02.27.12.15.25; Tue, 27 Feb 2018 12:15:25 -0800 (PST) Received-SPF: pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.197.127.237 as permitted sender) client-ip=54.197.127.237; Authentication-Results: mx.google.com; spf=pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.197.127.237 as permitted sender) smtp.mailfrom=lng-odp-bounces@lists.linaro.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=yandex.ru Received: by lists.linaro.org (Postfix, from userid 109) id 8C54061760; Tue, 27 Feb 2018 20:15:25 +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,FREEMAIL_FROM, RCVD_IN_DNSWL_LOW 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 841A5617C5; Tue, 27 Feb 2018 20:02:33 +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 DB4C4617A9; Tue, 27 Feb 2018 20:02:21 +0000 (UTC) Received: from forward102p.mail.yandex.net (forward102p.mail.yandex.net [77.88.28.102]) by lists.linaro.org (Postfix) with ESMTPS id 3F73A60634 for ; Tue, 27 Feb 2018 20:00:35 +0000 (UTC) Received: from mxback9j.mail.yandex.net (mxback9j.mail.yandex.net [IPv6:2a02:6b8:0:1619::112]) by forward102p.mail.yandex.net (Yandex) with ESMTP id 2FFC74303941 for ; Tue, 27 Feb 2018 23:00:34 +0300 (MSK) Received: from smtp1j.mail.yandex.net (smtp1j.mail.yandex.net [2a02:6b8:0:801::ab]) by mxback9j.mail.yandex.net (nwsmtp/Yandex) with ESMTP id 1ruW9Dvzw2-0YJa9Zve; Tue, 27 Feb 2018 23:00:34 +0300 Received: by smtp1j.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id WjIPFWiFbg-0XOGY4Rs; Tue, 27 Feb 2018 23:00:33 +0300 (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (Client certificate not present) From: Github ODP bot To: lng-odp@lists.linaro.org Date: Tue, 27 Feb 2018 23:00:31 +0300 Message-Id: <1519761631-20986-4-git-send-email-odpbot@yandex.ru> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1519761631-20986-1-git-send-email-odpbot@yandex.ru> References: <1519761631-20986-1-git-send-email-odpbot@yandex.ru> Github-pr-num: 496 Subject: [lng-odp] [PATCH v10 3/3] validation: init: remove "library" file 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" From: Dmitry Eremin-Solenikov Split init.c/init.h files into individual tests, simplifying setup. Signed-off-by: Dmitry Eremin-Solenikov --- /** Email created from pull request 496 (lumag:tests-fix-2) ** https://github.com/Linaro/odp/pull/496 ** Patch: https://github.com/Linaro/odp/pull/496.patch ** Base sha: 3984ba4cd16a02e3fa98ccd432a06663de3fa993 ** Merge commit sha: f3d707b1140a4100cbdd6cefce48a89bee22b899 **/ test/validation/api/init/Makefile.am | 6 +- test/validation/api/init/init.c | 190 ----------------------------- test/validation/api/init/init.h | 32 ----- test/validation/api/init/init_main_abort.c | 55 ++++++++- test/validation/api/init/init_main_log.c | 76 +++++++++++- test/validation/api/init/init_main_ok.c | 45 ++++++- 6 files changed, 173 insertions(+), 231 deletions(-) delete mode 100644 test/validation/api/init/init.c delete mode 100644 test/validation/api/init/init.h diff --git a/test/validation/api/init/Makefile.am b/test/validation/api/init/Makefile.am index 2d0661431..5af2e00bc 100644 --- a/test/validation/api/init/Makefile.am +++ b/test/validation/api/init/Makefile.am @@ -4,6 +4,6 @@ include ../Makefile.inc # following each other: therefore 3 separate binaries are # created, each containing its ODP init test. test_PROGRAMS = init_main_abort init_main_log init_main_ok -init_main_abort_SOURCES = init_main_abort.c init.c init.h -init_main_log_SOURCES = init_main_log.c init.c init.h -init_main_ok_SOURCES = init_main_ok.c init.c init.h +init_main_abort_SOURCES = init_main_abort.c +init_main_log_SOURCES = init_main_log.c +init_main_ok_SOURCES = init_main_ok.c diff --git a/test/validation/api/init/init.c b/test/validation/api/init/init.c deleted file mode 100644 index 39023bd65..000000000 --- a/test/validation/api/init/init.c +++ /dev/null @@ -1,190 +0,0 @@ -/* Copyright (c) 2015-2018, Linaro Limited - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#include "config.h" - -#include -#include -#include -#include -#include "init.h" - -/* flag set when the replacement logging function is used */ -int replacement_logging_used; - -/* replacement abort function: */ -static void odp_init_abort(void) ODP_NORETURN; - -/* replacement log function: */ -ODP_PRINTF_FORMAT(2, 3) -static int odp_init_log(odp_log_level_t level, const char *fmt, ...); - -/* test ODP global init, with alternate abort function */ -void init_test_odp_init_global_replace_abort(void) -{ - int status; - odp_init_t init_data; - odp_instance_t instance; - - odp_init_param_init(&init_data); - init_data.abort_fn = &odp_init_abort; - - status = odp_init_global(&instance, &init_data, NULL); - CU_ASSERT_FATAL(status == 0); - - status = odp_term_global(instance); - CU_ASSERT(status == 0); -} - -odp_testinfo_t init_suite_abort[] = { - ODP_TEST_INFO(init_test_odp_init_global_replace_abort), - ODP_TEST_INFO_NULL, -}; - -odp_suiteinfo_t init_suites_abort[] = { - {"Init", NULL, NULL, init_suite_abort}, - ODP_SUITE_INFO_NULL, -}; - -static void odp_init_abort(void) -{ - abort(); -} - -int init_main_abort(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); - - /* run the tests: */ - ret = odp_cunit_register(init_suites_abort); - - if (ret == 0) - ret = odp_cunit_run(); - - return ret; -} - -/* test ODP global init, with alternate log function */ -void init_test_odp_init_global_replace_log(void) -{ - int status; - odp_init_t init_data; - odp_instance_t instance; - - odp_init_param_init(&init_data); - init_data.log_fn = &odp_init_log; - - replacement_logging_used = 0; - - status = odp_init_global(&instance, &init_data, NULL); - CU_ASSERT_FATAL(status == 0); - - CU_ASSERT_TRUE(replacement_logging_used || ODP_DEBUG_PRINT == 0); - - status = odp_term_global(instance); - CU_ASSERT(status == 0); -} - -odp_testinfo_t init_suite_log[] = { - ODP_TEST_INFO(init_test_odp_init_global_replace_log), - ODP_TEST_INFO_NULL, -}; - -odp_suiteinfo_t init_suites_log[] = { - {"Init", NULL, NULL, init_suite_log}, - ODP_SUITE_INFO_NULL, -}; - -static int odp_init_log(odp_log_level_t level __attribute__((unused)), - const char *fmt, ...) -{ - va_list args; - int r; - - /* just set a flag to be sure the replacement fn was used */ - replacement_logging_used = 1; - - va_start(args, fmt); - r = vfprintf(stderr, fmt, args); - va_end(args); - - return r; -} - -int init_main_log(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(init_suites_log); - - /* run the tests: */ - if (ret == 0) - ret = odp_cunit_run(); - - return ret; -} - -/* test normal ODP global init */ -void init_test_odp_init_global(void) -{ - int status; - odp_instance_t instance; - - status = odp_init_global(&instance, NULL, NULL); - CU_ASSERT_FATAL(status == 0); - - status = odp_term_global(instance); - CU_ASSERT(status == 0); -} - -odp_testinfo_t init_suite_ok[] = { - ODP_TEST_INFO(init_test_odp_init_global), - ODP_TEST_INFO_NULL, -}; - -odp_suiteinfo_t init_suites_ok[] = { - {"Init", NULL, NULL, init_suite_ok}, - ODP_SUITE_INFO_NULL, -}; - -int init_main_ok(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(init_suites_ok); - - /* run the tests: */ - if (ret == 0) - ret = odp_cunit_run(); - - return ret; -} diff --git a/test/validation/api/init/init.h b/test/validation/api/init/init.h deleted file mode 100644 index c5bcf9a23..000000000 --- a/test/validation/api/init/init.h +++ /dev/null @@ -1,32 +0,0 @@ -/* Copyright (c) 2015-2018, Linaro Limited - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#ifndef _ODP_TEST_INIT_H_ -#define _ODP_TEST_INIT_H_ - -#include - -/* test functions: */ -void init_test_odp_init_global_replace_abort(void); -void init_test_odp_init_global_replace_log(void); -void init_test_odp_init_global(void); - -/* test arrays: */ -extern odp_testinfo_t init_suite_abort[]; -extern odp_testinfo_t init_suite_log[]; -extern odp_testinfo_t init_suite_ok[]; - -/* test registry: */ -extern odp_suiteinfo_t init_suites_abort[]; -extern odp_suiteinfo_t init_suites_log[]; -extern odp_suiteinfo_t init_suites_ok[]; - -/* main test program: */ -int init_main_abort(int argc, char *argv[]); -int init_main_log(int argc, char *argv[]); -int init_main_ok(int argc, char *argv[]); - -#endif diff --git a/test/validation/api/init/init_main_abort.c b/test/validation/api/init/init_main_abort.c index 8702a0a79..339fba1d0 100644 --- a/test/validation/api/init/init_main_abort.c +++ b/test/validation/api/init/init_main_abort.c @@ -6,9 +6,60 @@ #include "config.h" -#include "init.h" +#include +#include +#include + +/* replacement abort function: */ +static void ODP_NORETURN odp_init_abort(void) +{ + abort(); +} + +/* test ODP global init, with alternate abort function */ +static void init_test_odp_init_global_replace_abort(void) +{ + int status; + odp_init_t init_data; + odp_instance_t instance; + + odp_init_param_init(&init_data); + init_data.abort_fn = &odp_init_abort; + + status = odp_init_global(&instance, &init_data, NULL); + CU_ASSERT_FATAL(status == 0); + + status = odp_term_global(instance); + CU_ASSERT(status == 0); +} + +odp_testinfo_t init_suite_abort[] = { + ODP_TEST_INFO(init_test_odp_init_global_replace_abort), + ODP_TEST_INFO_NULL, +}; + +odp_suiteinfo_t init_suites_abort[] = { + {"Init", NULL, NULL, init_suite_abort}, + ODP_SUITE_INFO_NULL, +}; int main(int argc, char *argv[]) { - return init_main_abort(argc, 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); + + /* run the tests: */ + ret = odp_cunit_register(init_suites_abort); + + if (ret == 0) + ret = odp_cunit_run(); + + return ret; } diff --git a/test/validation/api/init/init_main_log.c b/test/validation/api/init/init_main_log.c index 9dc6cba0b..8b1bbe905 100644 --- a/test/validation/api/init/init_main_log.c +++ b/test/validation/api/init/init_main_log.c @@ -6,9 +6,81 @@ #include "config.h" -#include "init.h" +#include +#include +#include + +/* flag set when the replacement logging function is used */ +int replacement_logging_used; + +/* replacement log function: */ +ODP_PRINTF_FORMAT(2, 3) +static int odp_init_log(odp_log_level_t level __attribute__((unused)), + const char *fmt, ...) +{ + va_list args; + int r; + + /* just set a flag to be sure the replacement fn was used */ + replacement_logging_used = 1; + + va_start(args, fmt); + r = vfprintf(stderr, fmt, args); + va_end(args); + + return r; +} + + +/* test ODP global init, with alternate log function */ +static void init_test_odp_init_global_replace_log(void) +{ + int status; + odp_init_t init_data; + odp_instance_t instance; + + odp_init_param_init(&init_data); + init_data.log_fn = &odp_init_log; + + replacement_logging_used = 0; + + status = odp_init_global(&instance, &init_data, NULL); + CU_ASSERT_FATAL(status == 0); + + CU_ASSERT_TRUE(replacement_logging_used || ODP_DEBUG_PRINT == 0); + + status = odp_term_global(instance); + CU_ASSERT(status == 0); +} + +odp_testinfo_t init_suite_log[] = { + ODP_TEST_INFO(init_test_odp_init_global_replace_log), + ODP_TEST_INFO_NULL, +}; + +odp_suiteinfo_t init_suites_log[] = { + {"Init", NULL, NULL, init_suite_log}, + ODP_SUITE_INFO_NULL, +}; int main(int argc, char *argv[]) { - return init_main_log(argc, 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(init_suites_log); + + /* run the tests: */ + if (ret == 0) + ret = odp_cunit_run(); + + return ret; } diff --git a/test/validation/api/init/init_main_ok.c b/test/validation/api/init/init_main_ok.c index 3512fca80..a97db8e79 100644 --- a/test/validation/api/init/init_main_ok.c +++ b/test/validation/api/init/init_main_ok.c @@ -6,9 +6,50 @@ #include "config.h" -#include "init.h" +#include +#include + +/* test normal ODP global init */ +static void init_test_odp_init_global(void) +{ + int status; + odp_instance_t instance; + + status = odp_init_global(&instance, NULL, NULL); + CU_ASSERT_FATAL(status == 0); + + status = odp_term_global(instance); + CU_ASSERT(status == 0); +} + +odp_testinfo_t init_suite_ok[] = { + ODP_TEST_INFO(init_test_odp_init_global), + ODP_TEST_INFO_NULL, +}; + +odp_suiteinfo_t init_suites_ok[] = { + {"Init", NULL, NULL, init_suite_ok}, + ODP_SUITE_INFO_NULL, +}; int main(int argc, char *argv[]) { - return init_main_ok(argc, 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(init_suites_ok); + + /* run the tests: */ + if (ret == 0) + ret = odp_cunit_run(); + + return ret; }