Skip to content

Commit 1678891

Browse files
committed
Add p5-Test-Mock-Cmd: Mock system(), exec(), and qx() for testing
Mock system(), exec(), qx() (AKA `` and readpipe()) with your own functions in order to test code that may call them. Some uses might be: - avoid actually running the system command, just pretend we did (simulate [un]expected output, return values, etc) - test various return value handling (e.g. the system command core dumps how does the object handle that) - test that the arguments that will be passed to a system command are correct - simulate that really hard to reproduce low level edge case to make sure your code works correctly on affected systems - etc etc
1 parent 62cc3ee commit 1678891

File tree

3 files changed

+39
-0
lines changed

3 files changed

+39
-0
lines changed

devel/p5-Test-Mock-Cmd/DESCR

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
Mock system(), exec(), qx() (AKA `` and readpipe()) with your own
2+
functions in order to test code that may call them.
3+
4+
Some uses might be:
5+
6+
- avoid actually running the system command, just pretend we did
7+
(simulate [un]expected output, return values, etc)
8+
- test various return value handling (e.g. the system command core dumps
9+
how does the object handle that)
10+
- test that the arguments that will be passed to a system command
11+
are correct
12+
- simulate that really hard to reproduce low level edge case to make
13+
sure your code works correctly on affected systems
14+
- etc etc

devel/p5-Test-Mock-Cmd/Makefile

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# $NetBSD: Makefile,v 1.1 2024/02/10 01:15:39 schmonz Exp $
2+
3+
DISTNAME= Test-Mock-Cmd-0.7
4+
PKGNAME= p5-${DISTNAME}
5+
CATEGORIES= devel perl5
6+
MASTER_SITES= ${MASTER_SITE_PERL_CPAN:=authors/id/D/DM/DMUEY/}
7+
8+
MAINTAINER= pkgsrc-users@NetBSD.org
9+
HOMEPAGE= https://metacpan.org/pod/Test::Mock::Cmd
10+
COMMENT= Mock system(), exec(), and qx() for testing
11+
LICENSE= ${PERL5_LICENSE}
12+
13+
DEPENDS+= p5-Test-Carp-[0-9]*:../../devel/p5-Test-Carp
14+
15+
PERL5_MODULE_TYPE= Module::Build
16+
PERL5_PACKLIST= auto/Test/Mock/Cmd/.packlist
17+
USE_LANGUAGES= # none
18+
19+
.include "../../lang/perl5/module.mk"
20+
.include "../../mk/bsd.pkg.mk"

devel/p5-Test-Mock-Cmd/distinfo

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
$NetBSD: distinfo,v 1.1 2024/02/10 01:15:39 schmonz Exp $
2+
3+
BLAKE2s (Test-Mock-Cmd-0.7.tar.gz) = 59aeb53c826f8e99773630179c86214234a031abad722b37d03b6259eb929899
4+
SHA512 (Test-Mock-Cmd-0.7.tar.gz) = 5791b27e425fc7d28f7027935ab92f6f0c45fff2647dfdbc3e1b94b578e977659dc9896e56b06052139ad5ff6d063ec5f8bea4700ab3a7de9fbcaf49a765423b
5+
Size (Test-Mock-Cmd-0.7.tar.gz) = 9178 bytes

0 commit comments

Comments
 (0)