diff options
Diffstat (limited to 'tools/perf/tests/python-use.c')
-rw-r--r-- | tools/perf/tests/python-use.c | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/tools/perf/tests/python-use.c b/tools/perf/tests/python-use.c new file mode 100644 index 000000000000..7760277c6def --- /dev/null +++ b/tools/perf/tests/python-use.c | |||
@@ -0,0 +1,23 @@ | |||
1 | /* | ||
2 | * Just test if we can load the python binding. | ||
3 | */ | ||
4 | |||
5 | #include <stdio.h> | ||
6 | #include <stdlib.h> | ||
7 | #include "tests.h" | ||
8 | |||
9 | extern int verbose; | ||
10 | |||
11 | int test__python_use(void) | ||
12 | { | ||
13 | char *cmd; | ||
14 | int ret; | ||
15 | |||
16 | if (asprintf(&cmd, "echo \"import sys ; sys.path.append('%s'); import perf\" | %s %s", | ||
17 | PYTHONPATH, PYTHON, verbose ? "" : "2> /dev/null") < 0) | ||
18 | return -1; | ||
19 | |||
20 | ret = system(cmd) ? -1 : 0; | ||
21 | free(cmd); | ||
22 | return ret; | ||
23 | } | ||