From 754567ece20faa10d6d4de6d8f5c421b51dd259c Mon Sep 17 00:00:00 2001 From: "arseny.kapoulkine" Date: Thu, 13 May 2010 15:51:42 +0000 Subject: tests: Added remote autotest host/server scripts git-svn-id: http://pugixml.googlecode.com/svn/trunk@422 99668b35-9821-0410-8761-19e4c4f06640 --- tests/autotest-remote-host.pl | 25 +++++++++++++++++++++++++ tests/autotest-remote-server.pl | 11 +++++++++++ 2 files changed, 36 insertions(+) create mode 100644 tests/autotest-remote-host.pl create mode 100644 tests/autotest-remote-server.pl (limited to 'tests') diff --git a/tests/autotest-remote-host.pl b/tests/autotest-remote-host.pl new file mode 100644 index 0000000..91d929a --- /dev/null +++ b/tests/autotest-remote-host.pl @@ -0,0 +1,25 @@ +#!/usr/bin/perl + +sub execprint +{ + my $cmd = shift; + + open PIPE, "$cmd |" || die "$cmd failed: $!\n"; + print while (); + 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); diff --git a/tests/autotest-remote-server.pl b/tests/autotest-remote-server.pl new file mode 100644 index 0000000..e113808 --- /dev/null +++ b/tests/autotest-remote-server.pl @@ -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>); + -- cgit v1.2.3