[PATCH] D98303: [flang] Update output format test to use GTest

Andrzej Warzynski via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Mar 14 09:55:33 PDT 2021


awarzynski added a comment.

In D98303#2617981 <https://reviews.llvm.org/D98303#2617981>, @ashermancinelli wrote:

> In your opinion, would some death tests be sufficient? I can demonstrate some conditions under which many of these operations result in a runtime crash with the correct message, and in my opinion that would demonstrate proper failure reporting.

I think that it's worthwhile to add a dedicated test for the crash handler API either way: https://reviews.llvm.org/D98601. This patch demonstrates that the message from the crash handler is indeed generated and printed to `stdout`.

Related to that, @ashermancinelli , do you know whether any of the methods tested here ever crash? This might be tricky to check. It might be easier to install a crash handler with `Fortran::runtime::Terminator::RegisterCrashHandler` like in the original test file.



================
Comment at: flang/unittests/RuntimeGTest/NumericalFormatTest.cpp:98
+      staticDescriptorMaxRank, extent, CFI_attribute_pointer);
+  whole.Dump();
+  whole.Check();
----------------
IMHO, it would be better to dump to `stderr` so that it is possible to separate the regular output from GTest and other logging like this.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D98303/new/

https://reviews.llvm.org/D98303



More information about the llvm-commits mailing list