summarize 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  1. #!/usr/bin/awk -f
  2. function clearvars () {
  3. test = "";
  4. cpu = "";
  5. real = "";
  6. codesize = "";
  7. failed = 0;
  8. crashed = 0;
  9. runtime = 0;
  10. }
  11. function output () {
  12. if (test != "") {
  13. failure = "";
  14. if ((crashed != 0) && (failed == 0)) {
  15. failure = "crashed";
  16. }
  17. else if ((crashed == 0) && (failed != 0)) {
  18. failure = "failed";
  19. }
  20. else if ((crashed != 0) && (failed != 0)) {
  21. failure = "crashed-and-failed";
  22. }
  23. if (failure == "") {
  24. printf "(%-10s %11s %11s %9s)\n", test, cpu, real, codesize;
  25. }
  26. else {
  27. printf "(%-10s %10s)\n", test, failure;
  28. }
  29. }
  30. clearvars();
  31. }
  32. BEGIN {
  33. clearvars();
  34. }
  35. /^Testing/ {
  36. output();
  37. test=$2;
  38. }
  39. /^Running.../ {
  40. runtime = 1;
  41. }
  42. runtime == 1 && $0 == "*** wrong result ***" {
  43. failed = 1;
  44. }
  45. runtime == 1 && /Command .* with non-zero/ {
  46. crashed = 1;
  47. }
  48. runtime == 1 && /Command terminated by signal/ {
  49. crashed = 1;
  50. }
  51. runtime == 1 && /Abort trap/ {
  52. crashed = 1;
  53. }
  54. runtime == 1 && / === context ===/ {
  55. crashed = 1;
  56. }
  57. runtime == 1 && /ERROR/ && $0 !~ /^FATAL-ERROR$/ && $0 !~ /^SCHEME-ERROR$/ && $0 !~ /^SLATEX-ERROR$/ {
  58. crashed = 1;
  59. }
  60. runtime == 1 && /^[ ]*[0-9]+ ms cpu time \([0-9]+ user, [0-9]+ system\)$/ {
  61. cpu = $1;
  62. }
  63. runtime == 1 && /^[ ]*[0-9]+ ms real time$/ {
  64. real = $1;
  65. }
  66. runtime == 1 && /cpu time: ([0-9]+) real time: ([0-9]+)/ {
  67. cpu = $3;
  68. real = $6;
  69. }
  70. runtime == 1 && /^[ ]*([0-9.]+) real [ ]*([0-9.]+) user [ ]*([0-9.]+) sys$/ {
  71. cpu = ($3 + $5) * 1000;
  72. real = $1 * 1000;
  73. }
  74. runtime == 1 && /^code size = [0-9]+$/ {
  75. codesize = $4;
  76. }
  77. END { output() }