blob: 15301f4ac3f17b5be01cd17a74a8be84dfb350a5 [file] [log] [blame]
Arnaldo Carvalho de Melo54359d32012-12-14 13:06:13 -03001/*
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
9extern int verbose;
10
11int 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\" | python %s",
17 PYTHONPATH, verbose ? "" : "2> /dev/null") < 0)
18 return -1;
19
20 ret = system(cmd) ? -1 : 0;
21 free(cmd);
22 return ret;
23}