This is an archive of the discontinued LLVM Phabricator instance.

Use ASSERT_THAT_ERROR instead of logAllUnhandledErrors/exit
ClosedPublic

Authored by gribozavr on Aug 7 2019, 2:06 AM.

Diff Detail

Repository
rL LLVM

Event Timeline

gribozavr created this revision.Aug 7 2019, 2:06 AM
Herald added a project: Restricted Project. · View Herald TranscriptAug 7 2019, 2:06 AM

I tested this out. Seems to work fine, and print the Expected's Error. I am fine with it if @compnerd and @lhames and @jkorous are cool with it.

plotfi added a comment.Aug 7 2019, 1:58 PM
This comment was removed by plotfi.
plotfi added a comment.Aug 7 2019, 1:59 PM
plotfi@grendel:/mnt/nvme0/llvm-project$ build/tools/clang/unittests/DirectoryWatcher/./DirectoryWatcherTests --gtest_filter=DirectoryWatcherTest.AddFilesNote: Google Test filter = DirectoryWatcherTest.AddFiles
[==========] Running 1 test from 1 test case.
[----------] Global test environment set-up.
[----------] 1 test from DirectoryWatcherTest
[ RUN      ] DirectoryWatcherTest.AddFiles
/mnt/nvme0/llvm-project/clang/unittests/DirectoryWatcher/DirectoryWatcherTest.cpp:344: Failure
Value of: llvm::detail::TakeError(DW.takeError())
Expected: succeeded
  Actual: failed  (inotify_init1() error: Illegal seek)
[  FAILED  ] DirectoryWatcherTest.AddFiles (3 ms)
[----------] 1 test from DirectoryWatcherTest (3 ms total)

[----------] Global test environment tear-down
[==========] 1 test from 1 test case ran. (3 ms total)
[  PASSED  ] 0 tests.
[  FAILED  ] 1 test, listed below:
[  FAILED  ] DirectoryWatcherTest.AddFiles

 1 FAILED TEST

Is the output in the failure case. This seems fine to me.

I tested this out. Seems to work fine, and print the Expected's Error. I am fine with it if @compnerd and @lhames and @jkorous are cool with it.

@compnerd @lhames @jkorous ping?

lhames accepted this revision.Aug 8 2019, 10:41 AM

LGTM.

This revision is now accepted and ready to land.Aug 8 2019, 10:41 AM
This revision was automatically updated to reflect the committed changes.
Herald added a project: Restricted Project. · View Herald TranscriptAug 8 2019, 11:14 PM