Commit 6c866349 authored by Daniel Agar's avatar Daniel Agar

allow pyston to run from a directory other than pyston

-the Makefile has been moved up from src/Makefile to the top level
-all pyston binaries and unittests (gc, analysis) are also placed in the
top directory
parent bb3a19e1
......@@ -20,6 +20,8 @@ pyston_release
pyston_grwl
pyston_grwl_dbg
pyston_nosync
/gc
/analysis
*.cache
tests/t.py
......
This diff is collapsed.
......@@ -889,9 +889,6 @@ static std::string getParserCommandLine(const char* fn) {
// Start by removing the binary name, because the "pyston" binary will break the logic below
llvm::sys::path::remove_filename(parse_ast_fn);
while (llvm::sys::path::filename(parse_ast_fn) != "pyston") {
llvm::sys::path::remove_filename(parse_ast_fn);
}
llvm::sys::path::append(parse_ast_fn, "src/codegen/parse_ast.py");
return std::string("python -S ") + parse_ast_fn.str().str() + " " + fn;
......
......@@ -119,7 +119,6 @@ int main(int argc, char** argv) {
llvm::SmallString<128> stdlib_dir(self_path);
llvm::sys::path::remove_filename(stdlib_dir); // executable name
llvm::sys::path::remove_filename(stdlib_dir); // "src/" dir
llvm::sys::path::append(stdlib_dir, "lib_python");
llvm::sys::path::append(stdlib_dir, "2.7");
appendToSysPath(stdlib_dir.c_str());
......
......@@ -937,7 +937,7 @@ extern "C" Py_ssize_t PyNumber_AsSsize_t(PyObject* o, PyObject* exc) {
}
BoxedModule* importTestExtension(const std::string& name) {
std::string pathname_name = "../test/test_extension/" + name + ".pyston.so";
std::string pathname_name = "test/test_extension/" + name + ".pyston.so";
const char* pathname = pathname_name.c_str();
void* handle = dlopen(pathname, RTLD_NOW);
if (!handle) {
......
......@@ -22,7 +22,7 @@ protected:
};
TEST_F(AnalysisTest, augassign) {
const std::string fn("../test/unittests/analysis_listcomp.py");
const std::string fn("test/unittests/analysis_listcomp.py");
AST_Module* module = caching_parse(fn.c_str());
assert(module);
......
......@@ -69,7 +69,7 @@ def get_expected_output(fn):
# TODO don't suppress warnings globally:
env = dict(os.environ)
env["PYTHONPATH"] = "../test/test_extension/build/lib.linux-x86_64-2.7/"
env["PYTHONPATH"] = os.path.dirname(os.path.realpath(__file__)) + "/../test/test_extension/build/lib.linux-x86_64-2.7/"
p = subprocess.Popen(["python", "-Wignore", fn], stdout=subprocess.PIPE, stderr=subprocess.PIPE, stdin=open("/dev/null"), preexec_fn=set_ulimits, env=env)
out, err = p.communicate()
code = p.wait()
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment