From patchwork Fri Nov 24 11:00:03 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: 119569 Delivered-To: patch@linaro.org Received: by 10.140.22.164 with SMTP id 33csp2042455qgn; Fri, 24 Nov 2017 03:01:18 -0800 (PST) X-Google-Smtp-Source: AGs4zMYeCyBefAq0PsYkAH+VBIcD0Ln9aQapu2MP5pPYmhiX0ODNzOg/crw/z5CjC6S2bRtEIESz X-Received: by 10.55.148.131 with SMTP id w125mr6094575qkd.26.1511521278335; Fri, 24 Nov 2017 03:01:18 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1511521278; cv=none; d=google.com; s=arc-20160816; b=uCHN7+p0KYvFzcRdg+4kP90mw8owE95/E6IjPCgl94qtgv72t1t0f7W4OkxXcCyIpk AevQGtKvIPaXjjSJVEiUNop23Ma8AQSW/c6M2GO+UZ5MG2P+0qMQjxB16QdCFHl3vYcT 9zhFkMmm4XQzF/4Okich6rjjSRV0u9zOgSN//SZUhv/86HcAurX6VtWhf21hyUqS1G6Q u5pDsuIFfAUKeus/fhjZbpGSXPNuF+kByjWIyN89Q1acNxZPv4eSbdHnLWpLX1rMQ8AO zfSdX2DI54Ch0Mv92WnT869h4cKHO+NDe2zpnD/AiJ20XrKhdpdGUZVS9wvYlY8wREzW musg== 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=VnvDriGdprJd63h23YXE9o5JekLwhiliEKOPCPkTFLg=; b=XexbP6YD7EGzxAgJTyG9YxUGMZY6fb7xh2m/6ouWA7zJIILv0DxwHg6L0ZRjIRcu5z SZLynXBen+eHe6EyUCWL0J5bFJstdH9nQFZsKY+hJwZY47X6x2w9Sr4ebjWlFoTcqJJo 37xMJJKvV1pcLoiZ5eAUXGQ2e7uiUH0bcmIVgBaGCla7tBXAr2Q/oPXrSVa0ZkWT2qLr QCrkTupigkOb0AM2VzaFFvTQcP2BDjU1JLcCIHN/gAZAsspzDBi4E3rM8z8uyNQmqoK0 im+rxsX9/ps7ZqV/OCkQMjZU6c2woNYi1vCfr8+XynVVnwoI3iu7SN3I7m8uUWQTjv94 /YBQ== 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 y66si10600747qke.418.2017.11.24.03.01.17; Fri, 24 Nov 2017 03:01:18 -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 CC86F6087B; Fri, 24 Nov 2017 11:01:17 +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 67FFC60833; Fri, 24 Nov 2017 11:00: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 5BEB760812; Fri, 24 Nov 2017 11:00:16 +0000 (UTC) Received: from forward104o.mail.yandex.net (forward104o.mail.yandex.net [37.140.190.179]) by lists.linaro.org (Postfix) with ESMTPS id D4BA56082A for ; Fri, 24 Nov 2017 11:00:10 +0000 (UTC) Received: from mxback2o.mail.yandex.net (mxback2o.mail.yandex.net [IPv6:2a02:6b8:0:1a2d::1c]) by forward104o.mail.yandex.net (Yandex) with ESMTP id 19036701ECB for ; Fri, 24 Nov 2017 14:00:09 +0300 (MSK) Received: from smtp3o.mail.yandex.net (smtp3o.mail.yandex.net [2a02:6b8:0:1a2d::27]) by mxback2o.mail.yandex.net (nwsmtp/Yandex) with ESMTP id pKKpSNAnOe-08GeuEC0; Fri, 24 Nov 2017 14:00:09 +0300 Received: by smtp3o.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id txSlDzmgG0-08w4MTU2; Fri, 24 Nov 2017 14:00:08 +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: Fri, 24 Nov 2017 14:00:03 +0300 Message-Id: <1511521206-22959-2-git-send-email-odpbot@yandex.ru> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1511521206-22959-1-git-send-email-odpbot@yandex.ru> References: <1511521206-22959-1-git-send-email-odpbot@yandex.ru> Github-pr-num: 309 Subject: [lng-odp] [PATCH v2 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: 5329e5211c447b9b823149baf76112eedfeb07fb ** Merge commit sha: 948a78a8756a13ba45c7aa311dc129e0cc7b3c98 **/ .gitignore | 3 +++ configure.ac | 1 + doc/.gitignore | 1 + test/Makefile.inc | 3 +++ test/common/odp_cunit_common.c | 20 ++++++++++++++++++++ test/common/odp_cunit_common.h | 3 +++ test/m4/validation.m4 | 9 +++++++++ 7 files changed, 40 insertions(+) create mode 100644 doc/.gitignore diff --git a/.gitignore b/.gitignore index b9c61424a..75ba2ac86 100644 --- a/.gitignore +++ b/.gitignore @@ -1,13 +1,16 @@ *.d *.gcda *.gcno +*.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/Makefile.inc b/test/Makefile.inc index f7c0da214..086100b17 100644 --- a/test/Makefile.inc +++ b/test/Makefile.inc @@ -17,6 +17,9 @@ INCFLAGS = \ AM_CPPFLAGS = $(INCFLAGS) AM_CFLAGS = $(CUNIT_CFLAGS) +if cunit_out_xml +AM_CFLAGS += -DTEST_CUNIT_XML +endif AM_LDFLAGS = -L$(LIB) -static diff --git a/test/common/odp_cunit_common.c b/test/common/odp_cunit_common.c index 08bf1f264..34981b74e 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,6 +8,7 @@ #include "config.h" #include +#include #include #include "odp_cunit_common.h" #include @@ -14,6 +16,7 @@ static odph_odpthread_t thread_tbl[MAX_WORKERS]; static odp_instance_t instance; +extern const char *__progname; /* * global init/term functions which may be registered * defaults to functions performing odp init/term. @@ -291,13 +294,30 @@ static int cunit_update_suite(odp_suiteinfo_t *updated_sinfo) int odp_cunit_run(void) { int ret; +#ifdef TEST_CUNIT_XML + char name[255]; +#endif printf("\tODP API version: %s\n", odp_version_api_str()); printf("\tODP implementation name: %s\n", odp_version_impl_name()); printf("\tODP implementation version: %s\n", odp_version_impl_str()); +#ifdef TEST_CUNIT_XML + if (strlen(__progname)) { + snprintf(name, 255, "%s", __progname); + CU_set_output_filename(name); + } else { + /* forked processes do not have __progname */ + ret = readlink("/proc/self/exe", name, sizeof(name) - 1); + name[ret] = 0; + CU_set_output_filename(basename(name)); + } + + CU_automated_run_tests(); +#else CU_basic_set_mode(CU_BRM_VERBOSE); CU_basic_run_tests(); +#endif ret = CU_get_number_of_failure_records(); 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..0dccd5d79 100644 --- a/test/m4/validation.m4 +++ b/test/m4/validation.m4 @@ -19,6 +19,14 @@ AS_IF([test "x$cunit_support" != "xno"], [cunit_support=no]) ])]) + +########################################################################## +AC_ARG_ENABLE([cunit_out_xml], + [AS_HELP_STRING([--enable-cunit_out_xml], + [include additional debugging code ] + [(set to 'full' to enable all --enable-*-debug-* options)])], + cunit_out_xml=yes, cunit_out_xml=no) + AS_IF([test "x$test_vald" = "xyes" -a "x$cunit_support" = "xno"], [AC_MSG_ERROR([Validation testsuite requested, but CUnit was not found])], [test "x$test_vald" = "xcheck" -a "x$cunit_support" = "xno"], @@ -27,6 +35,7 @@ AS_IF([test "x$test_vald" = "xyes" -a "x$cunit_support" = "xno"], [test "x$test_vald" != "xno"], [test_vald=yes]) AM_CONDITIONAL([cunit_support], [test "x$cunit_support" = "xyes"]) +AM_CONDITIONAL([cunit_out_xml], [test "x$cunit_out_xml" = "xyes"]) AM_CONDITIONAL([test_vald], [test "x$test_vald" = "xyes"]) AC_SUBST([CUNIT_CFLAGS])