Annotation of HOPE/Net-OpenAMD/t/local_server.t, Revision 1.12
1.1 andrew 1: #!perl
1.12 ! andrew 2: # $AFresh1: local_server.t,v 1.11 2010/07/01 17:59:55 andrew Exp $
1.9 andrew 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 ($@) {
1.12 ! andrew 17: plan skip_all =>
! 18: "Test::Mojo::Server required for testing local server";
1.11 andrew 19: }
1.12 ! andrew 20: elsif ( $] < 5.01 ) {
1.11 andrew 21: plan skip_all => 'test_server.pl requires perl 5.10 or higher';
1.9 andrew 22: }
23: else {
1.12 ! andrew 24: plan tests => 17;
1.9 andrew 25: }
1.4 andrew 26: require 'network_tests.t';
1.1 andrew 27: }
28:
29: my $server = Test::Mojo::Server->new();
30: $server->executable('test_server.pl');
31:
32: my $path = $server->find_executable_ok('executable found');
33: my $port = $server->start_daemon_ok('daemon test');
34: $server->server_ok('server running');
35:
1.5 andrew 36: my $amd = Net::OpenAMD->new(
1.7 andrew 37: { base_uri => 'http://127.0.0.1:' . $port . '/api/', } );
1.12 ! andrew 38: NetworkTests::run_tests($amd);
1.1 andrew 39:
1.5 andrew 40: $server->stop_server_ok('server stopped');
1.1 andrew 41:
1.8 andrew 42: #done_testing();
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>