Received: by 2002:a05:6a10:1d13:0:0:0:0 with SMTP id pp19csp1713635pxb; Fri, 27 Aug 2021 16:00:17 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwUt4gDTJwajykVM2R8RNVMYXuQTOSjy5gvlPEIyjwWaB0zOAKkgzAmq9tOiH3z3nqettQ8 X-Received: by 2002:a05:6638:3898:: with SMTP id b24mr10301470jav.126.1630105217112; Fri, 27 Aug 2021 16:00:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1630105217; cv=none; d=google.com; s=arc-20160816; b=Y6QsDkhTC5KSckv643DT9384BTubExsiItNJhIHfywyWXYpNBsTioVT3dGIWIzTY/8 TFDLwy7lKcjy1mpu0XbcQZSV1NTJoRoLgzJa50KJSh3sn3P89hOgZ7aI2zX6RqoWTrzE eci58CdRkMXZ8eEBmDw25CtKnhpMwGXFxFRtUePK5Wb4OzHZ2LbjCJRh1UoxPUlU2coK lfhogaXWm8E4qsSwSq6clovRwHindOmWXw3rEs2GnCrq5Kg+0BjUOpr/W4od8gQgpSaM SNkHOJ6m2JVaaA5m5OWBjmWans/T5LCWCR7LavbtnCOm09KviiuJaLThEH0Jw7tbyb+2 lHqQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:from:subject:references:mime-version :message-id:in-reply-to:date:dkim-signature; bh=5kt2Hs53YExhNYpfPSX+vfaUKXrkgz5zWfnPb9H9C5o=; b=vbds01M2pEdBAxmUro4p8N+0i05nEzXi7OAsu30AO6qFomXIh6D1Bi4lNH5WAKsMx1 u+72GhlBNTjWOroxfP4T88hbEUspOyVM31Swnt2CZt3RU47Vh8e+bmke02pZ8ue+EMsJ EshNul71WvhDws3j2ZT7gjlt+iUI0zxFG9MU0adVICyBRzVX1Jw/3YM2O7/TCPSWirFv aVPIZrSjcnbRSlPHIM2nIikbNTiPk8ojDtYJZ7CvoOykb6Ip5rzIr3q6xLGVTVTmcjqH PrY2a10+Hz9ixGxEaR41V9W/SEP03/WWhEYRxCQxLe2RTvBc62ILKsEcmTHVoI4kB+X7 LzeA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=CwVuEzd0; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id e123si8308814iof.100.2021.08.27.16.00.05; Fri, 27 Aug 2021 16:00:17 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=CwVuEzd0; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232418AbhH0W7N (ORCPT + 99 others); Fri, 27 Aug 2021 18:59:13 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52712 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232396AbhH0W7N (ORCPT ); Fri, 27 Aug 2021 18:59:13 -0400 Received: from mail-pj1-x1049.google.com (mail-pj1-x1049.google.com [IPv6:2607:f8b0:4864:20::1049]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B959DC061796 for ; Fri, 27 Aug 2021 15:58:23 -0700 (PDT) Received: by mail-pj1-x1049.google.com with SMTP id k23-20020a17090a591700b001796382f0d7so1356284pji.5 for ; Fri, 27 Aug 2021 15:58:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=date:in-reply-to:message-id:mime-version:references:subject:from:to :cc; bh=5kt2Hs53YExhNYpfPSX+vfaUKXrkgz5zWfnPb9H9C5o=; b=CwVuEzd0fS3U5i7hEYs6kt8YGwK1Q+B0CA8MKQ0HFuUN7KjKITVZBmOAj9+61B/xUL H5eS7kjXwCW2Opax4eWgDUdycDVagLubSWmiM2uugcT5KVFWpajGG8X15tmzZe3VoaXG +236OKR3PaEC7xQONOBiLikYG6tNnLB2eA05KVSwgFn2uOYSOvyKMWfSoElbzwSHWeLO AMAUbEirs+E7hRG5UhbEizrS27gT89Dv0LCRFDz5Pr/VSfOURlAlsPHH7NhqBm26EGRD elIhr8IQWl3ZOni+DMR8RNbD+H/fFGRSGsTX79XayMd42lQGs3GKxcDCTXWzXGdbmLvs lWMw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:in-reply-to:message-id:mime-version :references:subject:from:to:cc; bh=5kt2Hs53YExhNYpfPSX+vfaUKXrkgz5zWfnPb9H9C5o=; b=DfmL1MHOEhaBK3phBRLzUkql8b1xdF5qHjWB95eS4LUwvXIkfQlCneyBj9U4N0Jge3 Ywow6XsGHi85yoVOgOdk8rfuufD7ueDff2MoJLOKOmPi4SP8jQK4H2vaZ5KmA5vHmvi7 5HCIWAEnp05+gRWoNuUKdVoxgAVJiLHMWIwlgeqmvcw3OWcu9JZiIi7DnRK+LrisdVio P6fwFEPbDWBRw1iFpOeI0xXScgAOYd061gw7viyLLneINsfwurt55TqhK4G8QFF9A4X9 8rNp65pRjUyJ7hIroO6gVMQcIqh1iTHXXaM6sGgD0s3SGeG8oVQoitRw82kVzDA3EEWo Rs7w== X-Gm-Message-State: AOAM532Q985ovFBwgAk1RiFGShuc+hA3U3+GXOAWGtQ+0/PNTCHEPq3j 3v3zLFylUz3QShH2jrVw130oe9cEog== X-Received: from sunrae.c.googlers.com ([fda3:e722:ac3:cc00:7f:e700:c0a8:2814]) (user=rmoar job=sendgmr) by 2002:a17:90b:1182:: with SMTP id gk2mr285811pjb.109.1630105102801; Fri, 27 Aug 2021 15:58:22 -0700 (PDT) Date: Fri, 27 Aug 2021 22:58:11 +0000 In-Reply-To: <20210827225812.3247919-1-rmoar@google.com> Message-Id: <20210827225812.3247919-2-rmoar@google.com> Mime-Version: 1.0 References: <20210827225812.3247919-1-rmoar@google.com> X-Mailer: git-send-email 2.33.0.259.gc128427fd7-goog Subject: [PATCH 1/2] selftests: tool: Add subtest header line and change indentation format in TAP results From: Rae Moar To: brendanhiggins@google.com, davidgow@google.com, dlatypov@google.com, keescook@chromium.org, shuah@kernel.org Cc: kunit-dev@googlegroups.com, linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org, Rae Moar Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This patch is part of a series to alter the format of kselftest TAP results to improve compatibility with proposed KTAP specification (https://lore.kernel.org/linux-kselftest/CA+GJov6tdjvY9x12JsJT14qn6c7NViJxqaJk+r-K1YJzPggFDQ@mail.gmail.com/). Two changes: - Change from "# " to " " for indentation of nested tests - Add subtest header line at start of tests with subtests. Line format is "# Subtest: [name of test]". An example of the new format: Old format: TAP version 13 1..1 # TAP version 13 # 1..1 # # Starting 1 tests from 1 test cases. # # RUN global.get_syscall_info ... # # OK global.get_syscall_info # ok 1 global.get_syscall_info # # PASSED: 1 / 1 tests passed. # # Totals: pass:1 fail:0 xfail:0 xpass:0 skip:0 error:0 ok 1 selftests: ptrace: get_syscall_info New format: TAP version 13 1..1 # Subtest: selftests: ptrace: get_syscall_info TAP version 13 1..1 # Starting 1 tests from 1 test cases. # RUN global.get_syscall_info ... # OK global.get_syscall_info ok 1 global.get_syscall_info # PASSED: 1 / 1 tests passed. # Totals: pass:1 fail:0 xfail:0 xpass:0 skip:0 error:0 ok 1 selftests: ptrace: get_syscall_info Signed-off-by: Rae Moar Change-Id: I139774745310ad2cd6dc5d7740254e48d8226241 --- tools/testing/selftests/kselftest/prefix.pl | 2 +- tools/testing/selftests/kselftest/runner.sh | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/tools/testing/selftests/kselftest/prefix.pl b/tools/testing/selftests/kselftest/prefix.pl index 12a7f4ca2684..e59374b62603 100755 --- a/tools/testing/selftests/kselftest/prefix.pl +++ b/tools/testing/selftests/kselftest/prefix.pl @@ -16,7 +16,7 @@ while (1) { my $bytes = sysread(STDIN, $char, 1); exit 0 if ($bytes == 0); if ($needed) { - print "# "; + print " "; $needed = 0; } print $char; diff --git a/tools/testing/selftests/kselftest/runner.sh b/tools/testing/selftests/kselftest/runner.sh index cc9c846585f0..9b04aeb26d3a 100644 --- a/tools/testing/selftests/kselftest/runner.sh +++ b/tools/testing/selftests/kselftest/runner.sh @@ -23,7 +23,7 @@ fi tap_prefix() { if [ ! -x /usr/bin/perl ]; then - sed -e 's/^/# /' + sed -e 's/^/ /' else "$BASE_DIR"/kselftest/prefix.pl fi @@ -75,7 +75,8 @@ run_one() echo "not ok $test_num $TEST_HDR_MSG" else cd `dirname $TEST` > /dev/null - ((((( tap_timeout ./$BASENAME_TEST 2>&1; echo $? >&3) | + (echo " # Subtest: selftests: $DIR: $BASENAME_TEST" && + (((( tap_timeout ./$BASENAME_TEST 2>&1; echo $? >&3) | tap_prefix >&4) 3>&1) | (read xs; exit $xs)) 4>>"$logfile" && echo "ok $test_num $TEST_HDR_MSG") || @@ -83,7 +84,6 @@ run_one() if [ $rc -eq $skip_rc ]; then \ echo "ok $test_num $TEST_HDR_MSG # SKIP" elif [ $rc -eq $timeout_rc ]; then \ - echo "#" echo "not ok $test_num $TEST_HDR_MSG # TIMEOUT $kselftest_timeout seconds" else echo "not ok $test_num $TEST_HDR_MSG # exit=$rc" -- 2.33.0.259.gc128427fd7-goog