summaryrefslogtreecommitdiff
path: root/unittests/autotestscripts/subtests/file_size_monitor.pl
diff options
context:
space:
mode:
Diffstat (limited to 'unittests/autotestscripts/subtests/file_size_monitor.pl')
-rw-r--r--unittests/autotestscripts/subtests/file_size_monitor.pl40
1 files changed, 40 insertions, 0 deletions
diff --git a/unittests/autotestscripts/subtests/file_size_monitor.pl b/unittests/autotestscripts/subtests/file_size_monitor.pl
new file mode 100644
index 0000000..fa834d3
--- /dev/null
+++ b/unittests/autotestscripts/subtests/file_size_monitor.pl
@@ -0,0 +1,40 @@
+#!perl
+
+use File::Find;
+
+# customize here
+print "Running file size monitor\n";
+
+LogDirectorySize("PC shader size", "../../../game/hl2/shaders","\.vcs","\.360\.vcs");
+LogDirectorySize("PC Game Bin DLL size", "../../../game/bin/","\.dll","_360\.dll");
+LogDirectorySize("360 shader size", "../../../game/hl2/shaders","\.360\.vcs");
+LogDirectorySize("360 Game Bin DLL size", "../../../game/bin/","_360\.dll");
+LogDirectorySize("tf texture size","../../../game/tf/materials/","\.vtf");
+
+
+
+
+
+
+
+sub LogDirectorySize
+ {
+ my ($label, $basedir, $filepattern, $excludepattern ) = @_;
+ undef @FileList;
+ find(\&ProcessFile, $basedir);
+ my $total_size = 0;
+ foreach $_ (@FileList)
+ {
+ next if ( length($excludepattern) && ( /$excludepattern/i ) );
+ if (/$filepattern/i)
+ {
+ $total_size += (-s $_ );
+ }
+ }
+ print "$label := $total_size\n";
+ }
+
+sub ProcessFile
+ {
+ push @FileList, $File::Find::name;
+ }