当前位置: 首页>>代码示例>>Python>>正文


Python mx_unittest.unittest函数代码示例

本文整理汇总了Python中mx_unittest.unittest函数的典型用法代码示例。如果您正苦于以下问题:Python unittest函数的具体用法?Python unittest怎么用?Python unittest使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了unittest函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: runGCCTestCases

def runGCCTestCases(args=None):
    """runs the GCC test suite"""
    ensureLLVMBinariesExist()
    ensureGCCSuiteExists()
    ensureDragonEggExists()
    vmArgs, _ = truffle_extract_VM_args(args)
    unittest(getCommonUnitTestOptions() + vmArgs + ["com.oracle.truffle.llvm.test.TestGCCSuite"])
开发者ID:eregon,项目名称:sulong,代码行数:7,代码来源:mx_sulong.py

示例2: _sulong_gate_runner

def _sulong_gate_runner(args, tasks):
    with Task('ClangFormat', tasks, tags=['style', 'clangformat']) as t:
        if t: clangformatcheck()
    with Task('TestBenchmarks', tasks, tags=['benchmarks', 'sulongMisc']) as t:
        if t: mx_testsuites.runSuite('shootout')
    with Task('TestTypes', tasks, tags=['type', 'sulongMisc']) as t:
        if t: mx_testsuites.runSuite('type')
    with Task('TestPipe', tasks, tags=['pipe', 'sulongMisc']) as t:
        if t: mx_testsuites.runSuite('pipe')
    with Task('TestLLVM', tasks, tags=['llvm']) as t:
        if t: mx_testsuites.runSuite('llvm')
    with Task('TestNWCC', tasks, tags=['nwcc']) as t:
        if t: mx_testsuites.runSuite('nwcc')
    with Task('TestGCCParserTorture', tasks, tags=['parser']) as t:
        if t: mx_testsuites.runSuite('parserTorture')
    with Task('TestGCC_C', tasks, tags=['gcc_c']) as t:
        if t: mx_testsuites.runSuite('gcc_c')
    with Task('TestGCC_CPP', tasks, tags=['gcc_cpp']) as t:
        if t: mx_testsuites.runSuite('gcc_cpp')
    with Task('TestGCC_Fortran', tasks, tags=['gcc_fortran']) as t:
        if t: mx_testsuites.runSuite('gcc_fortran')
    with Task("TestSulong", tasks, tags=['sulong', 'sulongBasic']) as t:
        if t: mx_unittest.unittest(['SulongSuite'])
    with Task("TestInterop", tasks, tags=['interop', 'sulongBasic']) as t:
        if t: mx_unittest.unittest(['LLVMInteropTest'])
    with Task('TestAssembly', tasks, tags=['assembly', 'sulongMisc']) as t:
        if t: mx_testsuites.runSuite('assembly')
    with Task('TestArgs', tasks, tags=['args', 'sulongMisc']) as t:
        if t: mx_testsuites.runSuite('args')
    with Task('TestCallback', tasks, tags=['callback', 'sulongMisc']) as t:
        if t: mx_testsuites.runSuite('callback')
    with Task('TestVarargs', tasks, tags=['vaargs', 'sulongMisc']) as t:
        if t: mx_testsuites.runSuite('vaargs')
开发者ID:pekd,项目名称:sulong,代码行数:33,代码来源:mx_sulong.py

示例3: _tck

def _tck(args):
    """runs TCK tests"""

    parser = ArgumentParser(prog="mx tck", description="run the TCK tests", formatter_class=RawDescriptionHelpFormatter, epilog=_debuggertestHelpSuffix)
    parser.add_argument("--tck-configuration", help="TCK configuration", choices=["compile", "debugger", "default"], default="default")
    parsed_args, args = parser.parse_known_args(args)
    tckConfiguration = parsed_args.tck_configuration
    index = len(args)
    for arg in reversed(args):
        if arg.startswith("-"):
            break
        index = index - 1
    args_no_tests = args[0:index]
    tests = args[index:len(args)]
    if len(tests) == 0:
        tests = ["com.oracle.truffle.tck.tests"]
    index = len(args_no_tests)
    for arg in reversed(args_no_tests):
        if arg.startswith("--"):
            break
        index = index - 1
    unitTestOptions = args_no_tests[0:max(index-1, 0)]
    jvmOptions = args_no_tests[index:len(args_no_tests)]
    if tckConfiguration == "default":
        unittest(unitTestOptions + ["--"] + jvmOptions + tests)
    elif tckConfiguration == "debugger":
        with mx.SafeFileCreation(os.path.join(tempfile.gettempdir(), "debugalot")) as sfc:
            _execute_debugger_test(tests, sfc.tmpPath, False, unitTestOptions, jvmOptions)
    elif tckConfiguration == "compile":
        if not _is_graalvm(mx.get_jdk()):
            mx.abort("The 'compile' TCK configuration requires graalvm execution, run with --java-home=<path_to_graalvm>.")
        unittest(unitTestOptions + ["--"] + jvmOptions + ["-Dgraal.TruffleCompileImmediately=true", "-Dgraal.TruffleCompilationExceptionsAreThrown=true"] + tests)
