Esempio n. 1
0
    # 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"])
Esempio n. 2
0
    # 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"])