File: 03_threads.t

package info (click to toggle)
libwx-perl 1%3A0.9928-3
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 4,300 kB
  • ctags: 2,322
  • sloc: cpp: 11,044; perl: 8,646; ansic: 710; makefile: 48
file content (56 lines) | stat: -rw-r--r-- 1,176 bytes parent folder | download | duplicates (5)
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
#!/usr/bin/perl -w

use strict;
use Config;
use if !$Config{useithreads} => 'Test::More' => skip_all => 'no threads';
use threads;

use Wx qw(:everything);
use if !Wx::wxTHREADS, 'Test::More' => skip_all => 'No thread support';
use Test::More tests => 4;

use Wx::PerlTest;

package MyAbstractNonObject;
use base qw( Wx::PlPerlTestAbstractNonObject );

sub new { shift->SUPER::new( @_ ) }

package MyAbstractObject;
use base qw( Wx::PlPerlTestAbstractObject );

sub new { shift->SUPER::new( @_ ) }

package MyNonObject;
use base qw( Wx::PlPerlTestNonObject );

sub new { shift->SUPER::new( @_ ) }

package main;

my $app = Wx::App->new( sub { 1 } );

my $anonobj =  MyAbstractNonObject->new;
my $aobj    =  MyAbstractObject->new;
my $nonobj  =  MyNonObject->new;
my $obj     =  Wx::PerlTestObject->new;

my $anonobj2 = MyAbstractNonObject->new;
my $aobj2   =  MyAbstractObject->new;
my $nonobj2 =  MyNonObject->new;
my $obj2    =  Wx::PerlTestObject->new;

undef $anonobj2;
undef $aobj2;
undef $nonobj2;
undef $obj2;

my $t = threads->create
  ( sub {
        ok( 1, 'In thread' );
    } );
ok( 1, 'Before join' );
$t->join;
ok( 1, 'After join' );

END { ok( 1, 'At END' ) };