Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 349922
b: refs/heads/master
c: 54359d3
h: refs/heads/master
v: v3
  • Loading branch information
Arnaldo Carvalho de Melo committed Jan 24, 2013
1 parent 902cf48 commit 51a1ed0
Show file tree
Hide file tree
Showing 5 changed files with 33 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 56e52e85366717481cde16b3480f015c7eb32ba3
refs/heads/master: 54359d3340241b4cf53e42ecd5c429d7ba6fbef3
4 changes: 4 additions & 0 deletions trunk/tools/perf/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -488,6 +488,7 @@ LIB_OBJS += $(OUTPUT)tests/evsel-roundtrip-name.o
LIB_OBJS += $(OUTPUT)tests/evsel-tp-sched.o
LIB_OBJS += $(OUTPUT)tests/pmu.o
LIB_OBJS += $(OUTPUT)tests/hists_link.o
LIB_OBJS += $(OUTPUT)tests/python-use.o

BUILTIN_OBJS += $(OUTPUT)builtin-annotate.o
BUILTIN_OBJS += $(OUTPUT)builtin-bench.o
Expand Down Expand Up @@ -955,6 +956,9 @@ $(OUTPUT)tests/attr.o: tests/attr.c $(OUTPUT)PERF-CFLAGS
'-DBINDIR="$(bindir_SQ)"' \
$<

$(OUTPUT)tests/python-use.o: tests/python-use.c $(OUTPUT)PERF-CFLAGS
$(QUIET_CC)$(CC) -o $@ -c $(ALL_CFLAGS) -DPYTHONPATH='"$(OUTPUT)/python"' $<

$(OUTPUT)util/config.o: util/config.c $(OUTPUT)PERF-CFLAGS
$(QUIET_CC)$(CC) -o $@ -c $(ALL_CFLAGS) -DETC_PERFCONFIG='"$(ETC_PERFCONFIG_SQ)"' $<

Expand Down
4 changes: 4 additions & 0 deletions trunk/tools/perf/tests/builtin-test.c
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,10 @@ static struct test {
.desc = "Test matching and linking mutliple hists",
.func = test__hists_link,
},
{
.desc = "Try 'use perf' in python, checking link problems",
.func = test__python_use,
},
{
.func = NULL,
},
Expand Down
23 changes: 23 additions & 0 deletions trunk/tools/perf/tests/python-use.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
/*
* Just test if we can load the python binding.
*/

#include <stdio.h>
#include <stdlib.h>
#include "tests.h"

extern int verbose;

int test__python_use(void)
{
char *cmd;
int ret;

if (asprintf(&cmd, "echo \"import sys ; sys.path.append('%s'); import perf\" | python %s",
PYTHONPATH, verbose ? "" : "2> /dev/null") < 0)
return -1;

ret = system(cmd) ? -1 : 0;
free(cmd);
return ret;
}
1 change: 1 addition & 0 deletions trunk/tools/perf/tests/tests.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,6 @@ int test__attr(void);
int test__dso_data(void);
int test__parse_events(void);
int test__hists_link(void);
int test__python_use(void);

#endif /* TESTS_H */

0 comments on commit 51a1ed0

Please sign in to comment.