[BACK]Return to local_server.t CVS log [TXT][DIR] Up to [local] / HOPE / Net-OpenAMD / t

Annotation of HOPE/Net-OpenAMD/t/local_server.t, Revision 1.9

1.1       andrew      1: #!perl
1.9     ! andrew      2: # $AFresh1: local_server.t,v 1.8 2010/06/28 20:34:14 andrew Exp $
        !             3: use Test::More;
1.1       andrew      4:
                      5: use strict;
                      6: use warnings;
                      7:
1.4       andrew      8: use Net::OpenAMD;
1.1       andrew      9:
                     10: BEGIN {
1.2       andrew     11:     use FindBin;
1.4       andrew     12:     use lib "$FindBin::Bin";
                     13:     use lib "$FindBin::Bin/../../mojo/lib";
1.2       andrew     14:
1.1       andrew     15:     eval "use Test::Mojo::Server";
1.9     ! andrew     16:     if ($@) {
        !            17:         plan skip_all => "Test::Mojo::Server required for testing local server";
        !            18:     }
        !            19:     else {
        !            20:         plan tests => 15;
        !            21:     }
1.4       andrew     22:     require 'network_tests.t';
1.1       andrew     23: }
                     24:
                     25: my $server = Test::Mojo::Server->new();
                     26: $server->executable('test_server.pl');
                     27:
                     28: my $path = $server->find_executable_ok('executable found');
                     29: my $port = $server->start_daemon_ok('daemon test');
                     30: $server->server_ok('server running');
                     31:
1.5       andrew     32: my $amd = Net::OpenAMD->new(
1.7       andrew     33:     { base_uri => 'http://127.0.0.1:' . $port . '/api/', } );
1.4       andrew     34: NetworkTests::run_tests($amd);
1.1       andrew     35:
1.5       andrew     36: $server->stop_server_ok('server stopped');
1.1       andrew     37:
1.8       andrew     38: #done_testing();

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>