diff options
author | Rainer Keller <rainer.keller@theqtcompany.com> | 2015-01-13 15:49:09 +0100 |
---|---|---|
committer | Rainer Keller <rainer.keller@theqtcompany.com> | 2015-01-16 08:14:55 +0100 |
commit | 997b04031039408790131359b4af393f7600bac6 (patch) | |
tree | b922857a305aa66ab840a2c7f0c52fc0e5959e40 /tests/auto/test.pl | |
parent | f6a59f8defbb478f7960c36982acb611d709ae40 (diff) |
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>
Diffstat (limited to 'tests/auto/test.pl')
-rwxr-xr-x | tests/auto/test.pl | 41 |
1 files changed, 14 insertions, 27 deletions
diff --git a/tests/auto/test.pl b/tests/auto/test.pl index 7c3708472c..48166e1c30 100755 --- a/tests/auto/test.pl +++ b/tests/auto/test.pl @@ -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 { |