Autotest: Find all autotests due to changed naming conventions

The algorithm searches for all executables in search path starting with
"tst_". Tests are not named like the folder they are contained in
anymore.

Change-Id: I360f293e43e30292fe0ae6230fd3ec7abf3d632d
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@theqtcompany.com>
This commit is contained in:
Rainer Keller 2015-01-13 15:49:09 +01:00
parent f6a59f8def
commit 997b040310

View File

@ -138,35 +138,22 @@ sub handleDir {
my ($dir) = @_;
my $currentDir = getcwd();
chdir($dir) || die("Could not chdir to $dir");
my @components;
my $command;
@components = split(/\//, $dir);
my $component = $components[$#components];
$command = "tst_".$component;
if ( -e $command.$EXE_SUFFIX )
{
executeTestCurrentDir($command);
} else {
opendir(DIR, $dir);
my @files = readdir(DIR);
closedir DIR;
my $file;
foreach $file (@files)
{
#skip hidden files
next if (substr($file,0,1) eq ".");
if ( -d $dir."/".$file)
{
handleDir($dir."/".$file)
}
opendir(DIR, $dir);
my @files = readdir(DIR);
closedir DIR;
my $file;
foreach $file (@files) {
#skip hidden files
next if (substr($file,0,1) eq ".");
if ( -d $dir."/".$file) {
handleDir($dir."/".$file)
} elsif ( $file =~ /^tst_/ and -x $dir."/".$file ) {
chdir($dir) || die("Could not chdir to $dir");
executeTestCurrentDir($file);
chdir($currentDir);
}
}
chdir($currentDir);
}
sub executeTestCurrentDir {