@@ -582,6 +582,17 @@ def run_python_unittests(python_binary, args=None, paths=None, aot_compatible=Tr
582
582
return mx .run ([python_binary ] + args , nonZeroIsFatal = True , env = env )
583
583
584
584
585
+ def run_hpy_unittests (python_binary , args = []):
586
+ with tempfile .TemporaryDirectory (prefix = 'hpy-test-site-' ) as d :
587
+ env = os .environ .copy ()
588
+ prefix = str (d )
589
+ env .update (PYTHONUSERBASE = prefix )
590
+ mx .log ("Ensure 'setuptools' is installed" )
591
+ mx .run ([python_binary ] + args + ["-m" , "ginstall" , "install" , "--prefix=" + prefix , "setuptools" ], nonZeroIsFatal = True , env = env )
592
+
593
+ return run_python_unittests (python_binary , args = args , paths = [_hpy_test_root ()], env = env )
594
+
595
+
585
596
def run_tagged_unittests (python_binary , env = None ):
586
597
if env is None :
587
598
env = os .environ
@@ -635,11 +646,11 @@ def graalpython_gate_runner(args, tasks):
635
646
636
647
with Task ('GraalPython HPy tests' , tasks , tags = [GraalPythonTags .unittest_hpy ]) as task :
637
648
if task :
638
- run_python_unittests (python_gvm (), paths = [ _hpy_test_root ()] )
649
+ run_hpy_unittests (python_gvm ())
639
650
640
651
with Task ('GraalPython HPy sandboxed tests' , tasks , tags = [GraalPythonTags .unittest_hpy_sandboxed ]) as task :
641
652
if task :
642
- run_python_unittests (python_gvm (["sandboxed" ]), args = ["--llvm.managed" ], paths = [ _hpy_test_root () ])
653
+ run_hpy_unittests (python_gvm (["sandboxed" ]), args = ["--llvm.managed" ])
643
654
644
655
with Task ('GraalPython Python tests' , tasks , tags = [GraalPythonTags .tagged ]) as task :
645
656
if task :
0 commit comments