blob: 7a52834ee0d0e848802b104719ee7726e3b97aae [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>
Arnaldo Carvalho de Melo721a1f52015-11-19 12:01:48 -03007#include <linux/compiler.h>
Arnaldo Carvalho de Melo54359d32012-12-14 13:06:13 -03008#include "tests.h"
9
10extern int verbose;
11
Arnaldo Carvalho de Melo721a1f52015-11-19 12:01:48 -030012int test__python_use(int subtest __maybe_unused)
Arnaldo Carvalho de Melo54359d32012-12-14 13:06:13 -030013{
14 char *cmd;
15 int ret;
16
Namhyung Kim000ae332012-12-17 16:25:01 +090017 if (asprintf(&cmd, "echo \"import sys ; sys.path.append('%s'); import perf\" | %s %s",
18 PYTHONPATH, PYTHON, verbose ? "" : "2> /dev/null") < 0)
Arnaldo Carvalho de Melo54359d32012-12-14 13:06:13 -030019 return -1;
20
21 ret = system(cmd) ? -1 : 0;
22 free(cmd);
23 return ret;
24}