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 D49EC6DE0BF6 for ; Thu, 22 Dec 2016 01:31:34 -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_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 YBNPXAKqytP6 for ; Thu, 22 Dec 2016 01:31:32 -0800 (PST) Received: from mail-lf0-f68.google.com (mail-lf0-f68.google.com [209.85.215.68]) by arlo.cworth.org (Postfix) with ESMTPS id DF9AA6DE0AF4 for ; Thu, 22 Dec 2016 01:31:31 -0800 (PST) Received: by mail-lf0-f68.google.com with SMTP id d16so3719305lfb.1 for ; Thu, 22 Dec 2016 01:31:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:date:message-id:in-reply-to:references; bh=T9jawaHhG3ME/GTufpKSl8LSMubB1OhJcn6QmmFzdfs=; b=jB5HlDMijyPcUPIwSP8GeHMiJ92/PplELTuCACDM87yVvATeJNOwTFGtmAFkpuPhp5 gaWHxEmiCi1gP1dvV7er+DodCEbUjC5R7Px3yGGi21tX1SmTPfphVW4HHoam/CvdynUG 1IEuKW8GdKtBFA/7rmRPNzesQP/oo/W1WfLOw05dN7u1skGgfcwn1VMyEB4foRQXSfOG qsIsD9SckzlFGQ9FAbPS0d5lIENo495xZ+d0TkxZGWhfspt4GBa3N0CjJYVZ09ayUFRz 4s3FI6WdBoBOZ8zVslNjLjG3R+B86NGtVztSMEuDZRIY0AoFtkW2TBxe6A59dpUhfmNi QmPw== 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:in-reply-to :references; bh=T9jawaHhG3ME/GTufpKSl8LSMubB1OhJcn6QmmFzdfs=; b=NYmkU5md8Ruc5G+LzUIb/GSLvHpeRcDriLfV0pPKtvLdkYhHdHONuWouGg5ZPHAepi 3M8L4vOkK69n0gl0IdHAaVe9Lx7+c35A/1GWJUhPgMh5FiZmbsTnXTYb61ttYB43eCtE 5tucw8jdD1RxAln2PcjzoM3i2FOAqGWatqCntKix7HQsNjiuUC8z0uxvshNGsGNdFz7T WqJQcAp8Hh9H3K8lTqCM1lynV7IclfRC0gFvpgmZB8HvGyAryQJ2847sb+KqJxENwFN+ JH0+TJ24ikxkDXG0yy0vHvM2yAThmMlZnFa3cE3K16qd799xkLfxk0X8gpmHrM4+Kj0M h60g== X-Gm-Message-State: AIkVDXKmqqOHFbGneMOJg9qamG1S0vYPUNjVAlRIg7RLVx/gCqIyGgU3CigozbC7tcMC2g== X-Received: by 10.46.74.9 with SMTP id x9mr4431491lja.40.1482399088989; Thu, 22 Dec 2016 01:31:28 -0800 (PST) Received: from bold.lab.local ([91.198.14.118]) by smtp.gmail.com with ESMTPSA id k7sm6760705lfe.37.2016.12.22.01.31.28 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 22 Dec 2016 01:31:28 -0800 (PST) From: mp39590@gmail.com To: notmuch@notmuchmail.org Subject: [PATCH] tests: add compatibility layer Date: Thu, 22 Dec 2016 12:31:20 +0300 Message-Id: <20161222093120.41803-1-mp39590@gmail.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <87tw9y2q8i.fsf@rocinante.cs.unb.ca> References: <87tw9y2q8i.fsf@rocinante.cs.unb.ca> 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: Thu, 22 Dec 2016 09:31:34 -0000 From: Mikhail Make test-lib-common.sh load test-lib-<$PLATFORM>.sh to create additional shim for platform specifics. Use test-lib-FREEBSD.sh to call GNU utilities instead of native ones. --- configure | 3 +++ test/README | 6 ++++++ test/test-lib-FREEBSD.sh | 8 ++++++++ test/test-lib-common.sh | 5 +++++ 4 files changed, 22 insertions(+) create mode 100644 test/test-lib-FREEBSD.sh diff --git a/configure b/configure index 72db26df..7ba9b9eb 100755 --- a/configure +++ b/configure @@ -1203,6 +1203,9 @@ NOTMUCH_PYTHON=${python} # Are the ruby development files (and ruby) available? If not skip # building/testing ruby bindings. NOTMUCH_HAVE_RUBY_DEV=${have_ruby_dev} + +# Platform we are run on +PLATFORM=${platform} EOF # Finally, after everything configured, inform the user how to continue. 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-FREEBSD.sh b/test/test-lib-FREEBSD.sh new file mode 100644 index 00000000..24079689 --- /dev/null +++ b/test/test-lib-FREEBSD.sh @@ -0,0 +1,8 @@ +# Use GNU Coreutils instead of a native BSD utils + +date () { gdate "$@"; } +base64 () { gbase64 "$@"; } +gdb () { $BSD_GDB "$@"; } +wc () { gwc "$@"; } +sed () { gsed "$@"; } +sha256sum () { gsha256sum "$@"; } diff --git a/test/test-lib-common.sh b/test/test-lib-common.sh index 03ef1d2d..1c8d7f6e 100644 --- a/test/test-lib-common.sh +++ b/test/test-lib-common.sh @@ -66,6 +66,11 @@ export LD_LIBRARY_PATH # configure output . $notmuch_path/sh.config || exit 1 +# load OS specifics +if [ -e ./test-lib-$PLATFORM.sh ]; then + . ./test-lib-$PLATFORM.sh +fi + if test -n "$valgrind" then make_symlink () { -- 2.11.0