@ -52,8 +52,8 @@ static int64 max_step_wait = 300 * USECS_PER_SEC;
static void check_testspec ( TestSpec * testspec ) ;
static void check_testspec ( TestSpec * testspec ) ;
static void run_testspec ( TestSpec * testspec ) ;
static void run_testspec ( TestSpec * testspec ) ;
static void run_all_permutations ( TestSpec * testspec ) ;
static void run_all_permutations ( TestSpec * testspec ) ;
static void run_all_permutations_recurse ( TestSpec * testspec , int nstep s,
static void run_all_permutations_recurse ( TestSpec * testspec , int * pile s,
PermutationStep * * steps ) ;
int nsteps , PermutationStep * * steps ) ;
static void run_named_permutations ( TestSpec * testspec ) ;
static void run_named_permutations ( TestSpec * testspec ) ;
static void run_permutation ( TestSpec * testspec , int nsteps ,
static void run_permutation ( TestSpec * testspec , int nsteps ,
PermutationStep * * steps ) ;
PermutationStep * * steps ) ;
@ -360,9 +360,9 @@ check_testspec(TestSpec *testspec)
fprintf ( stderr , " unused step name: %s \n " , allsteps [ i ] - > name ) ;
fprintf ( stderr , " unused step name: %s \n " , allsteps [ i ] - > name ) ;
}
}
}
}
}
static int * piles ;
free ( allsteps ) ;
}
/*
/*
* Run the permutations specified in the spec , or all if none were
* Run the permutations specified in the spec , or all if none were
@ -387,6 +387,7 @@ run_all_permutations(TestSpec *testspec)
int i ;
int i ;
PermutationStep * steps ;
PermutationStep * steps ;
PermutationStep * * stepptrs ;
PermutationStep * * stepptrs ;
int * piles ;
/* Count the total number of steps in all sessions */
/* Count the total number of steps in all sessions */
nsteps = 0 ;
nsteps = 0 ;
@ -412,11 +413,16 @@ run_all_permutations(TestSpec *testspec)
for ( i = 0 ; i < testspec - > nsessions ; i + + )
for ( i = 0 ; i < testspec - > nsessions ; i + + )
piles [ i ] = 0 ;
piles [ i ] = 0 ;
run_all_permutations_recurse ( testspec , 0 , stepptrs ) ;
run_all_permutations_recurse ( testspec , piles , 0 , stepptrs ) ;
free ( steps ) ;
free ( stepptrs ) ;
free ( piles ) ;
}
}
static void
static void
run_all_permutations_recurse ( TestSpec * testspec , int nsteps , PermutationStep * * steps )
run_all_permutations_recurse ( TestSpec * testspec , int * piles ,
int nsteps , PermutationStep * * steps )
{
{
int i ;
int i ;
bool found = false ;
bool found = false ;
@ -438,7 +444,7 @@ run_all_permutations_recurse(TestSpec *testspec, int nsteps, PermutationStep **s
piles [ i ] + + ;
piles [ i ] + + ;
run_all_permutations_recurse ( testspec , nsteps + 1 , steps ) ;
run_all_permutations_recurse ( testspec , piles , nsteps + 1 , steps ) ;
piles [ i ] - - ;
piles [ i ] - - ;