def runLLVMUnittests(unittest_runner): """runs the interop unit tests with a different unittest runner (e.g. AOT-based)""" libpath = mx_subst.path_substitutions.substitute( '-Dpolyglot.llvm.libraryPath=<path:SULONG_TEST_NATIVE>') libs = mx_subst.path_substitutions.substitute( '-Dpolyglot.llvm.libraries=<lib:sulongtest>') test_harness_dist = mx.distribution('SULONG_TEST') java_run_props = [ x for x in mx.get_runtime_jvm_args(test_harness_dist) if x.startswith('-D') ] # necessary because mx native-unittest ignores config participants (GR-34875) java_run_props += [ x for x in _unittest_config_participant(([], None, None))[0] if x.startswith('-D') ] test_suite = 'SULONG_EMBEDDED_TEST_SUITES' mx_sulong_suite_constituents.compileTestSuite(test_suite, extra_build_args=[]) run_args = [libpath, libs] + java_run_props build_args = ['--language:llvm'] + java_run_props unittest_runner(['com.oracle.truffle.llvm.tests.interop', '--run-args'] + run_args + ['--build-args', '--initialize-at-build-time'] + build_args)
def testLLVMImage(image, imageArgs=None, testFilter=None, libPath=True, test=None, unittestArgs=None): """runs the SulongSuite tests on an AOT compiled lli image""" args = ['-Dsulongtest.testAOTImage=' + image] aotArgs = [] if libPath: aotArgs += [mx_subst.path_substitutions.substitute('<sulong_home>')] if imageArgs is not None: aotArgs += imageArgs if aotArgs: args += ['-Dsulongtest.testAOTArgs=' + ' '.join(aotArgs)] if testFilter is not None: args += ['-Dsulongtest.testFilter=' + testFilter] testName = 'SulongSuite' if test is not None: testName += '#test[' + test + ']' if unittestArgs is None: unittestArgs = [] test_suite = 'SULONG_STANDALONE_TEST_SUITES' mx_sulong_suite_constituents.compileTestSuite(test_suite, extra_build_args=[]) mx_sulong_suite_constituents.run(args + unittestArgs, testName)
def execute(self, tasks): with Task('Build_' + self.test_suite, tasks, tags=self.tags, description='Build ' + self.test_suite) as t: if t: mx_sulong_suite_constituents.compileTestSuite( self.test_suite, self.extra_build_args or [])