Skip Buffer OOM tests when using ASAN

ASAN throws when hitting OOM conditions which these tests intentionally
try to create.

Bug: dawn:450
Change-Id: I635480ae329cd5ace55287d77e2b79e663174f49
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/23246
Commit-Queue: Austin Eng <enga@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
This commit is contained in:
Austin Eng 2020-06-19 17:35:33 +00:00 committed by Commit Bot service account
parent 90abd47a28
commit 0e9e5ee8aa
3 changed files with 14 additions and 0 deletions

View File

@ -691,6 +691,14 @@ bool DawnTestBase::IsSpvcParserBeingUsed() const {
return gTestEnv->IsSpvcParserBeingUsed();
}
bool DawnTestBase::IsAsan() const {
#if defined(ADDRESS_SANITIZER)
return true;
#else
return false;
#endif
}
bool DawnTestBase::HasVendorIdFilter() const {
return gTestEnv->HasVendorIdFilter();
}

View File

@ -250,6 +250,8 @@ class DawnTestBase {
bool IsSpvcBeingUsed() const;
bool IsSpvcParserBeingUsed() const;
bool IsAsan() const;
void StartExpectDeviceError();
bool EndExpectDeviceError();

View File

@ -526,6 +526,7 @@ TEST_P(BufferTests, ZeroSizedBuffer) {
TEST_P(BufferTests, CreateBufferOOM) {
// TODO(http://crbug.com/dawn/27): Missing support.
DAWN_SKIP_TEST_IF(IsOpenGL());
DAWN_SKIP_TEST_IF(IsAsan());
wgpu::BufferDescriptor descriptor;
descriptor.usage = wgpu::BufferUsage::CopyDst;
@ -545,6 +546,7 @@ TEST_P(BufferTests, CreateBufferOOM) {
TEST_P(BufferTests, CreateBufferMappedOOM) {
// TODO(http://crbug.com/dawn/27): Missing support.
DAWN_SKIP_TEST_IF(IsOpenGL());
DAWN_SKIP_TEST_IF(IsAsan());
// Test non-mappable buffer
{
@ -592,6 +594,7 @@ TEST_P(BufferTests, CreateBufferMappedOOM) {
TEST_P(BufferTests, CreateBufferOOMMapReadAsync) {
// TODO(http://crbug.com/dawn/27): Missing support.
DAWN_SKIP_TEST_IF(IsOpenGL());
DAWN_SKIP_TEST_IF(IsAsan());
auto RunTest = [this](const wgpu::BufferDescriptor& descriptor) {
wgpu::Buffer buffer;
@ -632,6 +635,7 @@ TEST_P(BufferTests, CreateBufferOOMMapReadAsync) {
TEST_P(BufferTests, CreateBufferOOMMapWriteAsync) {
// TODO(http://crbug.com/dawn/27): Missing support.
DAWN_SKIP_TEST_IF(IsOpenGL());
DAWN_SKIP_TEST_IF(IsAsan());
auto RunTest = [this](const wgpu::BufferDescriptor& descriptor) {
wgpu::Buffer buffer;