~ubuntu-branches/ubuntu/wily/padre/wily

« back to all changes in this revision

Viewing changes to t/38_task_manager.t

  • Committer: Package Import Robot
  • Author(s): Dominique Dumont, gregor herrmann, Salvatore Bonaccorso, Dominique Dumont
  • Date: 2013-05-06 13:12:27 UTC
  • mfrom: (1.3.6)
  • Revision ID: package-import@ubuntu.com-20130506131227-qykksq7ddz3lgp0v
Tags: 0.98+dfsg-1
[ gregor herrmann ]
* debian/control: update {versioned,alternative} (build) dependencies.
* debian/watch: update to ignore development releases.

[ Salvatore Bonaccorso ]
* Fix dependency on libwx-perl.
  Add versioned Build-Depends-Indep on libwx-perl (>= 1:0.9901) and add
  correct epoch to libwx-perl (>= 1:0.9901) Depends.
* Fix typo in longtitle in Debian menu entry.
  Thanks to Chris Leick and Bill Allombert for reporting (Closes: #684472)
* Change Vcs-Git to canonical URI (git://anonscm.debian.org)
* Change search.cpan.org based URIs to metacpan.org based URIs

[ Dominique Dumont ]
* Imported Upstream version 0.98+dfsg
* Removed skip test patch: problem's gone. The segfault happening in this
  test has been fixed in libdbi-perl 1.621.
* refreshed fix-spelling patch
* removed patch fix-double-line-in-outline (applied upstream)
* copyright:
  * updated years
  - removed unused licenses
* compat: bumped to 9
* control:
  - remove ryan from uploaders
  * refreshed dependencies
  * bumped standard-version
* debian/not-real-manual.list: refreshed file size for dummy manual page
* refreshed disable-tcp-server.patch
* added patch to fix mime_test

Show diffs side-by-side

added added

removed removed

Lines of Context:
17
17
                exit 0;
18
18
        }
19
19
 
20
 
        plan skip_all => 'Test disabled by Debian: no further problem found'; 
21
 
        exit 0;
22
 
 
23
20
        plan tests => 16;
24
21
}
25
22
 
63
60
 
64
61
# Start the timers
65
62
$timer1->Start( 1,     1 );
66
 
$timer2->Start( 10000, 1 );
 
63
$timer2->Start( 1000, 1 );
67
64
 
68
65
 
69
66
 
73
70
# Main Process
74
71
 
75
72
# We start with no threads
76
 
is( scalar( threads->list ), 0, 'No threads' );
 
73
is( scalar( threads->list ), 0, 'We start with No threads' );
77
74
 
78
75
# Enter the wx loop
79
76
# $window->Show(1) if $window;
80
77
$wxapp->MainLoop;
81
78
 
82
79
# We end with no threads
83
 
is( scalar( threads->list ), 0, 'No threads' );
 
80
is( scalar( threads->list ), 0, 'We end with No threads' );
84
81
 
85
82
 
86
83
 
92
89
sub startup {
93
90
 
94
91
        # Run the startup process
95
 
        ok( $manager->start, '->start ok' );
 
92
        ok( $manager->start, '->start, startup process ok' );
96
93
        Time::HiRes::sleep(1);
97
94
        is( scalar( threads->list ), 1, 'Three threads exists' );
98
95
 
104
101
        isa_ok( $addition, 'Padre::Task::Addition' );
105
102
 
106
103
        # Schedule the task (which should trigger it's execution)
107
 
        ok( $manager->schedule($addition), '->schedule ok' );
108
 
        is( $addition->{prepare}, 1, '->{prepare} is false' );
109
 
        is( $addition->{run},     0, '->{run}     is false' );
110
 
        is( $addition->{finish},  0, '->{finish}  is false' );
 
104
        ok( $manager->schedule($addition), '->schedule startup ok' );
 
105
        is( $addition->{prepare}, 1, '->{prepare} startup is false' ); #should this be true as 1
 
106
        is( $addition->{run},     0, '->{run}     startup is false' );
 
107
        is( $addition->{finish},  0, '->{finish}  startup is false' );
111
108
}
112
109
 
113
110
sub timeout {
115
112
        # Run the shutdown process
116
113
        $timer1 = undef;
117
114
        $timer2 = undef;
118
 
        ok( $manager->stop,     '->stop ok' );
119
 
        ok( $manager->waitjoin, '->waitjoin ok' );
 
115
        ok( $manager->stop,     '->stop timeout ok' );
 
116
        # we appire to hang here
 
117
        ok( $manager->waitjoin, '->waitjoin timeout ok' );
120
118
 
121
119
        # $window->Show(0) if $window;
122
120
        $wxapp->ExitMainLoop;
123
121
}
 
122
 
 
123
 
 
124
# done_testing();
 
125
 
 
126
1;
 
127
 
 
128
__END__