From patchwork Mon Dec 11 20:00:16 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Github ODP bot X-Patchwork-Id: 121460 Delivered-To: patch@linaro.org Received: by 10.140.22.227 with SMTP id 90csp3220480qgn; Mon, 11 Dec 2017 12:02:05 -0800 (PST) X-Google-Smtp-Source: ACJfBos1GpSya7fS8K7yc2kHCPdlQ7YeVFX/6VUq2YQSuo7Zo6qweWhkyqqyHa28dY7R+MCfSO3O X-Received: by 10.200.50.78 with SMTP id y14mr2433619qta.84.1513022524920; Mon, 11 Dec 2017 12:02:04 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1513022524; cv=none; d=google.com; s=arc-20160816; b=FChLWvvCbL7bGM71j7AxpuqdrwikmTqI6UUhiSvgZxJrvLXwo/L9HEgam9h6LQDrhQ sCE0XDzeTrfHugQT+0pdr/NPCN3tVZVrOwYzy/uyqwLSoZx3kx76aFpD29uOLG/fDfNY PnHvGVWYkdv9ma12QVeGxg61hqsPncfGVSwdeyb7PMwCkgmtyNI8SIe+3VJtZFg5CW3v cXGzTrCQ9LLuwkFctmoLj6tIuA3j6bqFQ/rq5Q0SudsbAO36OCQPuUXaBeC36em+DJaw +6e8m9AMcY5WDOvABS8Xfp3ZtaIMxK9rvreVi4I8t3uGJAKo++7FxbFJs62K3R18GvIw M9lQ== 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=iI3q/1mh8gSijXpg6O3aJCGLYk4x4uRBmbgQhk6Kg7Q=; b=P6o9yIhYshieIhu8KYS0C6M/h82bmlAvC+WpdFTBOhYwB+zhNuLliXp7xT3oW4F3JF ZvCh92sBjCVhwW+rBuPcbwTvNBjoGphkmVOK/O4+BRqR3tn/LdDgSsof5O5fzr9C8KHR +ySdSYZ+Ez9bI/HX/FF9jyHrN1PJS7ukKu7h6aoLjJLFM1XV7v1TQRUxhYxmbSIzciZY bfPC6RY+RxtCEYMXFhpjj5uG4E8S3UyIIW1zn3C+vNeISIGSiTyjzb1rLZrzkNrq/Fru O1HaOU4r6zrXDD60W8d+vQGtey+WoeJK0WKDC2TuVqMWchaBfzPXm181Y5WPT2jJguKG gwxg== 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 b20si1472293qka.75.2017.12.11.12.02.04; Mon, 11 Dec 2017 12:02:04 -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 978956097B; Mon, 11 Dec 2017 20:02:04 +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,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 4AAF660985; Mon, 11 Dec 2017 20:00:37 +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 313E06095D; Mon, 11 Dec 2017 20:00:27 +0000 (UTC) Received: from forward104o.mail.yandex.net (forward104o.mail.yandex.net [37.140.190.179]) by lists.linaro.org (Postfix) with ESMTPS id E8A1B608E8 for ; Mon, 11 Dec 2017 20:00:23 +0000 (UTC) Received: from mxback7j.mail.yandex.net (mxback7j.mail.yandex.net [IPv6:2a02:6b8:0:1619::110]) by forward104o.mail.yandex.net (Yandex) with ESMTP id 6E7F57026DE for ; Mon, 11 Dec 2017 23:00:22 +0300 (MSK) Received: from smtp3p.mail.yandex.net (smtp3p.mail.yandex.net [2a02:6b8:0:1472:2741:0:8b6:8]) by mxback7j.mail.yandex.net (nwsmtp/Yandex) with ESMTP id rBae0rfDuh-0LFm1LMD; Mon, 11 Dec 2017 23:00:22 +0300 Received: by smtp3p.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id jr2z9dCikj-0Ltif1Pm; Mon, 11 Dec 2017 23:00:21 +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: Mon, 11 Dec 2017 23:00:16 +0300 Message-Id: <1513022420-22227-2-git-send-email-odpbot@yandex.ru> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1513022420-22227-1-git-send-email-odpbot@yandex.ru> References: <1513022420-22227-1-git-send-email-odpbot@yandex.ru> Github-pr-num: 309 Subject: [lng-odp] [PATCH v8 1/5] test: build: enable cunit output to xml 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: Maxim Uvarov Signed-off-by: Maxim Uvarov --- /** Email created from pull request 309 (muvarov:devel/master_shippable2) ** https://github.com/Linaro/odp/pull/309 ** Patch: https://github.com/Linaro/odp/pull/309.patch ** Base sha: 6881620135a179911a5839d4be97423a8d80e5ab ** Merge commit sha: 9af6bae56adfa7e06e06d13bb60a5964fcf40977 **/ .gitignore | 3 +++ configure.ac | 1 + doc/.gitignore | 1 + test/common/odp_cunit_common.c | 9 +++++++++ test/common/odp_cunit_common.h | 3 +++ test/m4/validation.m4 | 11 +++++++++++ 6 files changed, 28 insertions(+) create mode 100644 doc/.gitignore diff --git a/.gitignore b/.gitignore index 93ab63a31..4653f8976 100644 --- a/.gitignore +++ b/.gitignore @@ -2,13 +2,16 @@ *.gcda *.gcno *.gcov +*.trs *.la *.lo +*.log *.o *.orig *.patch *.rej *.swp +*.xml *~ .deps/ .dirstamp diff --git a/configure.ac b/configure.ac index 95e316026..c4ce56e20 100644 --- a/configure.ac +++ b/configure.ac @@ -383,6 +383,7 @@ AC_MSG_RESULT([ Deprecated APIs: ${deprecated} debug: ${enable_debug} cunit: ${cunit_support} + cunit xml output: ${cunit_out_xml} test_vald: ${test_vald} test_perf: ${test_perf} test_perf_proc: ${test_perf_proc} diff --git a/doc/.gitignore b/doc/.gitignore new file mode 100644 index 000000000..d7ec32eaf --- /dev/null +++ b/doc/.gitignore @@ -0,0 +1 @@ +!*.xml diff --git a/test/common/odp_cunit_common.c b/test/common/odp_cunit_common.c index 08bf1f264..7ed343745 100644 --- a/test/common/odp_cunit_common.c +++ b/test/common/odp_cunit_common.c @@ -1,3 +1,4 @@ + /* Copyright (c) 2014, Linaro Limited * All rights reserved. * @@ -7,12 +8,14 @@ #include "config.h" #include +#include #include #include "odp_cunit_common.h" #include /* Globals */ static odph_odpthread_t thread_tbl[MAX_WORKERS]; static odp_instance_t instance; +static char *progname; /* * global init/term functions which may be registered @@ -296,8 +299,13 @@ int odp_cunit_run(void) printf("\tODP implementation name: %s\n", odp_version_impl_name()); printf("\tODP implementation version: %s\n", odp_version_impl_str()); +#if TEST_CUNIT_XML + CU_set_output_filename(progname); + CU_automated_run_tests(); +#else CU_basic_set_mode(CU_BRM_VERBOSE); CU_basic_run_tests(); +#endif ret = CU_get_number_of_failure_records(); @@ -371,5 +379,6 @@ int odp_cunit_register(odp_suiteinfo_t testsuites[]) */ int odp_cunit_parse_options(int argc, char *argv[]) { + progname = argv[0]; return odph_parse_options(argc, argv, NULL, NULL); } diff --git a/test/common/odp_cunit_common.h b/test/common/odp_cunit_common.h index 486a5ec51..1497a33c7 100644 --- a/test/common/odp_cunit_common.h +++ b/test/common/odp_cunit_common.h @@ -17,6 +17,9 @@ #include #include "CUnit/Basic.h" #include "CUnit/TestDB.h" +#if TEST_CUNIT_XML +#include +#endif #include #define MAX_WORKERS 32 /**< Maximum number of work threads */ diff --git a/test/m4/validation.m4 b/test/m4/validation.m4 index 65ba2aa2e..216510a76 100644 --- a/test/m4/validation.m4 +++ b/test/m4/validation.m4 @@ -31,3 +31,14 @@ AM_CONDITIONAL([test_vald], [test "x$test_vald" = "xyes"]) AC_SUBST([CUNIT_CFLAGS]) AC_SUBST([CUNIT_LIBS]) + +AC_ARG_ENABLE([cunit_out_xml], + [AS_HELP_STRING([--enable-cunit_out_xml], + [output to xml] + [(output test results to xml instead of plain text)])], + cunit_out_xml=yes, cunit_out_xml=no) +AS_IF([test "x$cunit_out_xml" == "xyes"], [TEST_CUNIT_XML=1], + [TEST_CUNIT_XML=0]) +AC_DEFINE_UNQUOTED([TEST_CUNIT_XML], [$TEST_CUNIT_XML], + [Define to 1 to output to xml]) +AM_CONDITIONAL([cunit_out_xml], [test "x$cunit_out_xml" = "xyes"])