开发者ID:charig,项目名称:truffle,代码行数:32,代码来源:mx_truffle.py

示例4: _truffle_gate_runner

def _truffle_gate_runner(args, tasks):
    with Task('Truffle Javadoc', tasks) as t:
        if t: mx.javadoc(['--unified'])
    with Task('Truffle UnitTests', tasks) as t:
        if t: unittest(['--suite', 'truffle', '--enable-timing', '--verbose', '--fail-fast'])
    with Task('Truffle Signature Tests', tasks) as t:
        if t: sigtest(['--check', 'binary'])
开发者ID:lukasstadler,项目名称:truffle,代码行数:7,代码来源:mx_truffle.py

示例5: run

 def run(self, suites, tasks, extraVMarguments=None):
     for suite in suites:
         with Task(self.name + ': hosted-product ' + suite, tasks, tags=self.tags) as t:
             if mx_gate.Task.verbose:
                 extra_args = ['--verbose', '--enable-timing']
             else:
                 extra_args = []
             if t: unittest(['--suite', suite, '--fail-fast'] + extra_args + self.args + _noneAsEmptyList(extraVMarguments))
开发者ID:Prototype1,项目名称:graal-core,代码行数:8,代码来源:mx_graal_9.py

示例6: runBenchmarkTestCases

def runBenchmarkTestCases(args=None):
    """runs the test cases from the language benchmark game"""
    ensureLLVMBinariesExist()
    ensureGCCSuiteExists()
    ensureDragonEggExists()
    ensureBenchmarkSuiteExists()
    vmArgs, _ = truffle_extract_VM_args(args)
    unittest(getCommonUnitTestOptions() + vmArgs + ["com.oracle.truffle.llvm.test.BenchmarkGameSuite"])
开发者ID:eregon,项目名称:sulong,代码行数:8,代码来源:mx_sulong.py

示例7: _truffle_gate_runner

def _truffle_gate_runner(args, tasks):
    jdk = mx.get_jdk(tag=mx.DEFAULT_JDK_TAG)
    if jdk.javaCompliance < '9':
        with Task('Truffle Javadoc', tasks) as t:
            if t: mx.javadoc(['--unified'])
    with Task('Truffle UnitTests', tasks) as t:
        if t: unittest(['--suite', 'truffle', '--enable-timing', '--verbose', '--fail-fast'])
    with Task('Truffle Signature Tests', tasks) as t:
        if t: sigtest(['--check', 'binary'])
开发者ID:calder,项目名称:truffle,代码行数:9,代码来源:mx_truffle.py

示例8: _truffle_gate_runner

def _truffle_gate_runner(args, tasks):
    with Task("Truffle Javadoc", tasks) as t:
        if t:
            mx.javadoc(["--unified"])
    with Task("Truffle UnitTests", tasks) as t:
        if t:
            unittest(["--suite", "truffle", "--enable-timing", "--verbose", "--fail-fast"])
    with Task("Truffle Signature Tests", tasks) as t:
        if t:
            sigtest(["--check", "binary"])
开发者ID:eregon,项目名称:truffle,代码行数:10,代码来源:mx_truffle.py

示例9: run

def run(vmArgs, unittest, extraOption=None, extraLibs=None):
    if extraOption is None:
        extraOption = []
    if mx.get_opts().verbose:
        command = mx_sulong.getCommonOptions(True, extraLibs) + extraOption + vmArgs + ['--very-verbose', unittest]
        print ('Running mx unittest ' + ' '.join(command))
        return mx_unittest.unittest(command)
    else:
        command = mx_sulong.getCommonOptions(True, extraLibs) + extraOption + vmArgs + [unittest]
        return mx_unittest.unittest(command)
