diff options
author | Tom Feist <shabble@metavore.org> | 2011-03-04 04:12:47 +0000 |
---|---|---|
committer | Tom Feist <shabble@metavore.org> | 2011-03-04 04:12:47 +0000 |
commit | 7ec10e516a04a05a85cb82b30a8f9982f13c6c90 (patch) | |
tree | 98e01316dbd57e4b0debb2d5d444b19cef5bf026 /testing/test.pl | |
parent | testing: cleaned up a lot of the testing logic. Subtests are now reported at ... (diff) | |
download | irssi-scripts-7ec10e516a04a05a85cb82b30a8f9982f13c6c90.tar.gz irssi-scripts-7ec10e516a04a05a85cb82b30a8f9982f13c6c90.zip |
working with TAP::Harness
Diffstat (limited to 'testing/test.pl')
-rwxr-xr-x | testing/test.pl | 46 |
1 files changed, 9 insertions, 37 deletions
diff --git a/testing/test.pl b/testing/test.pl index ea90e1c..bf01530 100755 --- a/testing/test.pl +++ b/testing/test.pl @@ -4,42 +4,14 @@ use strict; use warnings; use feature qw/say/; +#use lib 'blib/lib'; -use lib 'blib/lib'; +use TAP::Harness; +my $harness = TAP::Harness->new({ verbosity => 1, + lib => 'blib/lib', + color => 1, + }); -use Test::Irssi; - -my $tester = Test::Irssi->new - (irssi_binary => "/opt/stow/repo/irssi-debug/bin/irssi", - irssi_homedir => $ENV{HOME} . "/projects/tmp/test/irssi-debug"); - -say "Created test instance"; - - - -my $test = $tester->new_test('test1'); - -$test->add_input_sequence("/echo Hello cats\n"); -$test->add_delay(20); -$test->add_input_sequence("/echo Hello Again\n"); -for (1..10) { - $test->add_input_sequence($_); - $test->add_delay(0.2); -} -$test->add_evaluation_function(sub { 1 }, 'this should succeed'); -$test->add_pattern_match(qr/2345/, 'prompt', 'prompt contains numbers'); - -#$test->add_input_sequence("This is\x0acursor movement\x0a"); -# $test->add_delay(5); -$test->add_input_sequence("\n"); - -$test->add_input_sequence("/clear\n"); - - -my $test2 = $tester->new_test("Test2"); -$test2->add_input_sequence("hello from twooooooo"); -$test2->add_delay(5); -$test2->add_pattern_match(qr/hello/, 'prompt', 'hello'); - - -$tester->run; +my @tests = glob($ARGV[0]); +say "Tests: " . join (", ", @tests); +$harness->runtests(@tests); |