Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp906440iog; Wed, 29 Jun 2022 12:40:44 -0700 (PDT) X-Google-Smtp-Source: AGRyM1uoD+ObT+PtYaoYIM5ikkPK2xuHByWYJheK6oZWXdPWCHxjPIWcfjCUdTEzZINWiF1ALX9P X-Received: by 2002:a17:906:358a:b0:6f4:2903:417e with SMTP id o10-20020a170906358a00b006f42903417emr4914243ejb.592.1656531644470; Wed, 29 Jun 2022 12:40:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1656531644; cv=none; d=google.com; s=arc-20160816; b=aoeM5rcjOzvQVxGX+EeOwiPL0busEbjooEBcZJe3CZIt4J8qmi0xDmTOvqWCsVh+j6 lLZjP3vB3Ap+yfslmEnmXz3Uju1CvHW5w9EGdGFuJyFaEvr25ekr7RZ0MZ8h5Jh/Z/Vq 1Y2w6wDp3u8iwoH44Ei+ydsbqTcXvvTH2HhcTAZTRuxkBb5kw1sKWD9c405jwET2dV/c zxNXY38QKRsVrV/tCULZbdF6na1kG2qgSUnxBjiyPE17lM/u2DYpkI5K3bF0juhcU+iV RWI5HSM+N6J/MbeCPM7zuDWfAbjP3sPvMliQm0UN5qF1AdwD0JRp8JEK1VKsubJ8e15e GhFQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=n0L9Ak2rih0QWqwb2iIsAHFOk1bnc7dnsv5n94hZROM=; b=Y8IKpL9QV4/z+gC5Wo7g70Z6gNUJ5pmWBrKynpIUpetOT1l6Vqr33YV/GPWtJYRt2R 1ktdgbXq+1cKaxJAizufA4yDaZ10ZkkUZX1LSclbCYI8o7wBy+od2G3LE4QXDbmKRqGJ 9v/7tWzENA4h3IEAlO2EbAznN5JzI9Enwl4UavXLjUS1PXWwg+ydPcIu+DzZyeyri4T3 5/2pjqRYJ5M2Lof0+wnWV77Vzhubgs72dr4qsQaOF4yYVRPL/UaXUDa817IUdVI70VkN QdQwOQtRz8SoI8HgCfw37xtoNWpr+ywAhklJsBx5lhCDl/ofR7UCv/4ONadXrvo1YNzo XZWQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=bYonWsLg; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id f19-20020a50a6d3000000b004359dccb8ccsi138661edc.189.2022.06.29.12.40.15; Wed, 29 Jun 2022 12:40:44 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=bYonWsLg; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230286AbiF2T2e (ORCPT + 99 others); Wed, 29 Jun 2022 15:28:34 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39630 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230139AbiF2T2d (ORCPT ); Wed, 29 Jun 2022 15:28:33 -0400 Received: from mail-pf1-x42e.google.com (mail-pf1-x42e.google.com [IPv6:2607:f8b0:4864:20::42e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6888FB31; Wed, 29 Jun 2022 12:28:31 -0700 (PDT) Received: by mail-pf1-x42e.google.com with SMTP id p14so16014370pfh.6; Wed, 29 Jun 2022 12:28:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=n0L9Ak2rih0QWqwb2iIsAHFOk1bnc7dnsv5n94hZROM=; b=bYonWsLg6KUobudvYp5urS+ZmI6RFZXKRiXZ0m30zyE3tdJ6qP7MTjQWVWhimzvul2 go8d+H1wP+izwQlxcMlCuLUtyBDtzI4F+IQHvYyEdolqcddO9zWnC9i9RxhEB+4OHILp 41XoZK+JygXqEpucvuxto3mMa4DtgtBL1LWOE06yTHNg2JjRmTZMagWfseU32vToryL5 8iOl06VxW6w0mNSqDyXAdt4TwuanqT6zO2HmXKgap6HTdmLXikRIvw7YCP+35ps6+E8C 8HX3KuCpRlx5dgHmXiOR+1HSta+dW28o4rFLGRKNmc5SSSJPR+Xe/Yj3RNFBGgpDcpve 96wA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=n0L9Ak2rih0QWqwb2iIsAHFOk1bnc7dnsv5n94hZROM=; b=fsRSZ8WfYfG962sPWG595cMYS5PjnudrEytyRl41W/grkjttA52872mpNvkEz/ql0J hEUZW2G1zAgWEPkNS3cwIc8vQw/OoPEy+gLTirZzspjN3JDgi/ah67r65fiz1CHBGa8H FbLGGaA1RY1iI3HIdHz/HehtKTdjd1hx70VjUopWBo/KjGPWw+IXqIini0PUbq12y3uB ya7RNc1ZqG6I2a2fj25QfacbLLRjuqJ/Njj2VT3koEvJMQ8hNzAUdLYDcFX1FWbBwgPH JXfNEvFimpjCB5GEmxGm9glKF32KT50/eMPNG+o+PCxg1BvKRPIiz8MrBjcGymQIjDwu 7QMg== X-Gm-Message-State: AJIora9NiSVQ1tBOnC6gz3vzjLcznlO0QSJrL0OCgrLcHg4/7OT9AVsI NaQSSm/l/I3F6XGUKd/XZFQ= X-Received: by 2002:a05:6a00:2356:b0:525:7c6e:1dca with SMTP id j22-20020a056a00235600b005257c6e1dcamr11522615pfj.28.1656530910863; Wed, 29 Jun 2022 12:28:30 -0700 (PDT) Received: from fedora.. ([103.230.148.187]) by smtp.gmail.com with ESMTPSA id k11-20020a6555cb000000b0040d87299ca3sm11512389pgs.54.2022.06.29.12.28.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 29 Jun 2022 12:28:30 -0700 (PDT) From: Gautam Menghani To: shuah@kernel.org Cc: Gautam Menghani , linux-kselftest@vger.kernel.org, linux-kernel-mentees@lists.linuxfoundation.org, linux-kernel@vger.kernel.org Subject: [PATCH] selftests/kcmp: Make the test output consistent and clear Date: Thu, 30 Jun 2022 00:58:22 +0530 Message-Id: <20220629192822.47577-1-gautammenghani201@gmail.com> X-Mailer: git-send-email 2.36.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Make the output format of this test consistent. Currently the output is as follows: +TAP version 13 +1..1 +# selftests: kcmp: kcmp_test +# pid1: 45814 pid2: 45815 FD: 1 FILES: 1 VM: 2 FS: 1 SIGHAND: 2 + IO: 0 SYSVSEM: 0 INV: -1 +# PASS: 0 returned as expected +# PASS: 0 returned as expected +# PASS: 0 returned as expected +# # Planned tests != run tests (0 != 3) +# # Totals: pass:3 fail:0 xfail:0 xpass:0 skip:0 error:0 +# # Planned tests != run tests (0 != 3) +# # Totals: pass:3 fail:0 xfail:0 xpass:0 skip:0 error:0 +# # Totals: pass:0 fail:0 xfail:0 xpass:0 skip:0 error:0 +ok 1 selftests: kcmp: kcmp_test With this patch applied the output is as follows: +TAP version 13 +1..1 +# selftests: kcmp: kcmp_test +# TAP version 13 +# 1..3 +# pid1: 46330 pid2: 46331 FD: 1 FILES: 2 VM: 2 FS: 2 SIGHAND: 1 + IO: 0 SYSVSEM: 0 INV: -1 +# PASS: 0 returned as expected +# PASS: 0 returned as expected +# PASS: 0 returned as expected +# # Totals: pass:3 fail:0 xfail:0 xpass:0 skip:0 error:0 +ok 1 selftests: kcmp: kcmp_test Signed-off-by: Gautam Menghani --- tools/testing/selftests/kcmp/kcmp_test.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tools/testing/selftests/kcmp/kcmp_test.c b/tools/testing/selftests/kcmp/kcmp_test.c index 6ea7b9f37a41..25110c7c0b3e 100644 --- a/tools/testing/selftests/kcmp/kcmp_test.c +++ b/tools/testing/selftests/kcmp/kcmp_test.c @@ -88,6 +88,9 @@ int main(int argc, char **argv) int pid2 = getpid(); int ret; + ksft_print_header(); + ksft_set_plan(3); + fd2 = open(kpath, O_RDWR, 0644); if (fd2 < 0) { perror("Can't open file"); @@ -152,7 +155,6 @@ int main(int argc, char **argv) ksft_inc_pass_cnt(); } - ksft_print_cnts(); if (ret) ksft_exit_fail(); @@ -162,5 +164,5 @@ int main(int argc, char **argv) waitpid(pid2, &status, P_ALL); - return ksft_exit_pass(); + return 0; } -- 2.36.1