Changeset 1242
- Timestamp:
- 07/24/08 09:02:37 (3 months ago)
- Files:
-
- 1.8.3/branches/devel/CHANGES.183 (modified) (1 diff)
- 1.8.3/branches/devel/test/MUSHConnection.pm (modified) (1 diff)
- 1.8.3/branches/devel/test/PennMUSH.pm (modified) (3 diffs)
- 1.8.3/branches/devel/test/alltests.sh.in (modified) (1 diff)
- 1.8.3/branches/devel/test/runtest.pl (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
1.8.3/branches/devel/CHANGES.183
r1241 r1242 34 34 * @name strips out quotes around player names even if spaces in them are 35 35 disabled. 36 * The test suite can now use valgrind to identify buffer overflows and 37 similiar problems triggered by tests, by passing the --valgrind option 38 to test scripts. 36 39 37 40 Commands: 1.8.3/branches/devel/test/MUSHConnection.pm
r439 r1242 34 34 my $name = shift; 35 35 my $passwd = shift; 36 36 37 37 38 my $socket = $self->[0]; 1.8.3/branches/devel/test/PennMUSH.pm
r956 r1242 13 13 bless($self, $class); 14 14 if (@_) { 15 $self->{HOST} = shift; 16 $self->{PORT} = shift; 17 $self->start(@_) if @_; 15 $self->{HOST} = shift; 16 $self->{PORT} = shift; 17 $self->{VALGRIND} = shift; 18 $self->start(@_); 18 19 } else { 19 20 $self->start(); 20 21 } 22 21 23 return $self; 22 24 } … … 25 27 my $self = shift; 26 28 srand(); 27 my $port = $self->{PORT} || int(rand(2000)) + 12000; 28 $self->{HOST} = "localhost"; 29 $self->{PORT} = $port; 29 $self->{HOST} = "localhost" unless defined $self->{HOST}; 30 if (!exists $self->{PORT} || $self->{PORT} <= 0) { 31 $self->{PORT} = int(rand(2000)) + 12000; 32 } 33 my $port = $self->{PORT}; 30 34 rmtree("testgame"); 31 35 mkpath(["testgame/data", "testgame/log", "testgame/txt"]); … … 64 68 } elsif (defined($child)) { 65 69 chdir("testgame"); 66 exec("./netmush", "--no-session", "test.cnf", "log/netmush.log"); 70 my @execargs = ("./netmush", "--no-session", "test.cnf"); 71 unshift @execargs, "valgrind", '--log-file=../valgrind-%p.log' 72 if $self->{VALGRIND}; 73 exec @execargs; 67 74 } else { 68 75 die "Could not spawn game process!\n"; 1.8.3/branches/devel/test/alltests.sh.in
r1078 r1242 1 1 #!/bin/sh 2 2 3 exec @PERL@ runtest.pl test*.pl3 exec @PERL@ runtest.pl $@ test*.pl 4 4 1.8.3/branches/devel/test/runtest.pl
r1078 r1242 1 1 #!/usr/bin/perl -w 2 2 use strict; 3 use Getopt::Long; 3 4 use PennMUSH; 4 5 use TestHarness; 5 6 7 my ($valgrind, $host, $port) = (0,"localhost",0); 8 GetOptions "valgrind" => \$valgrind, 9 "host" => \$host, 10 "port" => \$port; 6 11 7 8 my $mush = PennMUSH->new; 12 my $mush = PennMUSH->new($host, $port, $valgrind); 9 13 10 14 my @tests = map { TestHarness->new($_); } @ARGV; 11 15 12 16 my $god = $mush->loginGod; 17 13 18 my $mortal = undef; 14 19 if ($TestHarness::use_mortal) {
