Beispiel #1
0
    if len(args) == 0:
        files = runtestHelpers.getUnitTestFiles("tests")
    else:
        files = args

    if os.environ.has_key('OSSIEUNITTESTSLOGCONFIG'):
        ans = raw_input("OSSIEUNITTESTSLOGCONFIG already exists as %s. Do you want to continue [Y]/N? " % os.environ[OSSIEUNITTESTSLOGCONFIG]).upper()
        if ans == "N":
            sys.exit()
    else:
        os.environ['OSSIEUNITTESTSLOGCONFIG'] = os.path.abspath(options.logconfig)

    print ""
    print "Creating the Test Domain"
    print ""
    scatest.createTestDomain()

    print ""
    print "R U N N I N G  T E S T S"
    print "SDRROOT: ", scatest.getSdrPath()
    print ""

    suite = TestCollector(files, testMethodPrefix=options.prefix, prompt=options.prompt)

    if options.xmlfile == None:
        runner = unittest.TextTestRunner(verbosity=options.verbosity)
    else:
        stream = open(options.xmlfile, "w")
        runner = xmlrunner.XMLTestRunner(stream)
    if options.debug:
        import pdb
        files = args

    if os.environ.has_key('OSSIEUNITTESTSLOGCONFIG'):
        ans = raw_input("OSSIEUNITTESTSLOGCONFIG already exists as %s. Do you want to continue [Y]/N? " % os.environ[OSSIEUNITTESTSLOGCONFIG]).upper()
        if ans == "N":
            sys.exit()
    else:
        os.environ['OSSIEUNITTESTSLOGCONFIG'] = os.path.abspath(options.logconfig)

    from datetime import datetime
    test_start_time = datetime.now()

    print ""
    print "Creating the Test Domain"
    print ""
    scatest.createTestDomain()

    print ""
    print "R U N N I N G  T E S T S"
    print "SDRROOT: ", scatest.getSdrPath(), " Start:", test_start_time.strftime("%m/%d/%Y %H:%M:%S")
    print ""

    suite = TestCollector(files, testMethodPrefix=options.prefix, prompt=options.prompt)

    if options.xmlfile == None:
        runner = unittest.TextTestRunner(verbosity=options.verbosity)
    else:
        stream = open(options.xmlfile, "w")
        runner = xmlrunner.XMLTestRunner(stream)
    if options.debug:
        import pdb