[PATCH] D63859: [Support] Add getFileOrSTDIN which calls a callback if stdin is a tty

Alex Brachet via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jun 26 23:23:20 PDT 2019


abrachet marked an inline comment as done.
abrachet added inline comments.


================
Comment at: llvm/unittests/Support/MemoryBufferTest.cpp:304
+        << "Reading from tty should have exited with exit code 1";
+    ASSERT_EQ(TestForChange, 1) << "Callback not called";
+    TestForChange = 0;
----------------
This test is actually failing, it doesn't change the int, but it does print "message" according to EXPECT_EXIT, I also tried other things like calling exit from inside the lamda with different exit status, and and it picks up that it wasn't exit code 1. So the ChangeFunc's operator() is being called, but TestForChange is still equal to 0 gtest says. I hope its just  a silly mistake with the lambda, but surely the compiler would have complained. I'm really at a loss for this one. Any ideas?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D63859





More information about the llvm-commits mailing list