/**
   * Set test result.
   *
   * @param result The result.
   */
  public void setResult(CtsTestResult result) {
    if (isKnownFailure()) {
      result.reverse();
    }
    mResult = result;
    CUIOutputStream.println("(" + mResult.getResultString() + ")");
    if (!mResult.isPass()) {
      String failedMessage = result.getFailedMessage();
      String stackTrace = result.getStackTrace();
      if (failedMessage != null) {
        CUIOutputStream.println(failedMessage);
      }
      if (stackTrace != null) {
        CUIOutputStream.println(stackTrace);
      }
    }
    setEndTime(System.currentTimeMillis());

    ResultObserver.getInstance().notifyUpdate();
  }
 /**
  * Add test result.
  *
  * @param result The result.
  */
 public void addResult(CtsTestResult result) {
   if (isKnownFailure()) {
     result.reverse();
   }
   mResult = result;
 }