Skip to content

Commit

Permalink
Merge pull request #39 from jensdietrich/sum-stats
Browse files Browse the repository at this point in the history
Automatically sum stats*.log into summed_stats.log after finishing
  • Loading branch information
wtwhite authored Sep 29, 2023
2 parents 562b0b0 + fb5dd64 commit 9989720
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion tools/run_shadedetector_on_all.pl
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
my $cacheDir = (-d $localScratchCacheDir ? $localScratchCacheDir : "$ENV{HOME}/code/shadedetector/.cache");
my $jarPath = "../target/shadedetector.jar";
my $xshadyPath = "$ENV{HOME}/code/xshady";
my $sumStatsCmd = "../tools/sum_stats.pl stats*.log > summed_stats.log";

my $mode = "make";

Expand All @@ -24,6 +25,10 @@
my @targets;
my @rules;

if ($mode eq 'shell-script') {
print "echo '#'`date` >> started\necho EXTRA_FLAGS=\"\${EXTRA_FLAGS}\" >> started\n";
}

foreach my $d (<CVE-*>) {
my $statsFName = "stats$n-$d.log";
my $pomFName = `realpath $d/pom.xml`;
Expand All @@ -47,9 +52,11 @@
print ".PHONY: all started finished\n\n";
unshift @targets, "started";
unshift @rules, "started:\n\techo '#'`date` >> \$\@\n\techo EXTRA_FLAGS=\"\${EXTRA_FLAGS}\" >> \$\@\n\n";
push @rules, "finished: " . join(" ", @targets) . "\n\tdate >> \$\@\n\n";
push @rules, "finished: " . join(" ", @targets) . "\n\tdate >> \$\@\n\t$sumStatsCmd\n\n";
push @targets, "finished";

print join(" \\\n\t", "all:", @targets), "\n\n";
print @rules;
} else {
print "date >> finished\n$sumStatsCmd\n";
}

0 comments on commit 9989720

Please sign in to comment.