Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Fix #427 , add valgrind support to to ubertests
Either add --valgrind-searchd for one-time run,
either add 'valgrindsearchd'=>true to .sphinx config file.
Suppression file test/valgrind.supp will be in game.
Loading branch information
Showing
2 changed files
with
23 additions
and
4 deletions .
+21
−4
test/helpers.inc
+2
−0
test/ubertest.php
@@ -371,11 +371,25 @@ function StartSearchd ( $config_file, $error_file, $pidfile, &$error, $use_watch
$ abs_error_file = testdir ($ error_file );
$ abs_pidfile = testdir ($ pidfile );
$ path = $ g_locals ['searchd' ];
if ( !is_executable ($ path ) )
if ( isset ( $ g_locals ['valgrindsearchd' ] ) )
$ use_valgrind = $ g_locals ['valgrindsearchd' ];
else
$ use_valgrind = false ;
if ( $ use_valgrind ) {
$ path = "valgrind --leak-check=full " ;
if ( file_exists ("valgrind.supp" ) )
$ path .= "--suppressions=" . getcwd () . "/valgrind.supp " ;
$ path .= $ g_locals ['searchd' ];
}
else
{
$ error = "$path: searchd not found" ;
return 1 ;
$ path = $ g_locals ['searchd' ];
if ( !is_executable ($ path ) )
{
$ error = "$path: searchd not found" ;
return 1 ;
}
}
if ( !@touch ($ abs_error_file ) )
@@ -417,6 +431,9 @@ function StartSearchd ( $config_file, $error_file, $pidfile, &$error, $use_watch
if ($ cd )
chdir ($ backdir );
if ( $ use_valgrind )
usleep ( 2000000 );
// wait until pid appears
for ( $ i =0 ; $ i <$ action_retries && !file_exists ($ abs_pidfile ); $ i ++ )
usleep ( $ action_wait_timeout );
@@ -48,6 +48,7 @@
print ( "--keep-all\t\tKeep test db and all test data (like generated configs, etc.) after the test (for debugging)\n" );
print ( "--no-demo\t\tJust skip all tests without models. Else - run them, but never fail (for debugging)\n" );
print ( "--no-marks\t\tDon't mark the output of every test in the logs.\n" );
print ( "--valgrind-searchd\t\tRun searchd under valgrind during test.\n" );
print ( "--ignore-weights\tIgnore differences in weights. (Useful for testing that reference database changes are ok.)\n" );
print ( "--cwd\t\t\tchange directory to ubertest.php location (for git bisect)\n" );
print ( "\nEnvironment variables are:\n" );
@@ -103,6 +104,7 @@
else if ( $ arg =="--test-thd-pool" ) $ locals ['use_pool' ] = true ;
else if ( $ arg =="--strict" ) $ g_strict = true ;
else if ( $ arg =="--strict-verbose" ) { $ g_strict = true ; $ g_strictverbose = true ; }
else if ( $ arg =="--valgrind-searchd" ) $ locals ['valgrindsearchd' ] = true ;
else if ( $ arg =="--ignore-weights" ) $ g_ignore_weights = true ;
else if ( $ arg =="--no-drop-db" ) $ locals ['no_drop_db' ] = true ;
else if ( $ arg =="--keep-all" ) $ locals ['keep_all' ] = true ;
Toggle all file notes