Loading...
1/*
2 * Just test if we can load the python binding.
3 */
4
5#include <stdio.h>
6#include <stdlib.h>
7#include <linux/compiler.h>
8#include "tests.h"
9
10extern int verbose;
11
12int test__python_use(int subtest __maybe_unused)
13{
14 char *cmd;
15 int ret;
16
17 if (asprintf(&cmd, "echo \"import sys ; sys.path.append('%s'); import perf\" | %s %s",
18 PYTHONPATH, PYTHON, verbose ? "" : "2> /dev/null") < 0)
19 return -1;
20
21 ret = system(cmd) ? -1 : 0;
22 free(cmd);
23 return ret;
24}
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
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\" | %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}