Ted Kremenek | 9cc8c2c | 2008-04-01 20:47:38 +0000 | [diff] [blame] | 1 | #!/usr/bin/env perl |
| 2 | # |
| 3 | # The LLVM Compiler Infrastructure |
| 4 | # |
| 5 | # This file is distributed under the University of Illinois Open Source |
| 6 | # License. See LICENSE.TXT for details. |
| 7 | # |
| 8 | ##===----------------------------------------------------------------------===## |
| 9 | # |
| 10 | # A script designed to wrap a build so that all calls to gcc are intercepted |
| 11 | # and piped to the static analyzer. |
| 12 | # |
| 13 | ##===----------------------------------------------------------------------===## |
| 14 | |
| 15 | use strict; |
| 16 | use warnings; |
| 17 | use File::Temp qw/ :mktemp /; |
| 18 | |
| 19 | my $Verbose = 0; # Verbose output from this script. |
| 20 | my $Prog = "scan-build"; |
| 21 | |
| 22 | ##----------------------------------------------------------------------------## |
| 23 | # GetHTMLRunDir - Construct an HTML directory name for the current run. |
| 24 | ##----------------------------------------------------------------------------## |
| 25 | |
Sam Bishop | a0e2266 | 2008-04-02 03:35:43 +0000 | [diff] [blame] | 26 | sub GetHTMLRunDir { |
Ted Kremenek | 9cc8c2c | 2008-04-01 20:47:38 +0000 | [diff] [blame] | 27 | |
| 28 | die "Not enough arguments." if (@_ == 0); |
| 29 | |
| 30 | my $Dir = shift @_; |
| 31 | |
| 32 | # Get current date and time. |
| 33 | |
| 34 | my @CurrentTime = localtime(); |
| 35 | |
| 36 | my $year = $CurrentTime[5] + 1900; |
| 37 | my $day = $CurrentTime[3]; |
| 38 | my $month = $CurrentTime[4] + 1; |
| 39 | |
| 40 | my $DateString = "$year-$month-$day"; |
| 41 | |
| 42 | # Determine the run number. |
| 43 | |
| 44 | my $RunNumber; |
| 45 | |
| 46 | if (-d $Dir) { |
| 47 | |
| 48 | if (! -r $Dir) { |
Sam Bishop | a0e2266 | 2008-04-02 03:35:43 +0000 | [diff] [blame] | 49 | die "error: '$Dir' exists but is not readable.\n"; |
Ted Kremenek | 9cc8c2c | 2008-04-01 20:47:38 +0000 | [diff] [blame] | 50 | } |
| 51 | |
| 52 | # Iterate over all files in the specified directory. |
| 53 | |
| 54 | my $max = 0; |
| 55 | |
| 56 | opendir(DIR, $Dir); |
| 57 | my @FILES= readdir(DIR); |
| 58 | closedir(DIR); |
| 59 | |
| 60 | foreach my $f (@FILES) { |
| 61 | |
| 62 | my @x = split/-/, $f; |
| 63 | |
| 64 | next if (scalar(@x) != 4); |
| 65 | next if ($x[0] != $year); |
| 66 | next if ($x[1] != $month); |
| 67 | next if ($x[2] != $day); |
| 68 | |
| 69 | if ($x[3] > $max) { |
| 70 | $max = $x[3]; |
| 71 | } |
| 72 | } |
| 73 | |
| 74 | $RunNumber = $max + 1; |
| 75 | } |
| 76 | else { |
| 77 | |
| 78 | if (-x $Dir) { |
Sam Bishop | a0e2266 | 2008-04-02 03:35:43 +0000 | [diff] [blame] | 79 | die "error: '$Dir' exists but is not a directory.\n"; |
Ted Kremenek | 9cc8c2c | 2008-04-01 20:47:38 +0000 | [diff] [blame] | 80 | } |
| 81 | |
| 82 | # $Dir does not exist. It will be automatically created by the |
| 83 | # clang driver. Set the run number to 1. |
| 84 | |
| 85 | $RunNumber = 1; |
| 86 | } |
| 87 | |
| 88 | die "RunNumber must be defined!" if (!defined($RunNumber)); |
| 89 | |
| 90 | # Append the run number. |
| 91 | |
| 92 | return "$Dir/$DateString-$RunNumber"; |
| 93 | } |
| 94 | |
Sam Bishop | a0e2266 | 2008-04-02 03:35:43 +0000 | [diff] [blame] | 95 | sub SetHtmlEnv { |
Ted Kremenek | 9cc8c2c | 2008-04-01 20:47:38 +0000 | [diff] [blame] | 96 | |
| 97 | die "Wrong number of arguments." if (scalar(@_) != 2); |
| 98 | |
| 99 | my $Args = shift; |
| 100 | my $Dir = shift; |
| 101 | |
| 102 | die "No build command." if (scalar(@$Args) == 0); |
| 103 | |
| 104 | my $Cmd = $$Args[0]; |
| 105 | |
| 106 | if ($Cmd =~ /configure/) { |
| 107 | return; |
| 108 | } |
| 109 | |
| 110 | if ($Verbose) { |
| 111 | print "$Prog: Emitting reports for this run to '$Dir'.\n"; |
| 112 | } |
| 113 | |
| 114 | $ENV{'CCC_ANALYZER_HTML'} = $Dir; |
| 115 | } |
| 116 | |
| 117 | ##----------------------------------------------------------------------------## |
Ted Kremenek | 5744dc2 | 2008-04-02 18:03:36 +0000 | [diff] [blame] | 118 | # ScanFile - Scan a report file for various identifying attributes. |
| 119 | ##----------------------------------------------------------------------------## |
| 120 | |
| 121 | sub ScanFile { |
| 122 | |
| 123 | my $Index = shift; |
| 124 | my $Dir = shift; |
| 125 | my $FName = shift; |
| 126 | |
| 127 | open(IN, "$Dir/$FName") or die "$Prog: Cannot open '$Dir/$FName'\n"; |
| 128 | |
| 129 | my $BugDesc = ""; |
| 130 | |
| 131 | while (<IN>) { |
| 132 | |
| 133 | if (/<!-- BUGDESC (.*) -->$/) { |
| 134 | $BugDesc = $1; |
| 135 | last; |
| 136 | } |
| 137 | |
| 138 | } |
| 139 | |
| 140 | close(IN); |
| 141 | |
| 142 | push @$Index,[ $FName, $BugDesc ]; |
| 143 | } |
| 144 | |
| 145 | ##----------------------------------------------------------------------------## |
Ted Kremenek | 9cc8c2c | 2008-04-01 20:47:38 +0000 | [diff] [blame] | 146 | # Postprocess - Postprocess the results of an analysis scan. |
| 147 | ##----------------------------------------------------------------------------## |
| 148 | |
Sam Bishop | a0e2266 | 2008-04-02 03:35:43 +0000 | [diff] [blame] | 149 | sub Postprocess { |
Ted Kremenek | 9cc8c2c | 2008-04-01 20:47:38 +0000 | [diff] [blame] | 150 | |
| 151 | my $Dir = shift; |
| 152 | |
| 153 | die "No directory specified." if (!defined($Dir)); |
| 154 | |
| 155 | if (! -d $Dir) { |
| 156 | return; |
| 157 | } |
| 158 | |
| 159 | opendir(DIR, $Dir); |
| 160 | my @files = grep(/^report-.*\.html$/,readdir(DIR)); |
| 161 | closedir(DIR); |
| 162 | |
| 163 | if (scalar(@files) == 0) { |
Ted Kremenek | 0249378 | 2008-04-02 07:05:07 +0000 | [diff] [blame] | 164 | print "$Prog: Removing directory '$Dir' because it contains no reports.\n"; |
Ted Kremenek | 9cc8c2c | 2008-04-01 20:47:38 +0000 | [diff] [blame] | 165 | `rm -fR $Dir`; |
| 166 | return; |
| 167 | } |
Ted Kremenek | 5744dc2 | 2008-04-02 18:03:36 +0000 | [diff] [blame] | 168 | |
| 169 | # Scan each report file and build an index. |
| 170 | |
| 171 | my @Index; |
| 172 | |
| 173 | foreach my $file (@files) { ScanFile(\@Index, $Dir, $file); } |
| 174 | |
| 175 | # Generate an index.html file. |
| 176 | |
| 177 | my $FName = "$Dir/index.html"; |
| 178 | |
| 179 | open(OUT, ">$FName") or die "$Prog: Cannot create file '$FName'\n"; |
| 180 | |
| 181 | print OUT <<ENDTEXT; |
| 182 | <html> |
| 183 | <head> |
Ted Kremenek | 7f8a325 | 2008-04-02 18:42:49 +0000 | [diff] [blame] | 184 | <style type="text/css"> |
| 185 | body { color:#000000; background-color:#ffffff } |
| 186 | body { font-family: Helvetica, sans-serif; font-size:10pt } |
| 187 | h1 { font-size:12pt } |
| 188 | .reports { border: 1px #000000 solid } |
| 189 | .reports { border-collapse: collapse; border-spacing: 0px } |
| 190 | tr { vertical-align:top } |
| 191 | td { border-bottom: 1px #000000 dotted } |
| 192 | td { padding:5px; padding-left:5px; padding-right:5px } |
| 193 | td.header { border-top: 2px solid #000000; } |
| 194 | td.header { border-bottom: 2px solid #000000; } |
| 195 | td.header { font-weight: bold; font-family: Verdana } |
| 196 | </style> |
Ted Kremenek | 5744dc2 | 2008-04-02 18:03:36 +0000 | [diff] [blame] | 197 | </head>\n<body> |
| 198 | <table class="reports"> |
Ted Kremenek | 7f8a325 | 2008-04-02 18:42:49 +0000 | [diff] [blame] | 199 | <tr> |
| 200 | <td class="header">Bug Type</td> |
| 201 | <td class="header"></td> |
| 202 | </tr> |
Ted Kremenek | 5744dc2 | 2008-04-02 18:03:36 +0000 | [diff] [blame] | 203 | ENDTEXT |
Ted Kremenek | 9cc8c2c | 2008-04-01 20:47:38 +0000 | [diff] [blame] | 204 | |
Ted Kremenek | 5744dc2 | 2008-04-02 18:03:36 +0000 | [diff] [blame] | 205 | for my $row ( sort { $a->[1] cmp $b->[1] } @Index ) { |
| 206 | |
| 207 | print OUT "<tr>\n"; |
Ted Kremenek | 9cc8c2c | 2008-04-01 20:47:38 +0000 | [diff] [blame] | 208 | |
Ted Kremenek | 5744dc2 | 2008-04-02 18:03:36 +0000 | [diff] [blame] | 209 | my $ReportFile = $row->[0]; |
| 210 | |
| 211 | print OUT " <td class=\"DESC\">$row->[1]</td>\n"; |
| 212 | |
| 213 | for my $j ( 2 .. $#{$row} ) { |
| 214 | print OUT "<td>$row->[$j]</td>\n" |
| 215 | } |
Ted Kremenek | 7f8a325 | 2008-04-02 18:42:49 +0000 | [diff] [blame] | 216 | |
| 217 | # Emit the "View" link. |
Ted Kremenek | 5744dc2 | 2008-04-02 18:03:36 +0000 | [diff] [blame] | 218 | |
Ted Kremenek | 7f8a325 | 2008-04-02 18:42:49 +0000 | [diff] [blame] | 219 | print OUT " <td><a href=\"$ReportFile#EndPath\">View</a></td>\n"; |
| 220 | |
| 221 | # End the row. |
Ted Kremenek | 5744dc2 | 2008-04-02 18:03:36 +0000 | [diff] [blame] | 222 | print OUT "</tr>\n"; |
| 223 | } |
| 224 | |
| 225 | print OUT "</table>\n</body></html>\n"; |
| 226 | close(OUT); |
Ted Kremenek | 9cc8c2c | 2008-04-01 20:47:38 +0000 | [diff] [blame] | 227 | } |
| 228 | |
| 229 | ##----------------------------------------------------------------------------## |
Ted Kremenek | dab1110 | 2008-04-02 04:43:42 +0000 | [diff] [blame] | 230 | # RunBuildCommand - Run the build command. |
| 231 | ##----------------------------------------------------------------------------## |
| 232 | |
| 233 | sub RunBuildCommand { |
| 234 | |
| 235 | my $Args = shift; |
Ted Kremenek | 7442ca6 | 2008-04-02 16:04:51 +0000 | [diff] [blame] | 236 | my $IgnoreErrors = shift; |
Ted Kremenek | dab1110 | 2008-04-02 04:43:42 +0000 | [diff] [blame] | 237 | my $Cmd = $Args->[0]; |
| 238 | |
Ted Kremenek | 6a43ba9 | 2008-04-02 15:34:12 +0000 | [diff] [blame] | 239 | if ($Cmd eq "gcc" or $Cmd eq "cc" or $Cmd eq "llvm-gcc") { |
Ted Kremenek | dab1110 | 2008-04-02 04:43:42 +0000 | [diff] [blame] | 240 | shift @$Args; |
| 241 | unshift @$Args, "ccc-analyzer" |
| 242 | } |
Ted Kremenek | 7442ca6 | 2008-04-02 16:04:51 +0000 | [diff] [blame] | 243 | elsif ($IgnoreErrors) { |
| 244 | if ($Cmd eq "make" or $Cmd eq "gmake") { |
| 245 | push @$Args, "-k"; |
| 246 | } |
| 247 | elsif ($Cmd eq "xcodebuild") { |
| 248 | push @$Args, "-PBXBuildsContinueAfterErrors=YES"; |
| 249 | } |
| 250 | } |
Ted Kremenek | dab1110 | 2008-04-02 04:43:42 +0000 | [diff] [blame] | 251 | |
| 252 | system(@$Args); |
| 253 | } |
| 254 | |
Ted Kremenek | dab1110 | 2008-04-02 04:43:42 +0000 | [diff] [blame] | 255 | ##----------------------------------------------------------------------------## |
Ted Kremenek | 9cc8c2c | 2008-04-01 20:47:38 +0000 | [diff] [blame] | 256 | # DisplayHelp - Utility function to display all help options. |
| 257 | ##----------------------------------------------------------------------------## |
| 258 | |
Sam Bishop | a0e2266 | 2008-04-02 03:35:43 +0000 | [diff] [blame] | 259 | sub DisplayHelp { |
Ted Kremenek | 9cc8c2c | 2008-04-01 20:47:38 +0000 | [diff] [blame] | 260 | |
Ted Kremenek | 5744dc2 | 2008-04-02 18:03:36 +0000 | [diff] [blame] | 261 | print <<ENDTEXT; |
Sam Bishop | a0e2266 | 2008-04-02 03:35:43 +0000 | [diff] [blame] | 262 | USAGE: $Prog [options] <build command> [build options] |
Ted Kremenek | 2b74ab6 | 2008-04-01 21:22:03 +0000 | [diff] [blame] | 263 | |
| 264 | OPTIONS: |
| 265 | |
| 266 | -o - Target directory for HTML report files. Subdirectories |
Sam Bishop | a0e2266 | 2008-04-02 03:35:43 +0000 | [diff] [blame] | 267 | will be created as needed to represent separate "runs" of |
Ted Kremenek | 2b74ab6 | 2008-04-01 21:22:03 +0000 | [diff] [blame] | 268 | the analyzer. If this option is not specified, a directory |
| 269 | is created in /tmp to store the reports. |
| 270 | |
Sam Bishop | a0e2266 | 2008-04-02 03:35:43 +0000 | [diff] [blame] | 271 | -?, -h - Display this message. |
Ted Kremenek | 2b74ab6 | 2008-04-01 21:22:03 +0000 | [diff] [blame] | 272 | --help |
Ted Kremenek | 9cc8c2c | 2008-04-01 20:47:38 +0000 | [diff] [blame] | 273 | |
Ted Kremenek | af08f64 | 2008-04-02 16:31:58 +0000 | [diff] [blame] | 274 | -k - Add a "keep on going" option to the specified build command. |
Ted Kremenek | f02e8db | 2008-04-02 16:41:25 +0000 | [diff] [blame] | 275 | --keep-going This option currently supports make and xcodebuild. |
| 276 | This is a convenience option; one can specify this |
| 277 | behavior directly using build options. |
Ted Kremenek | 2b74ab6 | 2008-04-01 21:22:03 +0000 | [diff] [blame] | 278 | |
Ted Kremenek | dab1110 | 2008-04-02 04:43:42 +0000 | [diff] [blame] | 279 | -v - Verbose output from $Prog and the analyzer. |
| 280 | A second "-v" increases verbosity. |
Ted Kremenek | 2b74ab6 | 2008-04-01 21:22:03 +0000 | [diff] [blame] | 281 | |
Ted Kremenek | 7f8a325 | 2008-04-02 18:42:49 +0000 | [diff] [blame] | 282 | -V - View analysis results in a web browser when the build |
| 283 | --view completes. |
| 284 | |
Ted Kremenek | 2b74ab6 | 2008-04-01 21:22:03 +0000 | [diff] [blame] | 285 | BUILD OPTIONS |
| 286 | |
Ted Kremenek | 39eefde | 2008-04-02 16:47:27 +0000 | [diff] [blame] | 287 | You can specify any build option acceptable to the build command. |
| 288 | |
Ted Kremenek | 5744dc2 | 2008-04-02 18:03:36 +0000 | [diff] [blame] | 289 | EXAMPLE |
Ted Kremenek | 2b74ab6 | 2008-04-01 21:22:03 +0000 | [diff] [blame] | 290 | |
Ted Kremenek | 5744dc2 | 2008-04-02 18:03:36 +0000 | [diff] [blame] | 291 | $Prog -o /tmp/myhtmldir make -j4 |
Ted Kremenek | 2b74ab6 | 2008-04-01 21:22:03 +0000 | [diff] [blame] | 292 | |
Ted Kremenek | 39eefde | 2008-04-02 16:47:27 +0000 | [diff] [blame] | 293 | The above example causes analysis reports to be deposited into |
| 294 | a subdirectory of "/tmp/myhtmldir" and to run "make" with the "-j4" option. |
| 295 | A different subdirectory is created each time $Prog analyzes a project. |
| 296 | The analyzer should support most parallel builds, but not distributed builds. |
Ted Kremenek | 2b74ab6 | 2008-04-01 21:22:03 +0000 | [diff] [blame] | 297 | |
| 298 | ENDTEXT |
Ted Kremenek | 9cc8c2c | 2008-04-01 20:47:38 +0000 | [diff] [blame] | 299 | } |
| 300 | |
| 301 | ##----------------------------------------------------------------------------## |
| 302 | # Process command-line arguments. |
| 303 | ##----------------------------------------------------------------------------## |
| 304 | |
| 305 | my $HtmlDir; # Parent directory to store HTML files. |
| 306 | my $IgnoreErrors = 0; # Ignore build errors. |
Ted Kremenek | 7f8a325 | 2008-04-02 18:42:49 +0000 | [diff] [blame] | 307 | my $ViewResults = 0; # View results when the build terminates. |
Ted Kremenek | 9cc8c2c | 2008-04-01 20:47:38 +0000 | [diff] [blame] | 308 | |
| 309 | if (!@ARGV) { |
| 310 | DisplayHelp(); |
Sam Bishop | a0e2266 | 2008-04-02 03:35:43 +0000 | [diff] [blame] | 311 | exit 1; |
Ted Kremenek | 9cc8c2c | 2008-04-01 20:47:38 +0000 | [diff] [blame] | 312 | } |
| 313 | |
| 314 | while (@ARGV) { |
| 315 | |
| 316 | # Scan for options we recognize. |
| 317 | |
| 318 | my $arg = $ARGV[0]; |
| 319 | |
Sam Bishop | a0e2266 | 2008-04-02 03:35:43 +0000 | [diff] [blame] | 320 | if ($arg eq "-?" or $arg eq "-h" or $arg eq "--help") { |
Ted Kremenek | 9cc8c2c | 2008-04-01 20:47:38 +0000 | [diff] [blame] | 321 | DisplayHelp(); |
Sam Bishop | a0e2266 | 2008-04-02 03:35:43 +0000 | [diff] [blame] | 322 | exit 0; |
Ted Kremenek | 9cc8c2c | 2008-04-01 20:47:38 +0000 | [diff] [blame] | 323 | } |
| 324 | |
| 325 | if ($arg eq "-o") { |
| 326 | shift @ARGV; |
| 327 | |
| 328 | if (!@ARGV) { |
Ted Kremenek | 0062ad4 | 2008-04-02 16:35:01 +0000 | [diff] [blame] | 329 | die "$Prog: '-o' option requires a target directory name.\n"; |
Ted Kremenek | 9cc8c2c | 2008-04-01 20:47:38 +0000 | [diff] [blame] | 330 | } |
| 331 | |
| 332 | $HtmlDir = shift @ARGV; |
| 333 | next; |
| 334 | } |
| 335 | |
Ted Kremenek | 2b74ab6 | 2008-04-01 21:22:03 +0000 | [diff] [blame] | 336 | if ($arg eq "-k" or $arg eq "--keep-going") { |
Ted Kremenek | 9cc8c2c | 2008-04-01 20:47:38 +0000 | [diff] [blame] | 337 | shift @ARGV; |
| 338 | $IgnoreErrors = 1; |
| 339 | next; |
| 340 | } |
| 341 | |
| 342 | if ($arg eq "-v") { |
| 343 | shift @ARGV; |
| 344 | $Verbose++; |
| 345 | next; |
| 346 | } |
| 347 | |
Ted Kremenek | 7f8a325 | 2008-04-02 18:42:49 +0000 | [diff] [blame] | 348 | if ($arg eq "-V" or $arg eq "--view") { |
| 349 | shift @ARGV; |
| 350 | $ViewResults = 1; |
| 351 | next; |
| 352 | } |
| 353 | |
Ted Kremenek | 0062ad4 | 2008-04-02 16:35:01 +0000 | [diff] [blame] | 354 | die "$Prog: unrecognized option '$arg'\n" if ($arg =~ /^-/); |
| 355 | |
Ted Kremenek | 9cc8c2c | 2008-04-01 20:47:38 +0000 | [diff] [blame] | 356 | last; |
| 357 | } |
| 358 | |
| 359 | if (!@ARGV) { |
| 360 | print STDERR "$Prog: No build command specified.\n\n"; |
| 361 | DisplayHelp(); |
Sam Bishop | a0e2266 | 2008-04-02 03:35:43 +0000 | [diff] [blame] | 362 | exit 1; |
Ted Kremenek | 9cc8c2c | 2008-04-01 20:47:38 +0000 | [diff] [blame] | 363 | } |
| 364 | |
| 365 | # Determine the output directory for the HTML reports. |
| 366 | |
| 367 | if (!defined($HtmlDir)) { |
| 368 | |
Sam Bishop | a0e2266 | 2008-04-02 03:35:43 +0000 | [diff] [blame] | 369 | $HtmlDir = mkdtemp("/tmp/$Prog-XXXXXX"); |
Ted Kremenek | 9cc8c2c | 2008-04-01 20:47:38 +0000 | [diff] [blame] | 370 | |
| 371 | if (!defined($HtmlDir)) { |
Sam Bishop | a0e2266 | 2008-04-02 03:35:43 +0000 | [diff] [blame] | 372 | die "error: Cannot create HTML directory in /tmp.\n"; |
Ted Kremenek | 9cc8c2c | 2008-04-01 20:47:38 +0000 | [diff] [blame] | 373 | } |
| 374 | |
| 375 | if (!$Verbose) { |
| 376 | print "$Prog: Using '$HtmlDir' as base HTML report directory.\n"; |
| 377 | } |
| 378 | } |
| 379 | |
Sam Bishop | a0e2266 | 2008-04-02 03:35:43 +0000 | [diff] [blame] | 380 | $HtmlDir = GetHTMLRunDir($HtmlDir); |
Ted Kremenek | 9cc8c2c | 2008-04-01 20:47:38 +0000 | [diff] [blame] | 381 | |
| 382 | # Set the appropriate environment variables. |
| 383 | |
Sam Bishop | a0e2266 | 2008-04-02 03:35:43 +0000 | [diff] [blame] | 384 | SetHtmlEnv(\@ARGV, $HtmlDir); |
Ted Kremenek | 9cc8c2c | 2008-04-01 20:47:38 +0000 | [diff] [blame] | 385 | |
| 386 | $ENV{'CC'} = "ccc-analyzer"; |
| 387 | |
| 388 | if ($Verbose >= 2) { |
| 389 | $ENV{'CCC_ANALYZER_VERBOSE'} = 1; |
| 390 | } |
| 391 | |
| 392 | # Run the build. |
| 393 | |
Ted Kremenek | 7442ca6 | 2008-04-02 16:04:51 +0000 | [diff] [blame] | 394 | RunBuildCommand(\@ARGV, $IgnoreErrors); |
Ted Kremenek | 9cc8c2c | 2008-04-01 20:47:38 +0000 | [diff] [blame] | 395 | |
| 396 | # Postprocess the HTML directory. |
| 397 | |
Sam Bishop | a0e2266 | 2008-04-02 03:35:43 +0000 | [diff] [blame] | 398 | Postprocess($HtmlDir); |
Ted Kremenek | 7f8a325 | 2008-04-02 18:42:49 +0000 | [diff] [blame] | 399 | |
| 400 | if ($ViewResults and -r "$HtmlDir/index.html") { |
| 401 | # Only works on Mac OS X (for now). |
| 402 | print "Viewing analysis results: '$HtmlDir/index.html'\n"; |
| 403 | `open $HtmlDir/index.html` |
| 404 | } |