Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
use correct executable for running client/server
  • Loading branch information
FROGGS committed Jan 23, 2014
1 parent 67c03a7 commit 0faa8bb
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 17 deletions.
2 changes: 1 addition & 1 deletion S32-io/IO-Socket-INET.bat
Expand Up @@ -10,7 +10,7 @@ DEL t\spec\S32-io\server-ready-flag 2> NUL
:: Use START to fork the server and set the window title so we can kill it later
START "P6IOSOCKETtest" /MIN perl6 t\spec\S32-io\IO-Socket-INET.pl %TEST% %PORT% server

perl6 t\spec\S32-io\IO-Socket-INET.pl %TEST% %PORT% client
%PERL6_BINARY% t\spec\S32-io\IO-Socket-INET.pl %TEST% %PORT% client

:: Clean up any stray processes
TASKKILL /FI "WINDOWTITLE eq P6IOSOCKETtest" > NUL
4 changes: 2 additions & 2 deletions S32-io/IO-Socket-INET.sh
Expand Up @@ -8,10 +8,10 @@ PORT="$2"
rm t/spec/S32-io/server-ready-flag 2>/dev/null

# use & to run the server as a background process
./perl6 t/spec/S32-io/IO-Socket-INET.pl $TEST $PORT server & SERVER=$!
$PERL6_BINARY t/spec/S32-io/IO-Socket-INET.pl $TEST $PORT server & SERVER=$!

# use & to run the client as a background process
./perl6 t/spec/S32-io/IO-Socket-INET.pl $TEST $PORT client & CLIENT=$!
$PERL6_BINARY t/spec/S32-io/IO-Socket-INET.pl $TEST $PORT client & CLIENT=$!

# make a watchdog to kill a hanging client (occurs only if a test fails)
#( sleep 20; kill $CLIENT 2>/dev/null && echo '(timeout)' ) &
Expand Down
29 changes: 15 additions & 14 deletions S32-io/IO-Socket-INET.t
Expand Up @@ -70,12 +70,13 @@ if $*OS eq any <linux Linux darwin solaris MSWin32>, 'Mac OS X' { # please add m

my $is-win;
$is-win = True if $*OS eq 'MSWin32';
my $runner = "PERL6_BINARY=$*EXECUTABLE_NAME.path.absolute";

# test 2 does echo protocol - Internet RFC 862
if $is-win {
$received = qqx{t\\spec\\S32-io\\IO-Socket-INET.bat 2 $port};
$received = qqx{$runner t\\spec\\S32-io\\IO-Socket-INET.bat 2 $port};
} else {
$received = qqx{sh t/spec/S32-io/IO-Socket-INET.sh 2 $port};
$received = qqx{$runner sh t/spec/S32-io/IO-Socket-INET.sh 2 $port};
}
#warn "TEST 2 $received";
$expected = "echo '0123456789abcdefghijklmnopqrstuvwxyz' received\n";
Expand All @@ -84,9 +85,9 @@ if $*OS eq any <linux Linux darwin solaris MSWin32>, 'Mac OS X' { # please add m

# test 3 does discard protocol - Internet RFC 863
if $is-win {
$received = qqx{t\\spec\\S32-io\\IO-Socket-INET.bat 3 $port};
$received = qqx{$runner t\\spec\\S32-io\\IO-Socket-INET.bat 3 $port};
} else {
$received = qqx{sh t/spec/S32-io/IO-Socket-INET.sh 3 $port};
$received = qqx{$runner sh t/spec/S32-io/IO-Socket-INET.sh 3 $port};
}
#warn "TEST 3 $received";
$expected = "discard '' received\n";
Expand All @@ -95,9 +96,9 @@ if $*OS eq any <linux Linux darwin solaris MSWin32>, 'Mac OS X' { # please add m

# test 4 tests recv with a parameter
if $is-win {
$received = qqx{t\\spec\\S32-io\\IO-Socket-INET.bat 4 $port};
$received = qqx{$runner t\\spec\\S32-io\\IO-Socket-INET.bat 4 $port};
} else {
$received = qqx{sh t/spec/S32-io/IO-Socket-INET.sh 4 $port};
$received = qqx{$runner sh t/spec/S32-io/IO-Socket-INET.sh 4 $port};
}
$expected = $received.split("\n");
my $i = 0;
Expand All @@ -123,9 +124,9 @@ if $*OS eq any <linux Linux darwin solaris MSWin32>, 'Mac OS X' { # please add m

# test 5 tests get()
if $is-win {
$received = qqx{t\\spec\\S32-io\\IO-Socket-INET.bat 5 $port};
$received = qqx{$runner t\\spec\\S32-io\\IO-Socket-INET.bat 5 $port};
} else {
$received = qqx{sh t/spec/S32-io/IO-Socket-INET.sh 5 $port};
$received = qqx{$runner sh t/spec/S32-io/IO-Socket-INET.sh 5 $port};
}
$expected = $received.split("\n");
$i = 0;
Expand All @@ -152,9 +153,9 @@ if $*OS eq any <linux Linux darwin solaris MSWin32>, 'Mac OS X' { # please add m

# RT #116288, test 6 tests read with a parameter
if $is-win {
$received = qqx{t\\spec\\S32-io\\IO-Socket-INET.bat 6 $port};
$received = qqx{$runner t\\spec\\S32-io\\IO-Socket-INET.bat 6 $port};
} else {
$received = qqx{sh t/spec/S32-io/IO-Socket-INET.sh 6 $port};
$received = qqx{$runner sh t/spec/S32-io/IO-Socket-INET.sh 6 $port};
}
$expected = $received.split("\n");
$i = 0;
Expand All @@ -167,19 +168,19 @@ if $*OS eq any <linux Linux darwin solaris MSWin32>, 'Mac OS X' { # please add m

# test 7 tests recv with binary data
if $is-win {
$received = qqx{t\\spec\\S32-io\\IO-Socket-INET.bat 7 $port};
$received = qqx{$runner t\\spec\\S32-io\\IO-Socket-INET.bat 7 $port};
} else {
$received = qqx{sh t/spec/S32-io/IO-Socket-INET.sh 7 $port};
$received = qqx{$runner sh t/spec/S32-io/IO-Socket-INET.sh 7 $port};
}
$expected = $received.split("\n");
is $expected[0], 'OK-7', "{elapsed} successful read binary data";
nok $elapsed > $toolong, "finished in time #19";

# test 8 tests recv with binary data.
if $is-win {
$received = qqx{t\\spec\\S32-io\\IO-Socket-INET.bat 8 $port};
$received = qqx{$runner t\\spec\\S32-io\\IO-Socket-INET.bat 8 $port};
} else {
$received = qqx{sh t/spec/S32-io/IO-Socket-INET.sh 8 $port};
$received = qqx{$runner sh t/spec/S32-io/IO-Socket-INET.sh 8 $port};
}
$expected = $received.split("\n");
is $expected[0], 'OK-8', "{elapsed} successful received binary data";
Expand Down

0 comments on commit 0faa8bb

Please sign in to comment.