From mboxrd@z Thu Jan 1 00:00:00 1970 From: Thomas Gummerer Subject: [PATCH v2 1/3] test-lib: introduce "modern" style tests Date: Mon, 23 Sep 2013 23:08:44 +0200 Message-ID: <1379970526-27997-2-git-send-email-t.gummerer@gmail.com> References: <1379970526-27997-1-git-send-email-t.gummerer@gmail.com> Cc: trast@inf.ethz.ch, git@vger.kernel.org, t.gummerer@gmail.com To: gitster@pobox.com X-From: git-owner@vger.kernel.org Mon Sep 23 23:09:57 2013 Return-path: Envelope-to: gcvg-git-2@plane.gmane.org Received: from vger.kernel.org ([209.132.180.67]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1VODOF-0007tb-GM for gcvg-git-2@plane.gmane.org; Mon, 23 Sep 2013 23:09:56 +0200 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753912Ab3IWVJu (ORCPT ); Mon, 23 Sep 2013 17:09:50 -0400 Received: from mail-pb0-f42.google.com ([209.85.160.42]:44341 "EHLO mail-pb0-f42.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753603Ab3IWVJt (ORCPT ); Mon, 23 Sep 2013 17:09:49 -0400 Received: by mail-pb0-f42.google.com with SMTP id un15so3705699pbc.29 for ; Mon, 23 Sep 2013 14:09:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=zgiyrTOTuwge8afiTgDn9l4Mn86WyiZOfUWCsn3Hecw=; b=Gx5fhI6OcL1Ynq02aLMr4gOiOa6JV67d0rCHN8mzjMJLt7w0DoJG3oPA8UdHNxOAYQ iAdnSfOu1GZMvQt0S2gwyIr9yeN0Bk3U+WbS5P4P3v7VaqGGuCiCI2w/6YjfbmHhUlgD FowR7eswFEGaxuswziXTyomxMaDjkckGICn00JJzgYrtfNIB9KeZAAXsVDbLzdi61lx6 SFsDiu1jqK9zr5vhldFFdcfbmKlEIyXEcG3KP68w+2uwNpXfdoQYARwTF+VVPFax0foD cCNtaOm54sRShe6cMKj1VoKmY4Ori9bHaHp5Rq2RNh+bq8OWO0XllyV6knMk5gOEsJLN BcVg== X-Received: by 10.68.200.100 with SMTP id jr4mr25724813pbc.0.1379970588623; Mon, 23 Sep 2013 14:09:48 -0700 (PDT) Received: from localhost ([216.18.212.218]) by mx.google.com with ESMTPSA id bb1sm36235533pbc.10.1969.12.31.16.00.00 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Mon, 23 Sep 2013 14:09:48 -0700 (PDT) X-Mailer: git-send-email 1.8.3.4.1241.g1ce9896 In-Reply-To: <1379970526-27997-1-git-send-email-t.gummerer@gmail.com> Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org Archived-At: From: Junio C Hamano Add a new, extensible style for tests that allows the addition of new parameters other than the prerequitites Signed-off-by: Junio C Hamano Signed-off-by: Thomas Gummerer --- t/README | 24 +++++++++++++++-- t/perf/README | 12 ++++++++- t/perf/perf-lib.sh | 17 +++++------- t/t0008-ignores.sh | 34 +++++++++++------------ t/test-lib-functions.sh | 72 ++++++++++++++++++++++++++++++++++++++----------- 5 files changed, 114 insertions(+), 45 deletions(-) diff --git a/t/README b/t/README index 2167125..bf41c29 100644 --- a/t/README +++ b/t/README @@ -390,6 +390,12 @@ below), e.g.: "$PERL_PATH" -e "hlagh() if unf_unf()" ' +or in the "modern" form, specifying the prerequisite as a parameter, e.g.: + + test_expect_success --prereq PERL 'I need Perl' ' + "$PERL_PATH" -e "hlagh() if unf_unf()" + ' + The advantage of skipping tests like this is that platforms that don't have the PERL and other optional dependencies get an indication of how many tests they're missing. @@ -422,6 +428,7 @@ There are a handful helper functions defined in the test harness library for your script to use. - test_expect_success []