Skip to content

Commit

Permalink
Add p5-Test-Mock-Cmd: Mock system(), exec(), and qx() for testing
Browse files Browse the repository at this point in the history
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
  • Loading branch information
schmonz committed Feb 10, 2024
1 parent 62cc3ee commit 1678891
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 0 deletions.
14 changes: 14 additions & 0 deletions devel/p5-Test-Mock-Cmd/DESCR
@@ -0,0 +1,14 @@
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
20 changes: 20 additions & 0 deletions devel/p5-Test-Mock-Cmd/Makefile
@@ -0,0 +1,20 @@
# $NetBSD: Makefile,v 1.1 2024/02/10 01:15:39 schmonz Exp $

DISTNAME= Test-Mock-Cmd-0.7
PKGNAME= p5-${DISTNAME}
CATEGORIES= devel perl5
MASTER_SITES= ${MASTER_SITE_PERL_CPAN:=authors/id/D/DM/DMUEY/}

MAINTAINER= pkgsrc-users@NetBSD.org
HOMEPAGE= https://metacpan.org/pod/Test::Mock::Cmd
COMMENT= Mock system(), exec(), and qx() for testing
LICENSE= ${PERL5_LICENSE}

DEPENDS+= p5-Test-Carp-[0-9]*:../../devel/p5-Test-Carp

PERL5_MODULE_TYPE= Module::Build
PERL5_PACKLIST= auto/Test/Mock/Cmd/.packlist
USE_LANGUAGES= # none

.include "../../lang/perl5/module.mk"
.include "../../mk/bsd.pkg.mk"
5 changes: 5 additions & 0 deletions devel/p5-Test-Mock-Cmd/distinfo
@@ -0,0 +1,5 @@
$NetBSD: distinfo,v 1.1 2024/02/10 01:15:39 schmonz Exp $

BLAKE2s (Test-Mock-Cmd-0.7.tar.gz) = 59aeb53c826f8e99773630179c86214234a031abad722b37d03b6259eb929899
SHA512 (Test-Mock-Cmd-0.7.tar.gz) = 5791b27e425fc7d28f7027935ab92f6f0c45fff2647dfdbc3e1b94b578e977659dc9896e56b06052139ad5ff6d063ec5f8bea4700ab3a7de9fbcaf49a765423b
Size (Test-Mock-Cmd-0.7.tar.gz) = 9178 bytes

0 comments on commit 1678891

Please sign in to comment.