Changeset 641

Show
Ignore:
Timestamp:
11/16/07 09:13:41 (1 year ago)
Author:
dormando
Message:

Allow running tests in a build directory different from source directory. (Tomash Brechko tomash.brechko@gmail.com)

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/server/Makefile.am

    r543 r641  
    1212 
    1313test:   memcached-debug 
    14         prove
     14        prove $(srcdir)/
    1515 
    1616dist-hook: 
  • trunk/server/t/lib/MemcachedTest.pm

    r617 r641  
    44use IO::Socket::UNIX; 
    55use Exporter 'import'; 
    6 use FindBin qw($Bin); 
    76use Carp qw(croak); 
    87use vars qw(@EXPORT); 
     8 
     9# Instead of doing the substitution with Autoconf, we assume that 
     10# cwd == builddir. 
     11use Cwd; 
     12my $builddir = getcwd; 
     13 
    914 
    1015@EXPORT = qw(new_memcached sleep mem_get_is mem_gets mem_gets_is mem_stats free_port); 
     
    132137 
    133138sub supports_udp { 
    134     my $output = `$Bin/../memcached-debug -h`; 
     139    my $output = `$builddir/memcached-debug -h`; 
    135140    return 0 if $output =~ /^memcached 1\.1\./; 
    136141    return 1; 
     
    150155    my $childpid = fork(); 
    151156 
    152     my $exe = "$Bin/../memcached-debug"; 
     157    my $exe = "$builddir/memcached-debug"; 
    153158    croak("memcached binary doesn't exist.  Haven't run 'make' ?\n") unless -e $exe; 
    154159    croak("memcached binary not executable\n") unless -x _;