Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 338891
b: refs/heads/master
c: 9a8e85a
h: refs/heads/master
i:
  338889: 1d71f56
  338887: 2de9460
v: v3
  • Loading branch information
Arnaldo Carvalho de Melo committed Oct 24, 2012
1 parent a0a0821 commit 4f31e63
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 3 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 2305c82fb35dd2c8c9533303bb1693f1636c66e4
refs/heads/master: 9a8e85ad0b61ec0720df7d24392163c2a12626d0
18 changes: 16 additions & 2 deletions trunk/tools/perf/builtin-test.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
#include "builtin.h"

#include "util/cache.h"
#include "util/color.h"
#include "util/debug.h"
#include "util/debugfs.h"
#include "util/evlist.h"
Expand Down Expand Up @@ -1485,18 +1486,31 @@ static bool perf_test__matches(int curr, int argc, const char *argv[])
static int __cmd_test(int argc, const char *argv[])
{
int i = 0;
int width = 0;

while (tests[i].func) {
int len = strlen(tests[i].desc);

if (width < len)
width = len;
++i;
}

i = 0;
while (tests[i].func) {
int curr = i++, err;

if (!perf_test__matches(curr, argc, argv))
continue;

pr_info("%2d: %s:", i, tests[curr].desc);
pr_info("%2d: %-*s:", i, width, tests[curr].desc);
pr_debug("\n--- start ---\n");
err = tests[curr].func();
pr_debug("---- end ----\n%s:", tests[curr].desc);
pr_info(" %s\n", err ? "FAILED!\n" : "Ok");
if (err)
color_fprintf(stderr, PERF_COLOR_RED, " FAILED!\n");
else
pr_info(" Ok\n");
}

return 0;
Expand Down

0 comments on commit 4f31e63

Please sign in to comment.