bats-core: Import bats-core-1.2.1 as wip/bats-core

Bats is a TAP-compliant testing framework for Bash. It provides a
simple way to verify that the UNIX programs you write behave as
expected.

A Bats test file is a Bash script with special syntax for defining
test cases. Under the hood, each test case is just a function with
a description.
This commit is contained in:
Iku Iwasa 2020-12-12 15:11:02 +09:00
parent 51f614b0c2
commit 92c3fe9b4e
5 changed files with 85 additions and 0 deletions

7
bats-core/DESCR Normal file
View File

@ -0,0 +1,7 @@
Bats is a TAP-compliant testing framework for Bash. It provides a
simple way to verify that the UNIX programs you write behave as
expected.
A Bats test file is a Bash script with special syntax for defining
test cases. Under the hood, each test case is just a function with
a description.

34
bats-core/Makefile Normal file
View File

@ -0,0 +1,34 @@
# $NetBSD$
DISTNAME= bats-core-1.2.1
CATEGORIES= devel
MASTER_SITES= ${MASTER_SITE_GITHUB:=bats-core/}
GITHUB_TAG= v${PKGVERSION_NOREV}
MAINTAINER= iku.iwasa@gmail.com
HOMEPAGE= https://github.com/bats-core/bats-core
COMMENT= Bash Automated Testing System
LICENSE= mit
CONFLICTS+= bats-[0-9]*
USE_LANGUAGES= # none
NO_BUILD= yes
USE_TOOLS+= bash:run
REPLACE_BASH+= bin/bats libexec/bats-core/*
SUBST_CLASSES+= fixsh
SUBST_STAGE.fixsh= pre-configure
SUBST_MESSAGE.fixsh= Enable function import
SUBST_FILES.fixsh= bin/bats libexec/bats-core/*
SUBST_SED.fixsh+= -e '1s,^\#!.*,& --import-functions,'
do-install:
cd ${WRKSRC} && ${SETENV} PKGMANDIR=${PKGMANDIR} ./install.sh ${DESTDIR}${PREFIX}
do-test:
cd ${WRKSRC} && ./bin/bats ./test
.include "../../mk/bsd.pkg.mk"

16
bats-core/PLIST Normal file
View File

@ -0,0 +1,16 @@
@comment $NetBSD$
bin/bats
lib/bats-core/preprocessing.bash
lib/bats-core/test_functions.bash
lib/bats-core/tracing.bash
lib/bats-core/validator.bash
libexec/bats-core/bats
libexec/bats-core/bats-exec-file
libexec/bats-core/bats-exec-suite
libexec/bats-core/bats-exec-test
libexec/bats-core/bats-format-junit
libexec/bats-core/bats-format-pretty
libexec/bats-core/bats-format-tap
libexec/bats-core/bats-preprocess
man/man1/bats.1
man/man7/bats.7

7
bats-core/distinfo Normal file
View File

@ -0,0 +1,7 @@
$NetBSD: distinfo,v 1.2 2016/09/08 14:34:02 jperkin Exp $
SHA1 (bats-core-1.2.1.tar.gz) = 418ca60af55c339ac7911c74a44f7edf41e3a17c
RMD160 (bats-core-1.2.1.tar.gz) = a73f4aa8fbfdb42fe06410cd436e30793b1c1290
SHA512 (bats-core-1.2.1.tar.gz) = 632345e6d83ed930dab23abc03e4797769063bb049ae1bb99e3102dc1e93e5111144ddc61615d05962f7b5bbf72d90ce19a324faf670a3d6e4ce7ab508b0db29
Size (bats-core-1.2.1.tar.gz) = 62685 bytes
SHA1 (patch-install.sh) = 8d6df7eccf4201b6b12bd94bec91e81a6ed9517c

View File

@ -0,0 +1,21 @@
$NetBSD$
Change manpages installation directory.
--- install.sh.orig 2020-12-05 05:08:52.331014166 +0000
+++ install.sh
@@ -12,11 +12,11 @@ if [[ -z "$PREFIX" ]]; then
exit 1
fi
-install -d -m 755 "$PREFIX"/{bin,libexec/bats-core,lib/bats-core,share/man/man{1,7}}
+install -d -m 755 "$PREFIX"/{bin,libexec/bats-core,lib/bats-core,$PKGMANDIR/man{1,7}}
install -m 755 "$BATS_ROOT/bin"/* "$PREFIX/bin"
install -m 755 "$BATS_ROOT/libexec/bats-core"/* "$PREFIX/libexec/bats-core"
install -m 755 "$BATS_ROOT/lib/bats-core"/* "$PREFIX/lib/bats-core"
-install -m 644 "$BATS_ROOT/man/bats.1" "$PREFIX/share/man/man1"
-install -m 644 "$BATS_ROOT/man/bats.7" "$PREFIX/share/man/man7"
+install -m 644 "$BATS_ROOT/man/bats.1" "$PREFIX/$PKGMANDIR/man1"
+install -m 644 "$BATS_ROOT/man/bats.7" "$PREFIX/$PKGMANDIR/man7"
echo "Installed Bats to $PREFIX/bin/bats"