Hash :
9d49d843
Author :
Date :
2021-12-15T00:36:54
Add WebGLCompressedTextureAvailabilityTest Acts as a regression test for https://crrev.com/c/3338624 Has been verified to catch the earlier error in the include guards. Bug: angleproject:6809 Bug: chromium:1279908 Change-Id: I248aca46db26eea304044835ea35fc2400ed459d Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3338748 Reviewed-by: Kenneth Russell <kbr@chromium.org> Commit-Queue: Kenneth Russell <kbr@chromium.org>
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789
//
// Copyright 2014 The ANGLE Project Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
//
// angle_test_instantiate.cpp: Adds support for filtering parameterized
// tests by platform, so we skip unsupported configs.
#include "test_utils/angle_test_instantiate.h"
#include <algorithm>
#include <array>
#include <iostream>
#include <map>
#include "angle_gl.h"
#include "common/debug.h"
#include "common/platform.h"
#include "common/system_utils.h"
#include "common/third_party/base/anglebase/no_destructor.h"
#include "gpu_info_util/SystemInfo.h"
#include "test_utils/angle_test_configs.h"
#include "util/EGLWindow.h"
#include "util/OSWindow.h"
#include "util/test_utils.h"
#if defined(ANGLE_PLATFORM_WINDOWS)
# include <VersionHelpers.h>
# include "util/windows/WGLWindow.h"
#endif // defined(ANGLE_PLATFORM_WINDOWS)
#if defined(ANGLE_PLATFORM_APPLE)
# include "test_utils/angle_test_instantiate_apple.h"
#endif
namespace angle
{
namespace
{
bool IsAngleEGLConfigSupported(const PlatformParameters ¶m, OSWindow *osWindow)
{
std::unique_ptr<angle::Library> eglLibrary;
#if defined(ANGLE_USE_UTIL_LOADER)
eglLibrary.reset(
angle::OpenSharedLibrary(ANGLE_EGL_LIBRARY_NAME, angle::SearchType::ModuleDir));
#endif
EGLWindow *eglWindow = EGLWindow::New(param.majorVersion, param.minorVersion);
ConfigParameters configParams;
bool result =
eglWindow->initializeGL(osWindow, eglLibrary.get(), angle::GLESDriverType::AngleEGL,
param.eglParameters, configParams);
eglWindow->destroyGL();
EGLWindow::Delete(&eglWindow);
return result;
}
bool IsSystemWGLConfigSupported(const PlatformParameters ¶m, OSWindow *osWindow)
{
#if defined(ANGLE_PLATFORM_WINDOWS) && defined(ANGLE_USE_UTIL_LOADER)
std::unique_ptr<angle::Library> openglLibrary(
angle::OpenSharedLibrary("opengl32", angle::SearchType::SystemDir));
WGLWindow *wglWindow = WGLWindow::New(param.majorVersion, param.minorVersion);
ConfigParameters configParams;
bool result =
wglWindow->initializeGL(osWindow, openglLibrary.get(), angle::GLESDriverType::SystemWGL,
param.eglParameters, configParams);
wglWindow->destroyGL();
WGLWindow::Delete(&wglWindow);
return result;
#else
return false;
#endif // defined(ANGLE_PLATFORM_WINDOWS) && defined(ANGLE_USE_UTIL_LOADER)
}
bool IsSystemEGLConfigSupported(const PlatformParameters ¶m, OSWindow *osWindow)
{
#if defined(ANGLE_USE_UTIL_LOADER)
std::unique_ptr<angle::Library> eglLibrary;
eglLibrary.reset(OpenSharedLibraryWithExtension(GetNativeEGLLibraryNameWithExtension(),
SearchType::SystemDir));
EGLWindow *eglWindow = EGLWindow::New(param.majorVersion, param.minorVersion);
ConfigParameters configParams;
bool result =
eglWindow->initializeGL(osWindow, eglLibrary.get(), angle::GLESDriverType::SystemEGL,
param.eglParameters, configParams);
eglWindow->destroyGL();
EGLWindow::Delete(&eglWindow);
return result;
#else
return false;
#endif
}
bool IsAndroidDevice(const std::string &deviceName)
{
if (!IsAndroid())
{
return false;
}
SystemInfo *systemInfo = GetTestSystemInfo();
if (systemInfo->machineModelName == deviceName)
{
return true;
}
return false;
}
bool IsAndroid9OrNewer()
{
if (!IsAndroid())
{
return false;
}
SystemInfo *systemInfo = GetTestSystemInfo();
if (systemInfo->androidSdkLevel >= 28)
{
return true;
}
return false;
}
GPUDeviceInfo *GetActiveGPUDeviceInfo()
{
SystemInfo *systemInfo = GetTestSystemInfo();
// Unfortunately sometimes GPU info collection can fail.
if (systemInfo->gpus.empty())
{
return nullptr;
}
return &systemInfo->gpus[systemInfo->activeGPUIndex];
}
bool HasSystemVendorID(VendorID vendorID)
{
GPUDeviceInfo *gpuInfo = GetActiveGPUDeviceInfo();
return gpuInfo && gpuInfo->vendorId == vendorID;
}
bool HasSystemDeviceID(VendorID vendorID, DeviceID deviceID)
{
GPUDeviceInfo *gpuInfo = GetActiveGPUDeviceInfo();
return gpuInfo && gpuInfo->vendorId == vendorID && gpuInfo->deviceId == deviceID;
}
using ParamAvailabilityCache = std::map<PlatformParameters, bool>;
ParamAvailabilityCache &GetAvailabilityCache()
{
static angle::base::NoDestructor<std::unique_ptr<ParamAvailabilityCache>>
sParamAvailabilityCache(new ParamAvailabilityCache());
return **sParamAvailabilityCache;
}
constexpr size_t kMaxConfigNameLen = 100;
std::array<char, kMaxConfigNameLen> gSelectedConfig;
} // namespace
bool gEnableANGLEPerTestCaptureLabel = false;
bool IsConfigSelected()
{
return gSelectedConfig[0] != 0;
}
#if !defined(ANGLE_PLATFORM_APPLE)
// For Apple platform, see angle_test_instantiate_apple.mm
bool IsMetalTextureSwizzleAvailable()
{
return false;
}
bool IsMetalCompressedTexture3DAvailable()
{
return false;
}
#endif
SystemInfo *GetTestSystemInfo()
{
static SystemInfo *sSystemInfo = nullptr;
if (sSystemInfo == nullptr)
{
sSystemInfo = new SystemInfo;
if (!GetSystemInfo(sSystemInfo))
{
std::cerr << "Warning: incomplete system info collection.\n";
}
// On dual-GPU Macs we want the active GPU to always appear to be the
// high-performance GPU for tests.
// We can call the generic GPU info collector which selects the
// non-Intel GPU as the active one on dual-GPU machines.
if (IsOSX())
{
GetDualGPUInfo(sSystemInfo);
}
// Print complete system info when available.
// Seems to trip up Android test expectation parsing.
// Also don't print info when a config is selected to prevent test spam.
if (!IsAndroid() && !IsConfigSelected())
{
PrintSystemInfo(*sSystemInfo);
}
}
return sSystemInfo;
}
bool IsAndroid()
{
#if defined(ANGLE_PLATFORM_ANDROID)
return true;
#else
return false;
#endif
}
bool IsLinux()
{
#if defined(ANGLE_PLATFORM_LINUX)
return true;
#else
return false;
#endif
}
bool IsOSX()
{
#if defined(ANGLE_PLATFORM_MACOS)
return true;
#else
return false;
#endif
}
bool IsIOS()
{
#if defined(ANGLE_PLATFORM_IOS)
return true;
#else
return false;
#endif
}
bool IsARM64()
{
// _M_ARM64 is Windows-specific, while __aarch64__ is for other platforms.
#if defined(_M_ARM64) || defined(__aarch64__)
return true;
#else
return false;
#endif
}
bool IsOzone()
{
#if defined(USE_OZONE) && (defined(USE_X11) || defined(ANGLE_USE_VULKAN_DISPLAY))
// We do not have a proper support for Ozone/Linux yet. Still, we need to figure out how to
// properly initialize tests and differentiate between X11 and Wayland. Probably, passing a
// command line argument could be sufficient. At the moment, run tests only for X11 backend
// as we don't have Wayland support in Angle. Yes, this is a bit weird to return false, but
// it makes it possible to continue angle tests with X11 regardless of the Chromium config
// for linux, which is use_x11 && use_ozone. Also, IsOzone is a bit vague now. It was only
// expected that angle could run with ozone/drm backend for ChromeOS. And returning true
// for desktop Linux when USE_OZONE && USE_X11 are both defined results in incorrect tests'
// expectations. We should also rework them and make IsOzone less vague.
//
// TODO(crbug.com/angleproject/4977): make it possible to switch between X11 and Wayland on
// Ozone/Linux builds. Probably, it's possible to identify the WAYLAND backend by checking
// the WAYLAND_DISPLAY or XDG_SESSION_TYPE env vars. And also make the IsOzone method less
// vague (read the comment above).
return false;
#elif defined(USE_OZONE)
return true;
#else
return false;
#endif
}
bool IsWindows()
{
#if defined(ANGLE_PLATFORM_WINDOWS)
return true;
#else
return false;
#endif
}
bool IsWindows7()
{
#if defined(ANGLE_PLATFORM_WINDOWS)
return ::IsWindows7OrGreater() && !::IsWindows8OrGreater();
#else
return false;
#endif
}
bool IsFuchsia()
{
#if defined(ANGLE_PLATFORM_FUCHSIA)
return true;
#else
return false;
#endif
}
bool IsNexus5X()
{
return IsAndroidDevice("Nexus 5X");
}
bool IsNexus9()
{
return IsAndroidDevice("Nexus 9");
}
bool IsPixelXL()
{
return IsAndroidDevice("Pixel XL");
}
bool IsPixel2()
{
return IsAndroidDevice("Pixel 2");
}
bool IsPixel2XL()
{
return IsAndroidDevice("Pixel 2 XL");
}
bool IsPixel4()
{
return IsAndroidDevice("Pixel 4");
}
bool IsPixel4XL()
{
return IsAndroidDevice("Pixel 4 XL");
}
bool IsNVIDIAShield()
{
return IsAndroidDevice("SHIELD Android TV");
}
bool IsIntel()
{
return HasSystemVendorID(kVendorID_Intel);
}
bool IsIntelUHD630Mobile()
{
return HasSystemDeviceID(kVendorID_Intel, kDeviceID_UHD630Mobile);
}
bool IsAMD()
{
return HasSystemVendorID(kVendorID_AMD);
}
bool IsApple()
{
return HasSystemVendorID(kVendorID_Apple);
}
bool IsARM()
{
return HasSystemVendorID(kVendorID_ARM);
}
bool IsSwiftshaderDevice()
{
return HasSystemDeviceID(kVendorID_GOOGLE, kDeviceID_Swiftshader);
}
bool IsNVIDIA()
{
#if defined(ANGLE_PLATFORM_ANDROID)
// NVIDIA Shield cannot detect vendor ID (http://anglebug.com/3541)
if (IsNVIDIAShield())
{
return true;
}
#endif
return HasSystemVendorID(kVendorID_NVIDIA);
}
bool IsQualcomm()
{
return IsNexus5X() || IsNexus9() || IsPixelXL() || IsPixel2() || IsPixel2XL() || IsPixel4() ||
IsPixel4XL();
}
bool Is64Bit()
{
#if defined(ANGLE_IS_64_BIT_CPU)
return true;
#else
return false;
#endif // defined(ANGLE_IS_64_BIT_CPU)
}
bool IsConfigAllowlisted(const SystemInfo &systemInfo, const PlatformParameters ¶m)
{
VendorID vendorID =
systemInfo.gpus.empty() ? 0 : systemInfo.gpus[systemInfo.activeGPUIndex].vendorId;
// We support the default and null back-ends on every platform.
if (param.driver == GLESDriverType::AngleEGL)
{
if (param.getRenderer() == EGL_PLATFORM_ANGLE_TYPE_DEFAULT_ANGLE)
return true;
if (param.getRenderer() == EGL_PLATFORM_ANGLE_TYPE_NULL_ANGLE)
return true;
}
// TODO: http://crbug.com/swiftshader/145
// Swiftshader does not currently have all the robustness features
// we need for ANGLE. In particular, it is unable to detect and recover
// from infinitely looping shaders. That bug is the tracker for fixing
// that and when resolved we can remove the following code.
// This test will disable tests marked with the config WithRobustness
// when run with the swiftshader Vulkan driver and on Android.
if ((param.isSwiftshader() || IsSwiftshaderDevice()) &&
param.eglParameters.robustness == EGL_TRUE)
{
return false;
}
if (IsWindows())
{
switch (param.driver)
{
case GLESDriverType::AngleEGL:
switch (param.getRenderer())
{
case EGL_PLATFORM_ANGLE_TYPE_D3D9_ANGLE:
case EGL_PLATFORM_ANGLE_TYPE_D3D11_ANGLE:
return true;
case EGL_PLATFORM_ANGLE_TYPE_OPENGL_ANGLE:
// Note we disable AMD OpenGL testing on Windows due to using a very old and
// outdated card with many driver bugs. See http://anglebug.com/5123
return !IsAMD();
case EGL_PLATFORM_ANGLE_TYPE_VULKAN_ANGLE:
if (IsARM64())
{
return param.getDeviceType() ==
EGL_PLATFORM_ANGLE_DEVICE_TYPE_SWIFTSHADER_ANGLE;
}
return true;
case EGL_PLATFORM_ANGLE_TYPE_OPENGLES_ANGLE:
// ES 3.1+ back-end is not supported properly.
if (param.eglParameters.majorVersion == 3 &&
param.eglParameters.minorVersion > 0)
{
return false;
}
// Win ES emulation is currently only supported on NVIDIA.
return IsNVIDIA(vendorID);
default:
return false;
}
case GLESDriverType::SystemWGL:
// AMD does not support the ES compatibility extensions.
return !IsAMD(vendorID);
default:
return false;
}
}
#if defined(ANGLE_PLATFORM_APPLE)
if (IsOSX() || IsIOS())
{
// We do not support non-ANGLE bindings on OSX.
if (param.driver != GLESDriverType::AngleEGL)
{
return false;
}
switch (param.getRenderer())
{
case EGL_PLATFORM_ANGLE_TYPE_OPENGL_ANGLE:
// ES 3.1+ back-end is not supported properly.
if (param.majorVersion == 3 && param.minorVersion > 0)
{
return false;
}
return true;
case EGL_PLATFORM_ANGLE_TYPE_METAL_ANGLE:
if (!IsMetalRendererAvailable())
{
return false;
}
return true;
case EGL_PLATFORM_ANGLE_TYPE_VULKAN_ANGLE:
// OSX does not support native vulkan
return param.getDeviceType() == EGL_PLATFORM_ANGLE_DEVICE_TYPE_SWIFTSHADER_ANGLE;
default:
return false;
}
}
#endif // #if defined(ANGLE_PLATFORM_APPLE)
if (IsFuchsia())
{
// We do not support non-ANGLE bindings on Fuchsia.
if (param.driver != GLESDriverType::AngleEGL)
{
return false;
}
// ES 3 configs do not work properly on Fuchsia ARM.
// TODO(anglebug.com/4352): Investigate missing features.
if (param.majorVersion > 2 && IsARM())
return false;
// Loading swiftshader is not brought up on Fuchsia.
// TODO(anglebug.com/4353): Support loading swiftshader vulkan ICD.
if (param.getDeviceType() == EGL_PLATFORM_ANGLE_DEVICE_TYPE_SWIFTSHADER_ANGLE)
return false;
// Currently we only support the Vulkan back-end on Fuchsia.
return (param.getRenderer() == EGL_PLATFORM_ANGLE_TYPE_VULKAN_ANGLE);
}
if (IsOzone())
{
// We do not support non-ANGLE bindings on Ozone.
if (param.driver != GLESDriverType::AngleEGL)
return false;
// ES 3 configs do not work properly on Ozone.
if (param.majorVersion > 2)
return false;
// Currently we only support the GLES back-end on Ozone.
return (param.getRenderer() == EGL_PLATFORM_ANGLE_TYPE_OPENGLES_ANGLE);
}
if (IsLinux() || IsAndroid())
{
// We do not support WGL bindings on Linux/Android. We do support system EGL.
switch (param.driver)
{
case GLESDriverType::SystemEGL:
return param.getRenderer() == EGL_PLATFORM_ANGLE_TYPE_DEFAULT_ANGLE;
case GLESDriverType::SystemWGL:
return false;
default:
break;
}
}
if (IsLinux())
{
ASSERT(param.driver == GLESDriverType::AngleEGL);
// Currently we support the OpenGL and Vulkan back-ends on Linux.
switch (param.getRenderer())
{
case EGL_PLATFORM_ANGLE_TYPE_OPENGL_ANGLE:
return true;
case EGL_PLATFORM_ANGLE_TYPE_VULKAN_ANGLE:
// http://issuetracker.google.com/173004081
return !IsIntel() || param.eglParameters.asyncCommandQueueFeatureVulkan != EGL_TRUE;
default:
return false;
}
}
if (IsAndroid())
{
ASSERT(param.driver == GLESDriverType::AngleEGL);
// Nexus Android devices don't support backing 3.2 contexts
if (param.eglParameters.majorVersion == 3 && param.eglParameters.minorVersion == 2)
{
if (IsNexus5X())
{
return false;
}
}
// Currently we support the GLES and Vulkan back-ends on Android.
switch (param.getRenderer())
{
case EGL_PLATFORM_ANGLE_TYPE_OPENGLES_ANGLE:
return true;
case EGL_PLATFORM_ANGLE_TYPE_VULKAN_ANGLE:
// Swiftshader's vulkan frontend doesn't build on Android.
if (param.getDeviceType() == EGL_PLATFORM_ANGLE_DEVICE_TYPE_SWIFTSHADER_ANGLE)
{
return false;
}
if (!IsAndroid9OrNewer())
{
return false;
}
if (param.eglParameters.supportsVulkanViewportFlip == EGL_FALSE)
{
return false;
}
return true;
default:
return false;
}
}
// Unknown platform.
return false;
}
bool IsConfigSupported(const PlatformParameters ¶m)
{
OSWindow *osWindow = OSWindow::New();
bool result = false;
if (osWindow->initialize("CONFIG_TESTER", 1, 1))
{
switch (param.driver)
{
case GLESDriverType::AngleEGL:
result = IsAngleEGLConfigSupported(param, osWindow);
break;
case GLESDriverType::SystemEGL:
result = IsSystemEGLConfigSupported(param, osWindow);
break;
case GLESDriverType::SystemWGL:
result = IsSystemWGLConfigSupported(param, osWindow);
break;
}
osWindow->destroy();
}
OSWindow::Delete(&osWindow);
return result;
}
bool IsPlatformAvailable(const PlatformParameters ¶m)
{
// Disable "null" device when not on ANGLE or in D3D9.
if (param.getDeviceType() == EGL_PLATFORM_ANGLE_DEVICE_TYPE_NULL_ANGLE)
{
if (param.driver != GLESDriverType::AngleEGL)
return false;
if (param.getRenderer() == EGL_PLATFORM_ANGLE_TYPE_D3D9_ANGLE)
return false;
}
switch (param.getRenderer())
{
case EGL_PLATFORM_ANGLE_TYPE_DEFAULT_ANGLE:
break;
case EGL_PLATFORM_ANGLE_TYPE_D3D9_ANGLE:
#if !defined(ANGLE_ENABLE_D3D9)
return false;
#else
break;
#endif
case EGL_PLATFORM_ANGLE_TYPE_D3D11_ANGLE:
#if !defined(ANGLE_ENABLE_D3D11)
return false;
#else
break;
#endif
case EGL_PLATFORM_ANGLE_TYPE_OPENGL_ANGLE:
case EGL_PLATFORM_ANGLE_TYPE_OPENGLES_ANGLE:
#if !defined(ANGLE_ENABLE_OPENGL)
return false;
#else
break;
#endif
case EGL_PLATFORM_ANGLE_TYPE_VULKAN_ANGLE:
#if !defined(ANGLE_ENABLE_VULKAN)
return false;
#else
break;
#endif
case EGL_PLATFORM_ANGLE_TYPE_METAL_ANGLE:
#if !defined(ANGLE_ENABLE_METAL)
return false;
#else
break;
#endif
case EGL_PLATFORM_ANGLE_TYPE_NULL_ANGLE:
#if !defined(ANGLE_ENABLE_NULL)
return false;
#else
break;
#endif
default:
std::cout << "Unknown test platform: " << param << std::endl;
return false;
}
bool result = false;
auto iter = GetAvailabilityCache().find(param);
if (iter != GetAvailabilityCache().end())
{
result = iter->second;
}
else
{
if (IsConfigSelected())
{
std::stringstream strstr;
strstr << param;
if (strstr.str() == std::string(gSelectedConfig.data()))
{
result = true;
}
}
else
{
const SystemInfo *systemInfo = GetTestSystemInfo();
if (systemInfo)
{
result = IsConfigAllowlisted(*systemInfo, param);
}
else
{
result = IsConfigSupported(param);
}
}
GetAvailabilityCache()[param] = result;
// Enable this unconditionally to print available platforms.
if (IsConfigSelected())
{
if (result)
{
std::cout << "Test Config: " << param << "\n";
}
}
else if (!result)
{
std::cout << "Skipping tests using configuration " << param
<< " because it is not available.\n";
}
}
return result;
}
std::vector<std::string> GetAvailableTestPlatformNames()
{
std::vector<std::string> platformNames;
for (const auto &iter : GetAvailabilityCache())
{
if (iter.second)
{
std::stringstream strstr;
strstr << iter.first;
platformNames.push_back(strstr.str());
}
}
// Keep the list sorted.
std::sort(platformNames.begin(), platformNames.end());
return platformNames;
}
void SetSelectedConfig(const char *selectedConfig)
{
gSelectedConfig.fill(0);
strncpy(gSelectedConfig.data(), selectedConfig, kMaxConfigNameLen - 1);
}
} // namespace angle