• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Python mx_unittest.unittest函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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


示例16: runTruffleTestCases

def runTruffleTestCases(args=None):
    """runs the Sulong test suite"""
    ensureLLVMBinariesExist()
    ensureDragonEggExists()
    vmArgs, _ = truffle_extract_VM_args(args)
    return unittest(
        getCommonUnitTestOptions()
        + ["-Dsulong.ExecutionCount=1000"]
        + vmArgs
        + ["com.oracle.truffle.llvm.test.SulongTestSuite"]
    )
开发者ID:graalvm,项目名称:sulong,代码行数:11,代码来源:mx_sulong.py


示例17: _execute_debugger_test

def _execute_debugger_test(testFilter, logFile, testEvaluation=False, unitTestOptions=None, jvmOptions=None):
    """
    Executes given unit tests with enabled debugalot instrument.
    The 'testFilter' argument is a filter unit test pattern.
    The 'logFile' argument is a file path to store the instrument output into.
    The 'testEvaluation' argument enables evaluation testing, default is False.
    The 'unitTestOptions' argument is a list of unit test options.
    The 'jvmOptions' argument is a list of VM options.
    """
    debugalot_options = ["-Dpolyglot.debugalot=true"]
    if testEvaluation:
        debugalot_options.append("-Dpolyglot.debugalot.Eval=true")
    debugalot_options.append("-Dpolyglot.debugalot.LogFile=" + logFile)
    args = []
    if unitTestOptions is not None:
        args = args + unitTestOptions
    args = args + ["--"]
    if jvmOptions is not None:
        args = args + jvmOptions
    args = args + debugalot_options
    args = args + testFilter
    unittest(args)
开发者ID:charig,项目名称:truffle,代码行数:22,代码来源:mx_truffle.py


示例18: _sulong_gate_runner

def _sulong_gate_runner(args, tasks):
    with TemporaryEnv():
        with Task('CheckCopyright', tasks, tags=['style']) as t:
            if t:
                if mx.checkcopyrights(['--primary']) != 0:
                    t.abort('Copyright errors found. Please run "mx checkcopyrights --primary -- --fix" to fix them.')
        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(['com.oracle.truffle.llvm.test.interop'])
        with Task("TestDebug", tasks, tags=['debug', 'sulongBasic']) as t:
            if t: mx_unittest.unittest(['LLVMDebugTest'])
        with Task("TestIRDebug", tasks, tags=['irdebug', 'sulongBasic']) as t:
            if t: mx_unittest.unittest(['LLVMIRDebugTest'])
        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:jakre,项目名称:sulong,代码行数:42,代码来源:mx_sulong.py


示例19: runCompileTestCases

def runCompileTestCases(args=None):
    """runs the compile (no execution) test cases of the GCC suite"""
    ensureGCCSuiteExists()
    vmArgs, _ = truffle_extract_VM_args(args)
    return unittest(getCommonUnitTestOptions() + vmArgs + ['com.oracle.truffle.llvm.test.TestGCCCompileSuite'])
开发者ID:lxp,项目名称:sulong,代码行数:5,代码来源:mx_sulong.py


示例20: runPipeTestCases

def runPipeTestCases(args=None):
    """runs the stdout pipe testcases """
    vmArgs, _ = truffle_extract_VM_args(args)
    return unittest(vmArgs + ['com.oracle.truffle.llvm.test.alpha.CaptureOutputTest'])
开发者ID:lxp,项目名称:sulong,代码行数:4,代码来源:mx_sulong.py



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Python socketio.emit函数代码示例发布时间:2022-05-27
下一篇:
Python DateTime.now函数代码示例发布时间:2022-05-27
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap