mirror of
https://github.com/encounter/dawn-cmake.git
synced 2025-12-20 18:29:23 +00:00
Check for deprecation warnings in ValidationTests
And adds EXPECT_DEPRECATION_WARNING where necessary in validation tests. Bug: dawn:520, dawn:527 Change-Id: Ic8e103e4b7b5784a2009519e0a18ed16088632b1 Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/31300 Reviewed-by: Corentin Wallez <cwallez@chromium.org> Commit-Queue: Kai Ninomiya <kainino@chromium.org>
This commit is contained in:
committed by
Commit Bot service account
parent
25eb373eed
commit
5a1d786754
@@ -39,6 +39,15 @@
|
||||
} \
|
||||
} while (0)
|
||||
|
||||
#define EXPECT_DEPRECATION_WARNING(statement) \
|
||||
do { \
|
||||
size_t warningsBefore = dawn_native::GetDeprecationWarningCountForTesting(device.Get()); \
|
||||
statement; \
|
||||
size_t warningsAfter = dawn_native::GetDeprecationWarningCountForTesting(device.Get()); \
|
||||
EXPECT_EQ(mLastWarningCount, warningsBefore); \
|
||||
mLastWarningCount = warningsAfter; \
|
||||
} while (0)
|
||||
|
||||
class ValidationTest : public testing::Test {
|
||||
public:
|
||||
ValidationTest();
|
||||
@@ -76,6 +85,8 @@ class ValidationTest : public testing::Test {
|
||||
dawn_native::Adapter adapter;
|
||||
std::unique_ptr<dawn_native::Instance> instance;
|
||||
|
||||
size_t mLastWarningCount = 0;
|
||||
|
||||
private:
|
||||
static void OnDeviceError(WGPUErrorType type, const char* message, void* userdata);
|
||||
std::string mDeviceErrorMessage;
|
||||
|
||||
Reference in New Issue
Block a user