File: README.md

package info (click to toggle)
libtest2-asyncsubtest-perl 0.000018-1
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 228 kB
  • ctags: 65
  • sloc: perl: 505; makefile: 2
file content (77 lines) | stat: -rw-r--r-- 1,738 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
# NAME

Test2::Tools::AsyncSubtest - Tools for writing async subtests.

# DESCRIPTION

These are tools for writing async subtests. Async subtests are subtests which
can be started and stashed so that they can continue to recieve events while
other events are also being generated.

# SYNOPSYS

    use Test2::Bundle::Extended;
    use Test2::Tools::AsyncSubtest;

    my $ast1 = async_subtest local => sub {
        ok(1, "Inside subtest");
    };

    my $ast2 = fork_subtest child => sub {
        ok(1, "Inside subtest in another process");
    };

    my $ast3 = thread_subtest thread => sub {
        ok(1, "Inside subtest in a thread");
    };

    # You must call finish on the subtests you create. Finish will wait/join on
    # any child processes and threads.
    $ast1->finish;
    $ast2->finish;
    $ast3->finish;

    done_testing;

# EXPORTS

Everything is exported by default.

- $ast = async\_subtest $name
- $ast = async\_subtest $name => sub { ... }

    Create an async subtest. Run the codeblock if it is provided.

- $ast = fork\_subtest $name => sub { ... }

    Create an async subtest. Run the codeblock in a forked process.

- $ast = thread\_subtest $name => sub { ... }

    Create an async subtest. Run the codeblock in a thread.

# NOTES

- Async Subtests are always buffered.

# SOURCE

The source code repository for Test2-AsyncSubtest can be found at
`http://github.com/Test-More/Test2-AsyncSubtest/`.

# MAINTAINERS

- Chad Granum <exodist@cpan.org>

# AUTHORS

- Chad Granum <exodist@cpan.org>

# COPYRIGHT

Copyright 2015 Chad Granum <exodist7@gmail.com>.

This program is free software; you can redistribute it and/or
modify it under the same terms as Perl itself.

See `http://dev.perl.org/licenses/`