[PATCH] D95257: [RGT][GlobalISel] Add missing setUp() calls to legalizer unittests

Daniel Sanders via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Mar 30 20:14:20 PDT 2021


dsanders added a comment.

Thanks for fixing this, I just ran into the same problem after basing a new test off of one of these on an older branch and wondering why it passed before I'd written the result string. I did a bit of digging before finding this commit and I think part of the problem here is that gtest will call the virtual function `SetUp()` automatically but not `setUp()`. I think we should also rename setUp() to something that doesn't clash with gtest (createTargetAndModule, initLLVM, etc.)

Also gtest has a way to skip tests in recent versions: https://github.com/google/googletest/blob/master/googletest/test/gtest_skip_test.cc. It might be worth updating it so tests like this can report they were skipped instead of falsely claiming they passed.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D95257



More information about the llvm-commits mailing list