Staging
v0.8.1
swh:1:snp:a902887e4be9191b7c6c4406aa06b31c1ce2c7cc
Raw File
Tip revision: 07d9a380680d1c0eb51ef87ff2eab5c994949e69 authored by Linus Torvalds on 24 October 2016, 00:10:14 UTC
Linux 4.9-rc2
Tip revision: 07d9a38
python-use.c
/*
 * Just test if we can load the python binding.
 */

#include <stdio.h>
#include <stdlib.h>
#include <linux/compiler.h>
#include "tests.h"

extern int verbose;

int test__python_use(int subtest __maybe_unused)
{
	char *cmd;
	int ret;

	if (asprintf(&cmd, "echo \"import sys ; sys.path.append('%s'); import perf\" | %s %s",
		     PYTHONPATH, PYTHON, verbose ? "" : "2> /dev/null") < 0)
		return -1;

	ret = system(cmd) ? -1 : 0;
	free(cmd);
	return ret;
}
back to top