Commit 7d327a89 authored by Kevin Modzelewski's avatar Kevin Modzelewski

Pass -S to subprocesses in tests

It's bad that we need to do that right now, but it's not the job of
these tests to test that.
parent 7883d455
......@@ -463,7 +463,7 @@ static int main(int argc, char** argv) noexcept {
// if the user invoked `pyston -c command`
if (command != NULL) {
try {
main_module = createModule(boxString("__main__"), "<string>");
main_module = createModule(autoDecref(boxString("__main__")), "<string>");
AST_Module* m = parse_string(command, /* future_flags = */ 0);
compileAndRunModule(m, main_module);
rtncode = 0;
......
# expected: reffail
import sys
import subprocess
......@@ -13,13 +12,13 @@ with open('/dev/null')as ignore:
print code
sys.stdout.flush()
run(["-c", "print 2 + 2"])
run(["-c", "import sys; print sys.argv", "hello", "world"])
run(["-c", "import sys; print sys.argv", "-c", "this is ignored"])
run(["-Sc", "print 2 + 2"])
run(["-Sc", "import sys; print sys.argv", "hello", "world"])
run(["-Sc", "import sys; print sys.argv", "-c", "this is ignored"])
run(["-c"])
run(["-c", "-c"])
run(["-c", "this should not work"])
run(["-Sc"])
run(["-Sc", "-c"])
run(["-Sc", "this should not work"])
run(["-c", ";"])
run(["-cprint 1"])
run(["-Sc", ";"])
run(["-Scprint 1"])
......@@ -16,9 +16,9 @@ with open('/dev/null')as ignore:
print p.returncode
# just prints out the usage
run(["-m", "pydoc"])
run(["-Sm", "pydoc"])
run(["-m", "doesnt_exist"])
run(["-Sm", "doesnt_exist"])
os.environ["PYTHONPATH"] = os.path.dirname(__file__)
run(["-m", "import_target"])
run(["-Sm", "import_target"])
# expected: reffail
import sys
import subprocess
me = sys.executable
p = subprocess.Popen([me, "-c", "1/0"], stdout=subprocess.PIPE)
p = subprocess.Popen([me, "-Sc", "1/0"], stdout=subprocess.PIPE)
print p.stdout.read()
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