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 21C406DE0999 for ; Mon, 2 Jan 2017 05:57:32 -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 gIFDo05qa4jC for ; Mon, 2 Jan 2017 05:57:30 -0800 (PST) Received: from mail-lf0-f67.google.com (mail-lf0-f67.google.com [209.85.215.67]) by arlo.cworth.org (Postfix) with ESMTPS id 083C86DE014D for ; Mon, 2 Jan 2017 05:57:30 -0800 (PST) Received: by mail-lf0-f67.google.com with SMTP id y21so40151945lfa.0 for ; Mon, 02 Jan 2017 05:57:29 -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=6D/aF+ibRSA4NxxbTCNqst2jONJRhs0xBg88AJLuZPU=; b=bvg4zvulmUGwJoOkegrGmMpDflvriaWrj1vwVPdwsmZ9FcXUVqvX0vUYO192HNlmZl 1PRCqsJAsotyJTdUTs+LyvKaD2n/y4HdMzx61FMNKt4apBun5PzqmyF+Dreul773+TdB tkKDz6VShwbdbaPYX7emY2G2Xuy80l0jZmv5x+TwrwrwQcQrt0xbJBlTdf2IIFRlOWRD n53htCMJ+7Zo+QDr/e7+GR3iKMilXT/dHfd2hjKiHKQh5xlBvPQ3KxBZCFqhBks+yMwm QfixsW0dFqzZhc43K2DFXyeJvYhwDgeVDO7kz3HW5P/yH4+oNpxn3ANzZFW0Wu6e+JQA qVTw== 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=6D/aF+ibRSA4NxxbTCNqst2jONJRhs0xBg88AJLuZPU=; b=lqZcH5/OObUgLCINmQVys10zhz8+epDU5wvXkhq4G+LI45QO2L3igO7LzJp7dOD0Xq 479eK0rRL7XZowHA1jPlRSyfH83ckb1TiuYqMe0rDP3ARc7JfbIW68Yq1zJ36zACGf4d ymKoQK4Eyr8yHft7mLnpxaT2X+ET2bjz51LEUj6kblDiJYcXx51UffnmCYHMmNqQh+41 bAiro0t6kexFQPzDeJG+brQyqYNDrc+kUX/Zj4ntGHypBkTWlVylpU3dzFJ+kOfbsAwm Qr4IUFY9jQVcZ1zQF5rFHxT0ASe7S6WLW0AgBo8RBNr8eV/LaFn7/jg2/XZvrJvbInJw 0qCw== X-Gm-Message-State: AIkVDXKtNIUs4lyqqd9lXgri32MQiTmVgfeW97EMvaohhMwUXue5s6E2qz92xvMF+wHhpg== X-Received: by 10.25.141.15 with SMTP id p15mr20991296lfd.140.1483365446335; Mon, 02 Jan 2017 05:57:26 -0800 (PST) Received: from bold.lab.local ([91.198.14.118]) by smtp.gmail.com with ESMTPSA id 204sm16034847ljj.33.2017.01.02.05.57.25 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 02 Jan 2017 05:57:25 -0800 (PST) From: mp39590@gmail.com To: notmuch@notmuchmail.org Subject: [PATCH] tests: add compatibility layer Date: Mon, 2 Jan 2017 16:57:21 +0300 Message-Id: <20170102135721.93882-1-mp39590@gmail.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <87lguwfjhw.fsf@rocinante.cs.unb.ca> References: <87lguwfjhw.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: Mon, 02 Jan 2017 13:57:32 -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..8376616f 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 +NOTMUCH_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..b8039705 --- /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 () { $NOTMUCH_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