tests: Added remote autotest host/server scripts
git-svn-id: http://pugixml.googlecode.com/svn/trunk@422 99668b35-9821-0410-8761-19e4c4f06640
This commit is contained in:
parent
1b5fa404db
commit
754567ece2
2 changed files with 36 additions and 0 deletions
25
tests/autotest-remote-host.pl
Normal file
25
tests/autotest-remote-host.pl
Normal file
|
@ -0,0 +1,25 @@
|
|||
#!/usr/bin/perl
|
||||
|
||||
sub execprint
|
||||
{
|
||||
my $cmd = shift;
|
||||
|
||||
open PIPE, "$cmd |" || die "$cmd failed: $!\n";
|
||||
print while (<PIPE>);
|
||||
close PIPE;
|
||||
|
||||
return $?;
|
||||
}
|
||||
|
||||
use IO::Socket;
|
||||
|
||||
$exitcmd = shift;
|
||||
|
||||
my $client = new IO::Socket::INET(PeerAddr => "10.0.2.2:7183", Timeout => 5);
|
||||
exit unless $client;
|
||||
|
||||
select $client;
|
||||
|
||||
&execprint('svn up') == 0 || die "error updating from repo\n";
|
||||
&execprint('perl tests/autotest-local.pl') == 0 || die "error launching tests\n";
|
||||
system($exitcmd);
|
11
tests/autotest-remote-server.pl
Normal file
11
tests/autotest-remote-server.pl
Normal file
|
@ -0,0 +1,11 @@
|
|||
#!/usr/bin/perl
|
||||
|
||||
use IO::Socket;
|
||||
|
||||
my $server = new IO::Socket::INET(LocalPort => 7183, Listen => 1);
|
||||
die "Could not create socket: $!\n" unless $server;
|
||||
|
||||
my $client = $server->accept();
|
||||
|
||||
print while (<$client>);
|
||||
|
Loading…
Add table
Reference in a new issue