开发者ID:jakre,项目名称:sulong,代码行数:10,代码来源:mx_testsuites.py

示例10: _truffle_gate_runner

def _truffle_gate_runner(args, tasks):
    jdk = mx.get_jdk(tag=mx.DEFAULT_JDK_TAG)
    with Task('Jackpot check', tasks) as t:
        if t: jackpot(['--fail-on-warnings'], suite=None, nonZeroIsFatal=True)
    if jdk.javaCompliance < '9':
        with Task('Truffle Javadoc', tasks) as t:
            if t: javadoc([])
    with Task('Truffle UnitTests', tasks) as t:
        if t: unittest(['--suite', 'truffle', '--enable-timing', '--verbose', '--fail-fast'])
    with Task('Truffle Signature Tests', tasks) as t:
        if t: sigtest(['--check', 'binary'])
    with Task('File name length check', tasks) as t:
        if t: check_filename_length([])
开发者ID:charig,项目名称:truffle,代码行数:13,代码来源:mx_truffle.py

示例11: runNWCCTestCases

def runNWCCTestCases(args=None):
    """runs the NWCC (Nils Weller's C Compiler) test cases"""
    ensureLLVMBinariesExist()
    ensureNWCCSuiteExists()
    vmArgs, _ = truffle_extract_VM_args(args)
    return unittest(
        getCommonUnitTestOptions() + vmArgs + [getRemoteClasspathOption(), "com.oracle.truffle.llvm.test.NWCCTestSuite"]
    )
开发者ID:graalvm,项目名称:sulong,代码行数:8,代码来源:mx_sulong.py

示例12: runAsmTestCases

def runAsmTestCases(args=None):
    """runs the asm test cases"""
    vmArgs, _ = truffle_extract_VM_args(args)
    return unittest(
        getCommonUnitTestOptions()
        + vmArgs
        + [getRemoteClasspathOption(), "com.oracle.truffle.llvm.test.inlineassembly.LLVMInlineAssemblyTest"]
    )
开发者ID:graalvm,项目名称:sulong,代码行数:8,代码来源:mx_sulong.py

示例13: runLLVMTestCases

def runLLVMTestCases(args=None):
    """runs the LLVM test suite"""
    ensureLLVMBinariesExist()
    ensureLLVMSuiteExists()
    vmArgs, _ = truffle_extract_VM_args(args)
    return unittest(
        getCommonUnitTestOptions() + vmArgs + [getRemoteClasspathOption(), "com.oracle.truffle.llvm.test.LLVMTestSuite"]
    )
开发者ID:graalvm,项目名称:sulong,代码行数:8,代码来源:mx_sulong.py

示例14: testLLVMImage

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('-Dllvm.home=<path:SULONG_LIBS>')]
    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 = []
    mx_unittest.unittest(args + [testName] + unittestArgs)
开发者ID:jakre,项目名称:sulong,代码行数:18,代码来源:mx_sulong.py

示例15: _jvmci_gate_runner

def _jvmci_gate_runner(args, tasks):
    # Build release server VM now so we can run the unit tests
    with Task('BuildHotSpotJVMCIHosted: release', tasks) as t:
        if t: _runmultimake(['--jdk-jvm-variants', 'server', '--jdk-debug-levels', 'release'])

    # Run unit tests in hosted mode
    with VM(jvmVariant='server', debugLevel='release', jvmciMode='hosted'):
        with Task('JVMCI UnitTests: hosted-release', tasks) as t:
            if t: unittest(['--suite', 'jvmci', '--enable-timing', '--verbose', '--fail-fast'])

    # Build the other VM flavors
    with Task('BuildHotSpotJVMCIOthers: fastdebug', tasks) as t:
        if t: _runmultimake(['--jdk-jvm-variants', 'server', '--jdk-debug-levels', 'fastdebug'])

    with Task('CleanAndBuildIdealGraphVisualizer', tasks, disableJacoco=True) as t:
        if t and platform.processor() != 'sparc':
            buildxml = mx._cygpathU2W(join(_suite.dir, 'src', 'share', 'tools', 'IdealGraphVisualizer', 'build.xml'))
            mx.run(['ant', '-f', buildxml, '-q', 'clean', 'build'], env=_igvBuildEnv())
开发者ID:mearvk,项目名称:JVM,代码行数:18,代码来源:mx_jvmci.py


注:本文中的mx_unittest.unittest函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。