[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: Running the test suite faster.

From: David Summers <david_at_summersoft.fay.ar.us>
Date: 2007-11-03 04:59:39 CET

On Fri, 2 Nov 2007, Philip Martin wrote:

> David Summers <david@summersoft.fay.ar.us> writes:
>
>> Assuming we still need the slow version in production code, could
>> there be a test-suite option to use the fast one? I it currently
>> taking my RPM test suite builds 4+? hours to complete the 3x2 tests
>> they are currently doing. I was thinking of just configuring/building
>> with the fast version, do the tests, and then rebuilding with the
>> slow version but if there were test suite options to to this then that
>> would be much better.
>
> You could use an LD_PRELOAD library to intercept the open calls and
> change /dev/random into /dev/urandom, this can also be used if you
> want to use installed APR that is configured to use /dev/random.
> Something like:
>
>
> /*
> Compile like so:
> gcc -rdynamic -fPIC -O2 -Wall -shared -o libxxxx.so xxxx.c -ldl
> Use like so:
> (export LD_PRELOAD=$PWD/libxxxx.so; make svnserveautocheck)
> */
> #include <stdio.h>
> #include <stdlib.h>
> #include <dlfcn.h>
> #include <string.h>
>
> int open(const char *pathname, int flags, mode_t mode)
> {
> static int (*libc_open)(const char *, int, mode_t) = NULL;
> if (!libc_open) {
> void *handle = dlopen("libc.so.6", RTLD_LAZY);
> if (!handle) {
> fprintf(stderr, "%s\n", dlerror());
> exit(1);
> }
> dlerror();
> libc_open = dlsym(handle, "open");
> char *error = dlerror();
> if (error || !libc_open) {
> fprintf(stderr, "%s\n", error ? error : "null!!");
> exit(1);
> }
> }
> if (!strcmp(pathname, "/dev/random"))
> pathname = "/dev/urandom";
> return libc_open(pathname, flags, mode);
> }
>

Very interesting! I'll go off and play with this, thanks!

David Wayne Summers "Linux: Because reboots are for hardware upgrades!"
david_at_summersoft.fay.ar.us PGP Key: http://summersoft.fay.ar.us/~david/pgp.txt
PGP Key fingerprint = 0B44 B118 85CC F4EC 7021 1ED4 1516 5B78 E320 2001

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Sat Nov 3 04:59:49 2007

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.