-
-
26 Nov 2021 14:49:16 UTC
- Distribution: Test-Catch
- Module version: 2.0.0
- Source (raw)
- Pod Source (raw)
- Browse (raw)
- Changes
- How to Contribute
- Issues (0)
- Testers (508 / 0 / 43)
- Kwalitee
Bus factor: 3- License: unknown
- Perl: v5.18.0
- Activity
24 month- Tools
- Download (7.02KB)
- MetaCPAN Explorer
- Permissions
- Subscribe to distribution
- Permalinks
- This version
- Latest version
- Dependencies
- Test::More
- Test::Simple
- XS::Install
- XS::libcatch
- and possibly others
- Reverse dependencies
- CPAN Testers List
- Dependency graph
NAME
Test::Catch - Run C++ catch tests from perl test file
SYNOPSIS
in Makefile.PL
use XS::Install; WriteMakefile( ... BIN_DEPS => 'Test::Catch', test => { SRC => 't', # make all C files compile in 't' folder into separate SO file when 'make test' # it's an XS::Install feature NAME => 'MyTestMod', # name of second (test) module }, ... );
in your C test files
#include <catch2/catch.hpp> ...
Run tests from perl .t file:
use MyModule; use Test::Catch; # should be loaded before you load your test SO XS::Loader::load_noboot('MyTestMod'); # or load() if you have and XS in test SO also catch_run(); # or Test::Catch::run() catch_run("[tag]"); done_testing(); use Test::Catch '[tag]'; # makes done_testing automatically
DESCRIPTION
This module provides
catch
's run function which runs CPP catch tests, so that you don't need to have catch run main in every module tests. Also this module makes tests output compatible with perl format and can work with perl tests in the same process (tests count and subtests nesting are shared).FUNCTIONS
run([@args])
Runs catch tests. If @args are provided the result is if it was provided in command-line for native catch test binary.
Separate arguments work as '&&'. If you want to run, for example test 'name' and all tests with tag 'tag' and all tests with both tag 'tag2' and 'tag3', use
catch_run("name,[tag],[tag2][tag3]");
import(@args)
If @args provided, runs tests the same way as
run(@args)
and callsdone_testing()
after that.EXPORTED FUNCTIONS
catch_run([@tags])
See
run
AUTHOR
Pronin Oleg <syber@crazypanda.ru>, Crazy Panda LTD
LICENSE
You may distribute this code under the same terms as Perl itself.
Module Install Instructions
To install Test::Catch, copy and paste the appropriate command in to your terminal.
cpanm Test::Catch
perl -MCPAN -e shell install Test::Catch
For more information on module installation, please visit the detailed CPAN module installation guide.