From patchwork Tue Apr 9 23:55:50 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kees Cook X-Patchwork-Id: 10892871 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 103F617EF for ; Tue, 9 Apr 2019 23:56:10 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id EE22428701 for ; Tue, 9 Apr 2019 23:56:09 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E21D428387; Tue, 9 Apr 2019 23:56:09 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3E42228727 for ; Tue, 9 Apr 2019 23:56:09 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726592AbfDIX4I (ORCPT ); Tue, 9 Apr 2019 19:56:08 -0400 Received: from mail-pl1-f169.google.com ([209.85.214.169]:37057 "EHLO mail-pl1-f169.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726680AbfDIX4I (ORCPT ); Tue, 9 Apr 2019 19:56:08 -0400 Received: by mail-pl1-f169.google.com with SMTP id w23so200412ply.4 for ; Tue, 09 Apr 2019 16:56:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id; bh=m+xHmbzCf9TqzjnRM8q33BirfbzrbQwhWtwbaCg4yds=; b=GVUHBwH3bIuSGGXcMnenno2mFr9/cRejY1AiID+A1bL8uASJxvsPSGDI3hLs2sGCRP P1qJakID5OOQlrOccgpuqdLKZnxJbHmQWods37K7E+k82wBoyg9fSGDpjLkIhuXEFATp wio3e0aGlx3XxM/xrFlV69oLCsSfS8XkiW+/s= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=m+xHmbzCf9TqzjnRM8q33BirfbzrbQwhWtwbaCg4yds=; b=hYFvZxYNW5GNfCSj7gBnkINKYIE1Ce+Ws/h8v15hk4GEQ7Swrbb7iaKinuHdb6qGNT xHIaXfqXHXLHhJTRWoJ//fHsjePw6m8KMO65xlbn2cZpXJm5hnEvgef+JMiBpD6ISxvt kz3TH3nxie0FhWTJHkuHeHFqkJvDujBV1+HFBkcsHDEqMRQfNoNM1sEwJbJFKXO/4za/ ZTcMGQKFUdd1lxLYlTTDRjnm50y8vqwRsBoblUFLG5y8gAX6YAlAT0svAJKj0AdBQAJ2 yPtoDWTJktcZQAznpocKnvtgGdCrwKtoRjRPBYtvIlrQygHKDrhwKLMnMKrbHST8fVTJ oPeA== X-Gm-Message-State: APjAAAV9LuSb99a5p3HZNK+VHf/2OxCGRvJmXB0DPXr2aKLTUtFAYRCa nROp08595kb7VeDGJ6qFCsJ/mEhIMgg= X-Google-Smtp-Source: APXvYqxJecsNZjZlCmsAaPXTgP4iF3oO6XfspJM7Q1aW/hk3sOMP6Ay4nyGvQidMc/PIW5KF+c9kXQ== X-Received: by 2002:a17:902:e7:: with SMTP id a94mr40312957pla.114.1554854167966; Tue, 09 Apr 2019 16:56:07 -0700 (PDT) Received: from www.outflux.net (173-164-112-133-Oregon.hfc.comcastbusiness.net. [173.164.112.133]) by smtp.gmail.com with ESMTPSA id s15sm39241178pga.71.2019.04.09.16.56.05 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 09 Apr 2019 16:56:05 -0700 (PDT) From: Kees Cook To: Shuah Khan Cc: Kees Cook , linux-kselftest@vger.kernel.org Subject: [PATCH 0/6] selftests: Move test output to diagnostic lines Date: Tue, 9 Apr 2019 16:55:50 -0700 Message-Id: <20190409235556.3967-1-keescook@chromium.org> X-Mailer: git-send-email 2.17.1 Sender: linux-kselftest-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kselftest@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP This refactors the selftest Makefiles to extract the test running logic to be reused between "run_tests" and "emit_tests", while also fixing up the test output to be TAP version 13 compliant: - added "plan" line - fixed result line syntax - moved all test output to be "# "-prefixed as TAP "diagnostic" lines The prefixing code includes a fallback mode for limited execution environments. -Kees Kees Cook (6): selftests: Extract single-test shell logic from lib.mk selftests: Use runner.sh for emit targets selftests: Extract logic for multiple test runs selftests/runner: Add plan line and fix result line syntax selftests/runner: Distinguish between missing and non-executable selftests: Move test output to diagnostic lines tools/testing/selftests/.gitignore | 1 - tools/testing/selftests/Makefile | 18 +++-- tools/testing/selftests/kselftest/prefix.pl | 23 ++++++ tools/testing/selftests/kselftest/runner.sh | 80 +++++++++++++++++++++ tools/testing/selftests/lib.mk | 61 +++------------- 5 files changed, 119 insertions(+), 64 deletions(-) create mode 100755 tools/testing/selftests/kselftest/prefix.pl create mode 100644 tools/testing/selftests/kselftest/runner.sh