From patchwork Thu Dec 7 17:00:15 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: 121030 Delivered-To: patch@linaro.org Received: by 10.140.22.227 with SMTP id 90csp8608706qgn; Thu, 7 Dec 2017 09:03:25 -0800 (PST) X-Google-Smtp-Source: AGs4zMb7nJgiOuIs8I34b9kSFc2edU3tfjku6Nz4O03OfyiM7m0M2onftslgouC/XoHhkKEZzuVY X-Received: by 10.55.135.69 with SMTP id j66mr29801024qkd.340.1512666205512; Thu, 07 Dec 2017 09:03:25 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1512666205; cv=none; d=google.com; s=arc-20160816; b=Ao6V9/0IRW43vMNJpWZvJqbvZeU0tNYSpvtUh+kr8N6IpNYtz+POcgw6+IhiwFnOr+ QJGRyMRr2DpVbk7ZFSiHxEofg94/QSCctjwVa7HMAvDWJ5laTfVRaR7NZqgutRYGwedR BcTPtSF4VCJxLvem5BB6TU275OmDXjUoCHr4VXviDtyUodxNLdmub9MCOIrTcXdZwYB8 L2ZROxEH0A3obLhXWcGKiyO4nk4Z7rEq4fsOG7Mj4DkJaA12KH/inmmCN87CuHqrFoz7 /S3Bb5UAVVkzJNYGoHcNnA890/pEozSA9aSOAihuvaOZLYDZJ+Ym9LwNzI0VQgkzW591 EKOA== 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=Q+EaKFrIkJX8p0AELwrFk94sbou/51dboSEqKrReE3U=; b=ktz0cmYRD1jLGVuh8RgkHoC4XABAfB4x/IvLe841BN19ev+I6waHV6RvUNFohZ02lO 9ubxbAHbSvj3uUdKovsZ53obEBOXkC+2tm6vZzOlWL+MUPiKVAZMgW/ok9K7c318Htep BlZBC8cHjp4doodXxASMP5nWb5jmdC3krft0YdzyYedcDhrYTGr9sz/7rRSFSSXONJiC qLD+7L3W8Qiq0ZwXwK1bsLTFxX7R5s7v+/K2c8K/FzPGjHfP4hiAlKEXBl0ZwsOjVU76 doRZKN4LTevvU84fFp5F17JqisVTN7kkQh0ZDQufrYrIAG49jWVoVIA08nomllvy08oI aI/g== 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 i58si391185qta.381.2017.12.07.09.03.02; Thu, 07 Dec 2017 09:03: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 E90596097B; Thu, 7 Dec 2017 17:03:01 +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_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 231B36098B; Thu, 7 Dec 2017 17:00:48 +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 8DFEF60970; Thu, 7 Dec 2017 17:00:31 +0000 (UTC) Received: from forward103p.mail.yandex.net (forward103p.mail.yandex.net [77.88.28.106]) by lists.linaro.org (Postfix) with ESMTPS id 364D060953 for ; Thu, 7 Dec 2017 17:00:22 +0000 (UTC) Received: from mxback20j.mail.yandex.net (mxback20j.mail.yandex.net [IPv6:2a02:6b8:0:1619::114]) by forward103p.mail.yandex.net (Yandex) with ESMTP id AA7EE2184F56 for ; Thu, 7 Dec 2017 20:00:20 +0300 (MSK) Received: from smtp3o.mail.yandex.net (smtp3o.mail.yandex.net [2a02:6b8:0:1a2d::27]) by mxback20j.mail.yandex.net (nwsmtp/Yandex) with ESMTP id o5yvPx9MH1-0KPS68hQ; Thu, 07 Dec 2017 20:00:20 +0300 Received: by smtp3o.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id robc9Ytbsu-0JP8UrZo; Thu, 07 Dec 2017 20:00:19 +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: Thu, 7 Dec 2017 20:00:15 +0300 Message-Id: <1512666018-3066-2-git-send-email-odpbot@yandex.ru> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1512666018-3066-1-git-send-email-odpbot@yandex.ru> References: <1512666018-3066-1-git-send-email-odpbot@yandex.ru> Github-pr-num: 309 Subject: [lng-odp] [PATCH v5 1/4] 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: c15a810b7a47f2e07200f83aa534163ca06e2b16 ** Merge commit sha: f67aef1c433b43a2cdad08eb808b9fbcb9797b0e **/ .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..6eaeed87d 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" +#ifdef 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"])