File: parse-cover-report

package info (click to toggle)
percona-toolkit 3.2.1-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye, forky, trixie
  • size: 68,916 kB
  • sloc: perl: 241,287; sql: 22,868; sh: 19,746; javascript: 6,799; makefile: 353; awk: 38; python: 30; sed: 1
file content (32 lines) | stat: -rwxr-xr-x 695 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#!/usr/bin/env awk -f
/^File/ {
   line_fmt="%-30s %5s %5s %5s %5s %5s\n";

   while ( getline && $0 !~ /^Total/ ) {
      if ( $1 ~ /\.pm/ ) {
         n=split($1, path, "/")

         printf("Test coverage for Percona Toolkit %s on ", path[n]);
         system("date -u +'%F %T UTC'");
         print ""

         printf(line_fmt, "File", "stmt", "bran", "cond", "sub", "total");
         printf(line_fmt, "------------------------------", "-----", "-----", "-----", "-----", "-----");
         printf(line_fmt, path[n], $2, $3, $4, $5, $7)

         break;
      }
   }
   print ""

   while ( $0 !~ /^line/ ) {
      getline
   }
   print

   while ( getline ) {
      print
   }

   exit
}