コード例 #1
0
ファイル: test_all.py プロジェクト: Lukas-Dresel/miasm
    # Handle Z3 dependency
    try:
        import z3
    except ImportError:
        print "%(red)s[Z3]%(end)s " % cosmetics.colors + \
            "Z3 and its python binding are necessary for TranslatorZ3."
        if TAGS["z3"] not in exclude_tags:
            exclude_tags.append(TAGS["z3"])
    test_ko = []
    test_ok = []

    # Set callbacks
    if multiproc is False:
        testset.set_cpu_numbers(1)
    testset.set_callback(task_done=lambda test, error:multithread.task_done(test, error, test_ok, test_ko),
                         task_new=multithread.task_new)


    # Filter testset according to tags
    testset.filter_tags(exclude_tags=exclude_tags)

    # Run tests
    testset.run()

    # Finalize
    testset.end(clean=not args.do_not_clean)
    print
    print (cosmetics.colors["green"] +
           "Result: %d/%d pass" % (len(test_ok), len(test_ok) + len(test_ko)) +
           cosmetics.colors["end"])
    for test, error in test_ko:
コード例 #2
0
        # Remove llvm tests
        if TAGS["llvm"] not in exclude_tags:
            exclude_tags.append(TAGS["llvm"])

    # Handle Z3 dependency
    try:
        import z3
    except ImportError:
        print "%(red)s[Z3]%(end)s " % cosmetics.colors + \
            "Z3 and its python binding are necessary for TranslatorZ3."
        if TAGS["z3"] not in exclude_tags:
            exclude_tags.append(TAGS["z3"])

    # Set callbacks
    if multiproc is False:
        testset.set_callback(task_done=monothread.task_done,
                             task_new=monothread.task_new)
        testset.set_cpu_numbers(1)
    else:
        screendisplay.init(testset.cpu_c)
        testset.set_callback(task_done=screendisplay.task_done,
                             task_new=screendisplay.task_new)

    # Filter testset according to tags
    testset.filter_tags(exclude_tags=exclude_tags)

    # Run tests
    testset.run()

    # Finalize
    testset.end(clean=not args.do_not_clean)
コード例 #3
0
ファイル: test_all.py プロジェクト: kwang1971/miasm
    # Handle pycparser dependency
    try:
        import pycparser
    except ImportError:
        print "%(red)s[PYCPARSER]%(end)s " % cosmetics.colors + \
            "pycparser are necessary for Objc."
        if TAGS["cparser"] not in exclude_tags:
            exclude_tags.append(TAGS["cparser"])

    test_ko = []
    test_ok = []

    # Set callbacks
    if multiproc is False:
        testset.set_cpu_numbers(1)
    testset.set_callback(task_done=lambda test, error:multithread.task_done(test, error, test_ok, test_ko),
                         task_new=multithread.task_new)


    # Filter testset according to tags
    testset.filter_tags(exclude_tags=exclude_tags, include_tags=include_tags)

    # Run tests
    testset.run()

    # Finalize
    testset.end(clean=not args.do_not_clean)
    print
    print (cosmetics.colors["green"] +
           "Result: %d/%d pass" % (len(test_ok), len(test_ok) + len(test_ko)) +
           cosmetics.colors["end"])
    for test, error in test_ko:
コード例 #4
0
ファイル: test_all.py プロジェクト: blaquee/miasm
        # Remove llvm tests
        if TAGS["llvm"] not in exclude_tags:
            exclude_tags.append(TAGS["llvm"])

    # Handle Z3 dependency
    try:
        import z3
    except ImportError:
        print "%(red)s[Z3]%(end)s " % cosmetics.colors + \
            "Z3 and its python binding are necessary for TranslatorZ3."
        if TAGS["z3"] not in exclude_tags:
            exclude_tags.append(TAGS["z3"])

    # Set callbacks
    if multiproc is False:
        testset.set_callback(task_done=monothread.task_done,
                             task_new=monothread.task_new)
        testset.set_cpu_numbers(1)
    else:
        screendisplay.init(testset.cpu_c)
        testset.set_callback(task_done=screendisplay.task_done,
                             task_new=screendisplay.task_new)

    # Filter testset according to tags
    testset.filter_tags(exclude_tags=exclude_tags)

    # Run tests
    testset.run()

    # Finalize
    testset.end(clean=not args.do_not_clean)