From patchwork Mon Dec 11 22:00:18 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: 121467 Delivered-To: patch@linaro.org Received: by 10.140.22.227 with SMTP id 90csp3338131qgn; Mon, 11 Dec 2017 14:02:10 -0800 (PST) X-Google-Smtp-Source: ACJfBossNW/hgzS+gZVS1GAHDc8/ZJ1S1XrFaplRjSi85WvFzZM/Zs6SytYbEBkegmGyaO6uXBj+ X-Received: by 10.200.39.226 with SMTP id x31mr2899008qtx.81.1513029730114; Mon, 11 Dec 2017 14:02:10 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1513029730; cv=none; d=google.com; s=arc-20160816; b=PwONfORrKLQm462CnWHe0gDW8PzFB+jNu9wSRFgwLSqBG/RZqOPXQgWmDNVkpfKHC/ kMp1LwVZF+u4ztIArpx0pfgKru15zr2zDOOCOHbqJSSYoXj2p9NCfAffSn5aJNqnWIXi Cpf2xfsxFBCs5x0j2Zb2wRhhbzqL94dpI+2FadPX3Dw6hCiUfpm7im6YW9RwhJGRjjA3 H9dmCeOCxeliiCPqdrt0Q9etk9CX2FQ80rxnLpaF1kqQIeDgjba1ILrycz/5OKxNwTnS 2n6DB29Jhzg9Arfmv4kV6f46dl7ej0l6rk8ILLXmDlmElv2psoCe1tEt+V+B7QrhPUUi HRYQ== 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=vPTrL2w4pApadil/9WFDsRdJjWqLEfhGMUJT5SlrQU0=; b=OrwCF3D+W9VaM9DhnJH2jlghDuSG6MZBg54Gb0OEaj3ftRRXMj885yHIDYg8TyAWQ2 5xTm2Rn5WCHhK4rPzvSXhvIDv7GTLlV7WPMV8gLhTz1Q2rQueHno1P0BGYoCCNhHLDXK M/bJQYnbpYdM5m1CDxJlfdO1WzUpCvdJ3mvzXTAh/4PRUfG0SG+bRtVQD8dePrgJj7/X 4vSCSiY/St07lhI5Wscim2840lG2Ar8xMXENwSXc0H3xRq0RZGj9I3A7Tp792xRxK2lO P9C1UEa1gPQyopZhTRlMG3LxSluPTftgVkc5OiAE6SwjAEhWgujOjim252+eN6EijJI/ Ykjg== 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 a64si1321645qkj.138.2017.12.11.14.02.09; Mon, 11 Dec 2017 14:02:10 -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 C9F3D6098B; Mon, 11 Dec 2017 22:02:09 +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 26C5360993; Mon, 11 Dec 2017 22:00:42 +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 960A46097D; Mon, 11 Dec 2017 22:00:31 +0000 (UTC) Received: from forward102p.mail.yandex.net (forward102p.mail.yandex.net [77.88.28.102]) by lists.linaro.org (Postfix) with ESMTPS id 84AD0608E8 for ; Mon, 11 Dec 2017 22:00:27 +0000 (UTC) Received: from mxback3o.mail.yandex.net (mxback3o.mail.yandex.net [IPv6:2a02:6b8:0:1a2d::1d]) by forward102p.mail.yandex.net (Yandex) with ESMTP id 0B7324303F6B for ; Tue, 12 Dec 2017 01:00:26 +0300 (MSK) Received: from smtp3o.mail.yandex.net (smtp3o.mail.yandex.net [2a02:6b8:0:1a2d::27]) by mxback3o.mail.yandex.net (nwsmtp/Yandex) with ESMTP id sRvtGzcmSv-0Pt4UpkQ; Tue, 12 Dec 2017 01:00:26 +0300 Received: by smtp3o.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id oe9SStyGAP-0PbCHgq5; Tue, 12 Dec 2017 01:00:25 +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, 12 Dec 2017 01:00:18 +0300 Message-Id: <1513029623-29970-2-git-send-email-odpbot@yandex.ru> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1513029623-29970-1-git-send-email-odpbot@yandex.ru> References: <1513029623-29970-1-git-send-email-odpbot@yandex.ru> Github-pr-num: 309 Subject: [lng-odp] [PATCH v9 1/6] 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: 512c8ed3c8a8e6317575378fbccc1620392cca8a **/ .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"])