Staging
v0.8.1
swh:1:snp:a902887e4be9191b7c6c4406aa06b31c1ce2c7cc
Raw File
Tip revision: 9e82bf014195d6f0054982c463575cdce24292be authored by Linus Torvalds on 15 September 2014, 00:50:12 UTC
Linux 3.17-rc5
Tip revision: 9e82bf0
python-use.c
/*
 * Just test if we can load the python binding.
 */

#include <stdio.h>
#include <stdlib.h>
#include "tests.h"

extern int verbose;

int test__python_use(void)
{
	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