[all-commits] [llvm/llvm-project] 4c8a43: [orc-rt] Add gmock matchers for Error and Expected...

Lang Hames via All-commits all-commits at lists.llvm.org
Tue Sep 22 22:34:25 PDT 2026


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 4c8a437d04872b00a4e32e4423ff076e7049cb37
      https://github.com/llvm/llvm-project/commit/4c8a437d04872b00a4e32e4423ff076e7049cb37
  Author: Lang Hames <lhames at gmail.com>
  Date:   2026-09-23 (Wed, 23 Sep 2026)

  Changed paths:
    M orc-rt/test/unit/CMakeLists.txt
    A orc-rt/test/unit/ErrorMatchers.h
    A orc-rt/test/unit/ErrorMatchersTest.cpp

  Log Message:
  -----------
  [orc-rt] Add gmock matchers for Error and Expected<T> (#225596)

Ports llvm/Testing/Support/Error.h to orc_rt: EXPECT_THAT_ERROR and
ASSERT_THAT_ERROR, EXPECT_THAT_EXPECTED and ASSERT_THAT_EXPECTED, and
the Succeeded, Failed, Failed<InfoT>, FailedWithMessage and HasValue
matchers.

Two departures from the original. An orc_rt Error carries at most one
ErrorInfoBase -- there is no joinErrors -- so the holder keeps a single
error, FailedWithMessage takes one matcher rather than a variadic pack,
and FailedWithMessageArray is dropped. ErrorInfoBase has
dynamicRTTIName, so a type mismatch names the type that did turn up
rather than reporting only that the expected one was absent.

Header-only, under test/unit with the other test helpers rather than in
a shipped testing library. ErrorMatchersTest exercises each matcher
against a matching and a non-matching value, the latter through gtest's
failure interception.



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list