Exemple #1
0
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_TEST_SUITES'
    mx_testsuites.compileTestSuite(test_suite, extra_build_args=[])
    mx_testsuites.run(args + unittestArgs, testName)
Exemple #2
0
def _sulong_gate_testsuite(title, test_suite, tasks, args, tags=None, testClasses=None, vmArgs=None):
    if tags is None:
        tags = [test_suite]
    build_tags = ['build_' + t for t in tags]
    run_tags = ['run_' + t for t in tags]
    with Task('Build' + title, tasks, tags=tags + build_tags) as t:
        if t: mx_testsuites.compileTestSuite(test_suite, args.extra_build_args)
    with Task('Test' + title, tasks, tags=tags + run_tags) as t:
        if t: mx_testsuites.runTestSuite(test_suite, args, testClasses, (vmArgs or []) + args.extra_llvm_arguments)
Exemple #3
0
def _sulong_gate_unittest(title, test_suite, tasks, args, tags=None, testClasses=None, unittestArgs=None):
    if tags is None:
        tags = [test_suite]
    if testClasses is None:
        testClasses = [test_suite]
    build_tags = ['build_' + t for t in tags]
    run_tags = ['run_' + t for t in tags]
    if not unittestArgs:
        unittestArgs = []
    unittestArgs += args.extra_llvm_arguments
    with Task('Build' + title, tasks, tags=tags + build_tags) as t:
        if t: mx_testsuites.compileTestSuite(test_suite, args.extra_build_args)
    with Task('Test' + title, tasks, tags=tags + run_tags) as t:
        if t: mx_testsuites.run(unittestArgs, testClasses)
Exemple #4
0
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')]

    test_suite = 'SULONG_TEST_SUITES'
    mx_testsuites.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)
Exemple #5
0
def runLLVMUnittests(unittest_runner):
    """runs the interop unit tests with a different unittest runner (e.g. AOT-based)"""
    langhome = mx_subst.path_substitutions.substitute(
        '-Dllvm.home=<path:SULONG_LIBS>')
    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_suite = 'SULONG_TEST_SUITES'
    unittestArgs = [
        mx_subst.path_substitutions.substitute(
            "-Dsulongtest.testSuitePath=<path:SULONG_TEST_SUITES>"),
    ]
    mx_testsuites.compileTestSuite(test_suite, extra_build_args=[])
    unittest_runner(unittest_args=['com.oracle.truffle.llvm.test.interop'],
                    run_args=[langhome, libpath, libs] + unittestArgs,
                    build_args=unittestArgs +
                    (unittest_runner.keywords['build_args']
                     if 'build_args' in unittest_runner.keywords else []))
Exemple #6
0
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')
    ]

    test_suite = 'SULONG_TEST_SUITES'
    mx_testsuites.compileTestSuite(test_suite, extra_build_args=[])

    run_args = [libpath, libs] + java_run_props
    build_args = unittest_runner.keywords.get('build_args',
                                              []) + java_run_props
    unittest_runner(unittest_args=['com.oracle.truffle.llvm.test.interop'],
                    run_args=run_args,
                    build_args=build_args)