From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from localhost (localhost [127.0.0.1]) by arlo.cworth.org (Postfix) with ESMTP id EC4946DE0A7F for ; Tue, 20 Dec 2016 11:47:19 -0800 (PST) X-Virus-Scanned: Debian amavisd-new at cworth.org X-Spam-Flag: NO X-Spam-Score: 0.223 X-Spam-Level: X-Spam-Status: No, score=0.223 tagged_above=-999 required=5 tests=[AWL=0.093, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, FREEMAIL_ENVFROM_END_DIGIT=0.25, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, SPF_PASS=-0.001] autolearn=disabled Received: from arlo.cworth.org ([127.0.0.1]) by localhost (arlo.cworth.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 7bIJEr350W4G for ; Tue, 20 Dec 2016 11:47:19 -0800 (PST) Received: from mail-lf0-f65.google.com (mail-lf0-f65.google.com [209.85.215.65]) by arlo.cworth.org (Postfix) with ESMTPS id C37D86DE0999 for ; Tue, 20 Dec 2016 11:47:18 -0800 (PST) Received: by mail-lf0-f65.google.com with SMTP id o20so11565500lfg.3 for ; Tue, 20 Dec 2016 11:47:18 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:date:message-id; bh=G+6zS66R7MggUklIQYvHHNgYd1CiNgB9lOdpB9YbhD4=; b=uTz9Z8GFobYgiqTCPXHR42eWC+VTmzs7px+2bjJ6j1xuBK7HDrdJA+6GwPQs0jaJLg oF9z2Dqm7+SVm0Rs6dsCWk+wSDmLryl/uXTbzm4jX3cURwVLqoN9KDrtgPhOfvS51oC8 blyB1znPHTVrGKbPKOsiB0lLJ3lRF0xtYRk/YmHTHQfRy6JY9yl2g/go7cxBw4REF6yt MXRLRaxh6X8qxQ0gk0ef1YvyFWBDjqhdkdG8DOOrOcqLXWAwldGClJM4HUALbGdftkSA B+nlYgug8j9D8yTWvGX3GtGGpoI7yaS9zG8X8KORhLvH0BXhNvsY/e+dv3pxNBIrPvYC rIjw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id; bh=G+6zS66R7MggUklIQYvHHNgYd1CiNgB9lOdpB9YbhD4=; b=nvGMqKl42wZ9gPhsW3qEvLuUOJ6yiyh59uhAfjQaKtwbf+dOFb7vLqRC32SNg6WLL5 z70NwVotKOJevOSkyPnLXkoNB57gDw/QakdXz43QRSp/8D7+vjtzok+fKgmj5Wm6LIBm lthf94J0JITjpUbIV0mdkQYLAatzgYypa79rfUig/EP5rwbzOtlKQ6XakFtkDX7D4Huo zzb42LN/B9Ozt63DCD1tFymtTpB/92yfSZh0413xLpiwFbGDpRQ9g9T3mpBTRyoHs2vw HFq6Zw1/C55f7eM8jBknAJHogSZRT1r+s2btOtQ+OdQGexTFz1m4v3aaLBKRrioM27s+ o0zA== X-Gm-Message-State: AIkVDXLkcj2I12gAZa36o5xp0P+IYYCfbq3QaDBOjU7Uhuce0VfWIGJ4aY/bF7QiVjMzAQ== X-Received: by 10.46.8.25 with SMTP id 25mr475734lji.21.1482263233630; Tue, 20 Dec 2016 11:47:13 -0800 (PST) Received: from bold.lab.local ([91.198.14.118]) by smtp.gmail.com with ESMTPSA id u203sm5063689lff.9.2016.12.20.11.47.12 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 20 Dec 2016 11:47:12 -0800 (PST) From: mp39590@gmail.com To: notmuch@notmuchmail.org Subject: [PATCH] tests: add compatibility layer Date: Tue, 20 Dec 2016 22:47:05 +0300 Message-Id: <20161220194705.46874-1-mp39590@gmail.com> X-Mailer: git-send-email 2.11.0 X-BeenThere: notmuch@notmuchmail.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "Use and development of the notmuch mail system." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Dec 2016 19:47:20 -0000 From: Mikhail Allow to expand aliases in test scritps and add glue to alias native BSD utils into GNU equivalents. --- test/README | 6 ++++++ test/test-lib.sh | 17 +++++++++++++++++ 2 files changed, 23 insertions(+) diff --git a/test/README b/test/README index 104a120e..094e1d33 100644 --- a/test/README +++ b/test/README @@ -33,6 +33,12 @@ chosen directory to your PATH before running the tests. e.g. env PATH=/opt/gnu/bin:$PATH make test +For FreeBSD you will need to install coreutils, which provides GNU +versions of basic utils like 'date' or 'wc'. Also you will need to +install latest gdb from ports or packages and provide path to it in +BSD_GDB variable before executing the tests, native FreeBSD gdb will not +work. + Running Tests ------------- The easiest way to run tests is to say "make test", (or simply run the diff --git a/test/test-lib.sh b/test/test-lib.sh index f55d2c67..96c1e095 100644 --- a/test/test-lib.sh +++ b/test/test-lib.sh @@ -26,6 +26,23 @@ fi # Make sure echo builtin does not expand backslash-escape sequences by default. shopt -u xpg_echo +# OS independent functions +# +# Alias native BSD utilities to usable GNU equivalents. +case `uname` in +FreeBSD) + # allow using aliases in scripts + shopt -s expand_aliases + + alias date=gdate + alias base64=gbase64 + alias gdb=$BSD_GDB + alias wc=gwc + alias sed="gsed" + alias sha256sum=gsha256sum + ;; +esac + this_test=${0##*/} this_test=${this_test%.sh} this_test_bare=${this_test#T[0-9][0-9][0-9]-} -- 2.11.0