[PATCH] D45567: [lit] Fix a bug where UNRESOLVED tests were not handled in the XUnit XML printer.

Dan Liew via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Apr 12 12:46:59 PDT 2018


delcypher added inline comments.


================
Comment at: utils/lit/lit/Test.py:377
+        xml += " time='{:.2f}'".format(
+            self.result.elapsed if self.result.elapsed is not None else 0.0)
         if self.result.code.isFailure:
----------------
george.karpenkov wrote:
> BTW `x if x else y` in python is equivalent to `x or y`. This is optional, since the semantics would be slightly different, but the output would be the same
Interesting I didn't know that python's `or` operator returned the type of the selected operand rather than a boolean. That is a feature I intended to **never** use. I want to explicitly check for `None` here because that's the case I want to handle. `self.result.elapsed or 0.0` is very obtuse.


Repository:
  rL LLVM

https://reviews.llvm.org/D45567





More information about the llvm-commits mailing list