From 6dc11b4df9f7e9861fd2eadae5f6218bd533351d Mon Sep 17 00:00:00 2001 From: Bob Wilson Date: Fri, 19 Jun 2009 17:19:38 +0000 Subject: [PATCH] Clean up nightly tester to use Perl's File::Find. Patch by Benjamin Kramer. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@73772 91177308-0d34-0410-b5e6-96231b3b80d8 --- utils/NewNightlyTest.pl | 37 +++++++++---------------------------- 1 file changed, 9 insertions(+), 28 deletions(-) diff --git a/utils/NewNightlyTest.pl b/utils/NewNightlyTest.pl index 3976554f0e8..00d4038d8ad 100755 --- a/utils/NewNightlyTest.pl +++ b/utils/NewNightlyTest.pl @@ -1,6 +1,7 @@ #!/usr/bin/perl use POSIX qw(strftime); use File::Copy; +use File::Find; use Socket; # @@ -787,40 +788,20 @@ if (!$BuildError) { print "Organizing size of .o and .a files\n" if ( $VERBOSE ); ChangeDir( "$BuildDir/llvm", "Build Directory" ); - $afiles.= `find utils/ -iname '*.a' -ls`; - $afiles.= `find lib/ -iname '*.a' -ls`; - $afiles.= `find tools/ -iname '*.a' -ls`; - if($BUILDTYPE eq "release"){ - $afiles.= `find Release/ -iname '*.a' -ls`; - } elsif($BUILDTYPE eq "release-asserts") { - $afiles.= `find Release-Asserts/ -iname '*.a' -ls`; - } else { - $afiles.= `find Debug/ -iname '*.a' -ls`; - } - $ofiles.= `find utils/ -iname '*.o' -ls`; - $ofiles.= `find lib/ -iname '*.o' -ls`; - $ofiles.= `find tools/ -iname '*.o' -ls`; + my @dirs = ('utils', 'lib', 'tools'); if($BUILDTYPE eq "release"){ - $ofiles.= `find Release/ -iname '*.o' -ls`; + push @dirs, 'Release'; } elsif($BUILDTYPE eq "release-asserts") { - $ofiles.= `find Release-Asserts/ -iname '*.o' -ls`; + push @dirs, 'Release-Asserts'; } else { - $ofiles.= `find Debug/ -iname '*.o' -ls`; + push @dirs, 'Debug'; } - @AFILES = split "\n", $afiles; - $a_file_sizes=""; - foreach $x (@AFILES){ - $x =~ m/.+\s+.+\s+.+\s+.+\s+.+\s+.+\s+(.+)\s+.+\s+.+\s+.+\s+(.+)/; - $a_file_sizes.="$1 $2 $BUILDTYPE\n"; - } - @OFILES = split "\n", $ofiles; - $o_file_sizes=""; - foreach $x (@OFILES){ - $x =~ m/.+\s+.+\s+.+\s+.+\s+.+\s+.+\s+(.+)\s+.+\s+.+\s+.+\s+(.+)/; - $o_file_sizes.="$1 $2 $BUILDTYPE\n"; - } + find(sub { + $a_file_sizes .= (-s $_)." $File::Find::name $BUILDTYPE\n" if /\.a$/i; + $o_file_sizes .= (-s $_)." $File::Find::name $BUILDTYPE\n" if /\.o$/i; + }, @dirs); } else { $a_file_sizes="No data due to a bad build."; $o_file_sizes="No data due to a bad build."; -- 2.34.1