Received: by 10.223.164.221 with SMTP id h29csp3206524wrb; Mon, 30 Oct 2017 17:37:22 -0700 (PDT) X-Google-Smtp-Source: ABhQp+TeuSs12znIvMqnCUYOQ3I9HBFEQq+gm0RTf83d1vjDXyRQbrnTLtXyq/ZC7SH4+oOY6zvX X-Received: by 10.99.112.29 with SMTP id l29mr170628pgc.2.1509410242826; Mon, 30 Oct 2017 17:37:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1509410242; cv=none; d=google.com; s=arc-20160816; b=X4jCkqxfRrgRwbeCswVxmfwbA880ZIxvy6mnAjHnTXaHy0UpLwat0A3suqkOfkGBJs xQk2w0mt+9COBXljN00E0coQKJQUZLQpa/U+MldWGZHzNYqG8fTTaTPRO0uS0AtWKZcB b8yGh+ZSKAYWzNwIFVSpGIhLW1IxAUGozzgF4AiiZIbvVD+va/eUjMaOQyC6d8NOq5S1 5U6MQyEuuq8JwhC+GICKCfpbT3SDluuF4JIbuZLxGdl/o6BSkK7qcA4qomSkUjAwH9I9 KdLlotiMjKgUePC1/p/bgF85WKk9TguwTEMkmRyYQLibxjcOmYX6oLBOw7tzbKN432cq tV2A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :arc-authentication-results; bh=TUwXPTeOQHbTVN7M+cSmYsmDAUr8Z/xpVUN8haG2AjM=; b=uoJNgWPf4WZG75MtcxQUB1mW5ez+UdRtLKzv77bbOKCF36Km0fNOI6RZj17xuwP3r3 CqggLWrSCY0CkS9QUlYS13cgd+8MgBmQXIHki/dv6JQZBoXeydVe4PMgSrFnF0hlMjLt 0kuJ5Z7yet3pZr71eOFpXXO6Gt/P333XuOuj6/idNPV5olbU1kv4XB+YtOFVnmf/LD1z n9kLOKVjWv9r+JxU1uCLcGcBpb/tyYhrz9hLyyceLtvqquZcIzi1DxcTdxAWYQ6GtuQQ o3qNBT1r1PDCcdOoF8Gk4RkE/m5cIgUDAQgxnxqJQEWklZIayr4LqMrtCPQpJED2aUo6 ICQw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=samsung.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b23si151910pgn.410.2017.10.30.17.37.09; Mon, 30 Oct 2017 17:37:22 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=samsung.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753478AbdJaABa (ORCPT + 99 others); Mon, 30 Oct 2017 20:01:30 -0400 Received: from osg.samsung.com ([64.30.133.232]:54238 "EHLO osg.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753462AbdJaAB2 (ORCPT ); Mon, 30 Oct 2017 20:01:28 -0400 Received: from localhost (localhost [127.0.0.1]) by osg.samsung.com (Postfix) with ESMTP id 9DDAE1FBE6; Mon, 30 Oct 2017 17:01:27 -0700 (PDT) X-Virus-Scanned: Debian amavisd-new at dev.s-opensource.com Received: from osg.samsung.com ([127.0.0.1]) by localhost (localhost [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id bvBbAgs-mZ9d; Mon, 30 Oct 2017 17:01:21 -0700 (PDT) Received: from localhost.localdomain (c-24-9-64-241.hsd1.co.comcast.net [24.9.64.241]) by osg.samsung.com (Postfix) with ESMTPSA id 7B1091FBDE; Mon, 30 Oct 2017 17:01:21 -0700 (PDT) From: Shuah Khan To: shuah@kernel.org Cc: Shuah Khan , mpe@ellerman.id.au, linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] selftests: lib.mk: print individual test results to console by default Date: Mon, 30 Oct 2017 18:01:18 -0600 Message-Id: <20171031000118.30982-1-shuahkh@osg.samsung.com> X-Mailer: git-send-email 2.11.0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Change run_tests to print individual test results to console by default. Introduce "summary" option to print individual test results to a file /tmp/test_name and just print the summary to the console. This change is necessary to support use-cases where test machines get rebooted once tests are run and the console log should contain the full results. In the following example, individual test results with "summary=1" option are written to /tmp/kcmp_test make --silent TARGETS=kcmp kselftest TAP version 13 selftests: kcmp_test ======================================== pid1: 30126 pid2: 30127 FD: 2 FILES: 2 VM: 1 FS: 2 SIGHAND: 2 IO: 0 SYSVSEM: 0 INV: -1 PASS: 0 returned as expected PASS: 0 returned as expected FAIL: 0 expected but -1 returned (Invalid argument) Pass 2 Fail 1 Xfail 0 Xpass 0 Skip 0 Error 0 1..3 Bail out! Pass 2 Fail 1 Xfail 0 Xpass 0 Skip 0 Error 0 1..3 Pass 0 Fail 0 Xfail 0 Xpass 0 Skip 0 Error 0 1..0 ok 1..1 selftests: kcmp_test [PASS] make --silent TARGETS=kcmp summary=1 kselftest TAP version 13 selftests: kcmp_test ======================================== ok 1..1 selftests: kcmp_test [PASS] Signed-off-by: Shuah Khan --- tools/testing/selftests/lib.mk | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/tools/testing/selftests/lib.mk b/tools/testing/selftests/lib.mk index f65886af7c0c..5bef05d6ba39 100644 --- a/tools/testing/selftests/lib.mk +++ b/tools/testing/selftests/lib.mk @@ -31,7 +31,11 @@ define RUN_TESTS echo "selftests: Warning: file $$BASENAME_TEST is not executable, correct this.";\ echo "not ok 1..$$test_num selftests: $$BASENAME_TEST [FAIL]"; \ else \ - cd `dirname $$TEST` > /dev/null; (./$$BASENAME_TEST > /tmp/$$BASENAME_TEST 2>&1 && echo "ok 1..$$test_num selftests: $$BASENAME_TEST [PASS]") || echo "not ok 1..$$test_num selftests: $$BASENAME_TEST [FAIL]"; cd - > /dev/null;\ + if [ "X$(summary)" != "X" ]; then \ + cd `dirname $$TEST` > /dev/null; (./$$BASENAME_TEST > /tmp/$$BASENAME_TEST 2>&1 && echo "ok 1..$$test_num selftests: $$BASENAME_TEST [PASS]") || echo "not ok 1..$$test_num selftests: $$BASENAME_TEST [FAIL]"; cd - > /dev/null;\ + else \ + cd `dirname $$TEST` > /dev/null; (./$$BASENAME_TEST && echo "ok 1..$$test_num selftests: $$BASENAME_TEST [PASS]") || echo "not ok 1..$$test_num selftests: $$BASENAME_TEST [FAIL]"; cd - > /dev/null;\ + fi; \ fi; \ done; endef -- 2.11.0 From 1585381417293354324@xxx Wed Nov 29 06:38:59 +0000 2017 X-GM-THRID: 1584464865137436377 X-Gmail-Labels: Inbox,Category Forums,HistoricalUnread