Merge tag 'locks-v3.16-2' of git://git.samba.org/jlayton/linux
[linux/fpc-iii.git] / tools / perf / tests / python-use.c
blob7760277c6defa3470a7097c987bcc2de3a2fd13e
1 /*
2 * Just test if we can load the python binding.
3 */
5 #include <stdio.h>
6 #include <stdlib.h>
7 #include "tests.h"
9 extern int verbose;
11 int test__python_use(void)
13 char *cmd;
14 int ret;
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;
20 ret = system(cmd) ? -1 : 0;
21 free(cmd);
22 return ret;