示例#1
0
def main():
    init()

    try:
        PerformAction()
    except Exception, e:
        tb = traceback.format_exc()
        try:
            reset()
        except:
            print "reset() failed with traceback:"
            print traceback.format_exc().replace("\n", "\r\n")

        print "RunTests failed:\r\n"
        print tb.replace("\n", "\r\n")
        esclog.LogError("Failed with traceback:")
        esclog.LogError(tb)
示例#2
0
def MatchingNamesAndMethods():
  classes = []
  for category in [ tests.tests ]:
    classes.extend(category)

  for testClass in classes:
    try:
      testObject = testClass()
    except:
      esclog.LogError("Failed to create test class " + testClass.__name__)
      raise
    members = inspect.getmembers(testObject, predicate=inspect.ismethod)
    for name, method in members:
      full_name = testClass.__name__ + "." + name
      if (name.startswith("test_") and
          re.search(escargs.args.include, full_name)):
        yield full_name, method
      else:
        esclog.LogDebug("Skipping test %s" % full_name)
示例#3
0
        escutil.AssertAssertionAsserted()
        esclog.LogInfo("Passed.")
    except esctypes.KnownBug, e:
        RemoveSideChannel()
        esclog.LogInfo("Fails as expected: " + str(e))
        ok = None
    except esctypes.InsufficientVTLevel, e:
        RemoveSideChannel()
        esclog.LogInfo(
            "Skipped because terminal lacks requisite capability: " + str(e))
        ok = None
    except Exception, e:
        RemoveSideChannel()
        tb = traceback.format_exc()
        ok = False
        esclog.LogError("*** TEST %s FAILED:" % name)
        esclog.LogError(tb)
    esclog.LogInfo("")
    return ok


def MatchingNamesAndMethods():
    classes = []
    for category in [tests.tests]:
        classes.extend(category)

    for testClass in classes:
        try:
            testObject = testClass()
        except:
            esclog.LogError("Failed to create test class " +