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