@@ -70,8 +70,8 @@ def get_gp():
7070 print (
7171 "Standalone module tests require a GraalVM installation including graalpy, java, javac and native-image" ,
7272 "Please point the JAVA_HOME environment variable to such a GraalVM root." ,
73- "__graalpython__.home : " + java_home ,
74- "native-image exists: " + str (os .path .exists (ni )),
73+ "__graalpython__.home : " + java_home ,
74+ "native-image exists: " + str (os .path .exists (ni )),
7575 "javac exists: " + str (os .path .exists (jc )),
7676 "graalpy exits: " + str (os .path .exists (graalpy )),
7777 "java exists: " + str (os .path .exists (java )),
@@ -114,7 +114,7 @@ def test_polyglot_app():
114114
115115 java_home , graalpy , java = get_gp ()
116116 env = get_env (java_home )
117-
117+
118118 with tempfile .TemporaryDirectory () as tmpdir :
119119
120120 target_dir = os .path .join (tmpdir , "polyglot_app_test" )
@@ -166,7 +166,8 @@ def test_native_executable_one_file():
166166
167167 source_file = os .path .join (tmpdir , "hello.py" )
168168 with open (source_file , 'w' ) as f :
169- f .write ("print('hello world')" )
169+ f .write ("import sys\n " )
170+ f .write ("print('hello world, argv[1:]:', sys.argv[1:])" )
170171
171172 target_file = os .path .join (tmpdir , "hello" )
172173 cmd = [graalpy , "-m" , "standalone" , "--verbose" , "native" , "-m" , source_file , "-o" , target_file ]
@@ -177,12 +178,12 @@ def test_native_executable_one_file():
177178 print (p .stderr .decode (errors = 'backslashreplace' ))
178179 assert "Bundling Python resources into" in out
179180
180- cmd = [target_file ]
181- p = subprocess .run (cmd , env = env , stdout = subprocess .PIPE , stderr = subprocess .PIPE )
181+ cmd = [target_file , "arg1" , "arg2" ]
182+ p = subprocess .run (" " . join ( cmd ) , env = env , stdout = subprocess .PIPE , stderr = subprocess .PIPE , shell = True )
182183 out = p .stdout .decode (errors = 'backslashreplace' )
183184 print (out )
184185 print (p .stderr .decode (errors = 'backslashreplace' ))
185- assert "hello world" in out
186+ assert "hello world, argv[1:]: " + str ( cmd [ 1 :]) in out
186187
187188@unittest .skipUnless (is_enabled , "ENABLE_STANDALONE_UNITTESTS is not true" )
188189def test_native_executable_one_file_venv ():
0 commit comments