Skip to content

Commit

Permalink
Fix iree_helpers_test on Windows with callstacks (debug build).
Browse files Browse the repository at this point in the history
  • Loading branch information
ScottTodd committed Oct 16, 2024
1 parent e700bfa commit 830f46b
Showing 1 changed file with 8 additions and 9 deletions.
17 changes: 8 additions & 9 deletions shortfin/src/shortfin/support/iree_helpers_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -97,10 +97,9 @@ TEST(iree_error, user_message) {
"Something went wrong",
iree_make_status(IREE_STATUS_CANCELLED, "because I said so"));
} catch (iree::error &e) {
EXPECT_THAT(
std::string(e.what()),
testing::MatchesRegex(
"^Something went wrong: .*: CANCELLED; because I said so$"));
EXPECT_THAT(std::string(e.what()),
testing::ContainsRegex(
"^Something went wrong: .*: CANCELLED; because I said so"));
}
}

Expand All @@ -110,7 +109,7 @@ TEST(iree_error, no_user_message) {
iree_make_status(IREE_STATUS_CANCELLED, "because I said so"));
} catch (iree::error &e) {
EXPECT_THAT(std::string(e.what()),
testing::MatchesRegex("^.*: CANCELLED; because I said so$"));
testing::ContainsRegex("^.*: CANCELLED; because I said so"));
}
}

Expand All @@ -129,7 +128,7 @@ TEST(iree_error, throw_if_error) {
FAIL();
} catch (iree::error &e) {
EXPECT_THAT(std::string(e.what()),
testing::MatchesRegex("^.*: CANCELLED; because I said so$"));
testing::ContainsRegex("^.*: CANCELLED; because I said so"));
}
}

Expand All @@ -140,9 +139,9 @@ TEST(iree_error, throw_if_error_addl_message) {
"oops: %d", 1);
FAIL();
} catch (iree::error &e) {
EXPECT_THAT(
std::string(e.what()),
testing::MatchesRegex("^.*: CANCELLED; because I said so; oops: 1$"));
EXPECT_THAT(std::string(e.what()),
testing::ContainsRegex("^.*: CANCELLED; because I said so;"));
EXPECT_THAT(std::string(e.what()), testing::ContainsRegex("oops: 1"));
}
}

Expand Down

0 comments on commit 830f46b

Please sign in to comment.