Linux 5.1.15
[linux/fpc-iii.git] / tools / perf / tests / python-use.c
blob40ab72149ce1fd867dc2093adc4521e77a452b67
1 // SPDX-License-Identifier: GPL-2.0
2 /*
3 * Just test if we can load the python binding.
4 */
6 #include <stdio.h>
7 #include <stdlib.h>
8 #include <linux/compiler.h>
9 #include "tests.h"
10 #include "util/debug.h"
12 int test__python_use(struct test *test __maybe_unused, int subtest __maybe_unused)
14 char *cmd;
15 int ret;
17 if (asprintf(&cmd, "echo \"import sys ; sys.path.append('%s'); import perf\" | %s %s",
18 PYTHONPATH, PYTHON, verbose > 0 ? "" : "2> /dev/null") < 0)
19 return -1;
21 ret = system(cmd) ? -1 : 0;
22 free(cmd);
23 return ret;