X-Original-To: alpine-aports@mail.alpinelinux.org Delivered-To: alpine-aports@mail.alpinelinux.org Received: from mail.alpinelinux.org (dallas-a1.alpinelinux.org [127.0.0.1]) by mail.alpinelinux.org (Postfix) with ESMTP id 449B4DC6420 for ; Sun, 25 Oct 2015 15:16:49 +0000 (UTC) Received: from mail-wi0-f173.google.com (mail-wi0-f173.google.com [209.85.212.173]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mail.alpinelinux.org (Postfix) with ESMTPS id B2F1CDC003A for ; Sun, 25 Oct 2015 15:16:48 +0000 (UTC) Received: by wikq8 with SMTP id q8so133047976wik.1 for ; Sun, 25 Oct 2015 08:16:46 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=Ri7HkdrNsMnBb0FIrCFlQDS2s7THydB5yCSmi/dMMw4=; b=PLSKhsXKQsph8lHJQYi3YdZvgZB5AbhyzGvva0NI3VMOc7xPdXSeYt2nVVp4dO7Ney TCq4wI8ODRFDg65vwJyLqQo5TGOthgQpJq61WSji+qyekKpmUqbudd5Bethz70/Eojpl +uRzMvSKDhU4/rX5SWKGhmY/DP2qF3glnCS4onovHYgtRdpEbj338p4dXcAQl6G4oyo8 fqlmLK/3vov78t0HCbfbRIG+z4zX70TlB98wLk9vcysjeeyaF3IlGk8G5nchmylMYQZr 62EeAv2aBJRYPDpOUHsAqIppcObhFN1EMqtpSjJKoMCOpOSEDKdpxqycGMkbmZkw5ibJ 7dJg== X-Gm-Message-State: ALoCoQksl7oXfstr3rrStgkPiDKtPHf6jwn9bH8pEZoH4s6x8njb2Cgr5NSghDExn1GSrpAPTxsA X-Received: by 10.194.20.135 with SMTP id n7mr15218907wje.95.1445786206729; Sun, 25 Oct 2015 08:16:46 -0700 (PDT) Received: from localhost (pD9579E77.dip0.t-ipconnect.de. [217.87.158.119]) by smtp.gmail.com with ESMTPSA id gl4sm34001459wjd.49.2015.10.25.08.16.45 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 25 Oct 2015 08:16:46 -0700 (PDT) From: Christian Kampka To: alpine-aports@lists.alpinelinux.org Cc: Christian Kampka Subject: [alpine-aports] [PATCH] testing/roundup: new aport Date: Sun, 25 Oct 2015 16:16:43 +0100 Message-Id: <1445786203-13919-1-git-send-email-christian@kampka.net> X-Mailer: git-send-email 2.6.1 X-Virus-Scanned: ClamAV using ClamSMTP X-Mailinglist: alpine-aports Precedence: list List-Id: Alpine Development List-Unsubscribe: List-Post: List-Help: List-Subscribe: --- testing/roundup/APKBUILD | 47 ++++++++++++++++++++++ .../roundup-avoid-bash-syntax-in-tests.patch | 17 ++++++++ .../roundup/roundup-fix-busybox-shell-opts.patch | 19 +++++++++ 3 files changed, 83 insertions(+) create mode 100644 testing/roundup/APKBUILD create mode 100644 testing/roundup/roundup-avoid-bash-syntax-in-tests.patch create mode 100644 testing/roundup/roundup-fix-busybox-shell-opts.patch diff --git a/testing/roundup/APKBUILD b/testing/roundup/APKBUILD new file mode 100644 index 0000000..81ebce2 --- /dev/null +++ b/testing/roundup/APKBUILD @@ -0,0 +1,47 @@ +# Maintainer: Christian Kampka +pkgname=roundup +pkgver=0.0.6 +pkgrel=1 +pkgdesc="A a unit testing tool for running roundup(5) test plans which are +written in any POSIX shell." +url=https://github.com/bmizerany/roundup/ +arch="all" +license="MIT" +depends= +makedeps="ncurses" +source="$pkgname-$pkgver.tar.gz::https://github.com/bmizerany/$pkgname/archive/v$pkgver.tar.gz + $pkgname-fix-busybox-shell-opts.patch + $pkgname-avoid-bash-syntax-in-tests.patch + " + +_builddir="$srcdir"/$pkgname-$pkgver + +prepare() { + #patches + cd "$_builddir" + for i in $source; do + local p=${i##*/} + case $i in + *.patch) msg $p; patch -p1 -i "$srcdir"/$p || return 1;; + esac + done +} + +build() { + cd $_builddir + /bin/sh roundup.sh roundup-1-test.sh +} + +package() { + install -Dm755 $_builddir/roundup.sh $pkgdir/usr/bin/$pkgname +} + +md5sums="607023b4fe4e42fdc2f0cb14b4138b2e roundup-0.0.6.tar.gz +a7d12efbf88919a1e2fc9b7ed143fd9c roundup-fix-busybox-shell-opts.patch +dddd5610d03f2c1237c295c564c291c4 roundup-avoid-bash-syntax-in-tests.patch" +sha256sums="20741043ed5be7cbc54b1e9a7c7de122a0dacced77052e90e4ff08e41736f01c roundup-0.0.6.tar.gz +31e00fc54fa806aaa1a3199dd13b596b36e8f57685c7524db125bf87a949845b roundup-fix-busybox-shell-opts.patch +e8829b4459a5e3d65949e564cf69e307e7b6fe11758d9becc9426a164bb4a812 roundup-avoid-bash-syntax-in-tests.patch" +sha512sums="a7a249d16467bd3835d555288ec6c3d84a36f2f7f2ae5da90e7624bc76a7741788499fd635d3001c086923914870392c23d765ca07ab7c97e58b9deec9989827 roundup-0.0.6.tar.gz +13cf848227958e83fabf6cde96e1ac347199ad107d6a5daa07e23a976cc8613a0368447295afb310a817c8d6aeb52b96d12d58984a929114decc2c16098ddd7c roundup-fix-busybox-shell-opts.patch +526cca7805fb55de24df79482e3daa2253fc26db2db662229894b8ad56e79a8a45ad716e0c0241765455bda0a4c45344a9ea7c001860d3f8ca41f0c00e3954f9 roundup-avoid-bash-syntax-in-tests.patch" diff --git a/testing/roundup/roundup-avoid-bash-syntax-in-tests.patch b/testing/roundup/roundup-avoid-bash-syntax-in-tests.patch new file mode 100644 index 0000000..ecd2f07 --- /dev/null +++ b/testing/roundup/roundup-avoid-bash-syntax-in-tests.patch @@ -0,0 +1,17 @@ +diff --git a/roundup-5-test.sh b/roundup-5-test.sh +index 250a586..8e8739a 100644 +--- a/roundup-5-test.sh ++++ b/roundup-5-test.sh +@@ -87,10 +87,10 @@ it_runs_after_if_a_test_fails_part_2() { + + # Output the correct return code of a failing command of a testcase. + it_outputs_the_return_code_7() { +- function f() { return 42; } ++ f() { return 42; } + x=$(echo asdf) + +- function g() { return 7; } ++ g() { return 7; } + g + } + diff --git a/testing/roundup/roundup-fix-busybox-shell-opts.patch b/testing/roundup/roundup-fix-busybox-shell-opts.patch new file mode 100644 index 0000000..b6185e9 --- /dev/null +++ b/testing/roundup/roundup-fix-busybox-shell-opts.patch @@ -0,0 +1,19 @@ +diff --git a/roundup.sh b/roundup.sh +index d7465dc..38d7efe 100755 +--- a/roundup.sh ++++ b/roundup.sh +@@ -258,9 +258,11 @@ do + + # exit subshell with return code of last failing command. This + # is needed to see the return code 253 on failed assumptions. +- # But, only do this if the error handling is activated. +- set -E +- trap 'rc=$?; set +x; set -o | grep "errexit.*on" >/dev/null && exit $rc' ERR ++ # But, only do this if the error handling is activated and only if the shell supports it ++ if set -o | grep "^errtrace" >/dev/null; then ++ set -o errtrace ++ trap 'rc=$?; set +x; set -o | grep "errexit.*on" >/dev/null && exit $rc' ERR ++ fi + + # If `before` wasn't redefined, then this is `:`. + before -- 2.6.1 --- Unsubscribe: alpine-aports+unsubscribe@lists.alpinelinux.org Help: alpine-aports+help@lists.alpinelinux.org ---