Skip to content

Commit 5d83216

Browse files
committed
Add sharness: Shell library to test your tools like Git does
Sharness is a portable shell library to write, run, and analyze automated tests for Unix programs. Since all tests output the Test Anything Protocol, they can be run with any TAP harness. Each test is written as a shell script.
1 parent f90f76e commit 5d83216

File tree

5 files changed

+90
-0
lines changed

5 files changed

+90
-0
lines changed

devel/sharness/DESCR

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
Sharness is a portable shell library to write, run, and analyze
2+
automated tests for Unix programs. Since all tests output the Test
3+
Anything Protocol, they can be run with any TAP harness. Each test is
4+
written as a shell script.

devel/sharness/Makefile

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# $NetBSD: Makefile,v 1.1 2024/02/19 20:50:43 schmonz Exp $
2+
3+
DISTNAME= sharness-v1.2.0
4+
PKGNAME= ${DISTNAME:S/-v/-/}
5+
CATEGORIES= devel
6+
MASTER_SITES= ${MASTER_SITE_GITHUB:=felipec/}
7+
GITHUB_TAG= v${PKGVERSION_NOREV}
8+
9+
MAINTAINER= schmonz@NetBSD.org
10+
HOMEPAGE= https://felipec.github.io/sharness/
11+
COMMENT= Shell library to test your tools like Git does
12+
LICENSE= gnu-gpl-v2
13+
14+
USE_LANGUAGES= # none
15+
USE_TOOLS+= gmake perl
16+
NO_BUILD= yes
17+
REPLACE_SH= sharness.sh tools/aggregate-results.sh
18+
REPLACE_SH+= test/sharness.sh test/aggregate-results.sh
19+
REPLACE_SH+= lib-sharness/functions.sh
20+
21+
TEST_DIRS= test
22+
TEST_TARGET= all
23+
24+
TEST_DEPENDS+= p5-IO-tty-[0-9]*:../../devel/p5-IO-Tty
25+
26+
.include "../../mk/bsd.pkg.mk"

devel/sharness/PLIST

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
@comment $NetBSD: PLIST,v 1.1 2024/02/19 20:50:43 schmonz Exp $
2+
share/doc/sharness/API.md
3+
share/doc/sharness/CHANGELOG.md
4+
share/doc/sharness/COPYING
5+
share/doc/sharness/README.git
6+
share/doc/sharness/README.md
7+
share/doc/sharness/example/Makefile
8+
share/doc/sharness/example/simple.t
9+
share/sharness/lib-sharness/functions.sh
10+
share/sharness/sharness.sh
11+
share/sharness/tools/aggregate-results.sh

devel/sharness/distinfo

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
$NetBSD: distinfo,v 1.1 2024/02/19 20:50:43 schmonz Exp $
2+
3+
BLAKE2s (sharness-v1.2.0.tar.gz) = d0cbec657c160e279125b3f189f3801a5c93e407bd83ac3c2e14edee34a3422d
4+
SHA512 (sharness-v1.2.0.tar.gz) = b6b346b14bdbd387bc111b8caa83b03b77195f43e0f9c774f489de431d41a0cf258edf2bec136d78ddd49236ce1e71e4cddb33d163148d05600501c414e48fca
5+
Size (sharness-v1.2.0.tar.gz) = 42532 bytes
6+
SHA1 (patch-Makefile) = a17c1e8d71f5c8084a7cd62e4a352360c4848a55
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
$NetBSD: patch-Makefile,v 1.1 2024/02/19 20:50:43 schmonz Exp $
2+
3+
Use pkgsrc paths.
4+
5+
--- Makefile.orig 2024-02-19 20:42:16.814963277 +0000
6+
+++ Makefile
7+
@@ -1,6 +1,6 @@
8+
-prefix = $(HOME)
9+
+prefix = $(PREFIX)
10+
11+
-INSTALL_DIR = $(prefix)/share/sharness
12+
+SHARNESS_DIR = $(prefix)/share/sharness
13+
DOC_DIR = $(prefix)/share/doc/sharness
14+
EXAMPLE_DIR = $(DOC_DIR)/example
15+
VIM_DIR = $(prefix)/.vim/pack/filetypes/start/sharness
16+
@@ -19,13 +19,13 @@ scripts = sharness.sh lib-sharness/funct
17+
all:
18+
19+
install: all
20+
- $(INSTALL) -d -m 755 $(D)$(INSTALL_DIR) $(D)$(INSTALL_DIR)/lib-sharness $(D)$(INSTALL_DIR)/tools $(D)$(DOC_DIR) $(D)$(EXAMPLE_DIR)
21+
- $(INSTALL) -m 644 sharness.sh $(D)$(INSTALL_DIR)
22+
- $(INSTALL) -m 644 lib-sharness/functions.sh $(D)$(INSTALL_DIR)/lib-sharness
23+
- $(INSTALL) -m 644 tools/aggregate-results.sh $(D)$(INSTALL_DIR)/tools
24+
+ $(INSTALL) -d -m 755 $(D)$(SHARNESS_DIR) $(D)$(SHARNESS_DIR)/lib-sharness $(D)$(SHARNESS_DIR)/tools $(D)$(DOC_DIR) $(D)$(EXAMPLE_DIR)
25+
+ $(INSTALL) -m 644 sharness.sh $(D)$(SHARNESS_DIR)
26+
+ $(INSTALL) -m 644 lib-sharness/functions.sh $(D)$(SHARNESS_DIR)/lib-sharness
27+
+ $(INSTALL) -m 644 tools/aggregate-results.sh $(D)$(SHARNESS_DIR)/tools
28+
$(INSTALL) -m 644 $(DOC_FILES) $(D)$(DOC_DIR)
29+
$(INSTALL) -m 644 example/Makefile $(D)$(EXAMPLE_DIR)
30+
- $(SED) -e "s!\. \./sharness.sh!\. $(INSTALL_DIR)/sharness.sh!" example/simple.t > $(D)$(EXAMPLE_DIR)/simple.t
31+
+ $(SED) -e "s!\. \./sharness.sh!\. $(SHARNESS_DIR)/sharness.sh!" example/simple.t > $(D)$(EXAMPLE_DIR)/simple.t
32+
chmod 755 $(D)$(EXAMPLE_DIR)/simple.t
33+
34+
install-test:
35+
@@ -36,7 +36,7 @@ install-vim:
36+
$(CP) -r vim/* $(D)$(VIM_DIR)
37+
38+
uninstall:
39+
- $(RM) -r $(INSTALL_DIR) $(DOC_DIR) $(EXAMPLE_DIR)
40+
+ $(RM) -r $(SHARNESS_DIR) $(DOC_DIR) $(EXAMPLE_DIR)
41+
42+
doc: all
43+
{ printf "# Sharness API\n\n"; \

0 commit comments

Comments
 (0)