Skip to content

  • Projects
  • Groups
  • Snippets
  • Help
  • This project
    • Loading...
  • Sign in / Register
A
angle
  • Project
    • Overview
    • Details
    • Activity
    • Cycle Analytics
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
    • Charts
  • Issues 0
    • Issues 0
    • List
    • Board
    • Labels
    • Milestones
  • Merge Requests 0
    • Merge Requests 0
  • CI / CD
    • CI / CD
    • Pipelines
    • Jobs
    • Schedules
    • Charts
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Members
    • Members
  • Collapse sidebar
  • Activity
  • Graph
  • Charts
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
  • Chen Yisong
  • angle
  • Repository

Switch branch/tag
  • angle
  • src
  • tests
  • test_utils
  • ANGLETest.cpp
Find file
BlameHistoryPermalink
  • Shahbaz Youssefi's avatar
    Allow testing::Combine in ANGLE_INSTANTIATE_TEST · b6eb3412
    Shahbaz Youssefi authored Mar 06, 2019
    In most tests, ANGLE_INSTANTIATE_TEST is sufficient.  This macro takes a
    a variable number of angle::PlatformParameters and instantiates that
    many tests.  angle::PlatformParameters already aggregates multiple
    configurations.
    
    In a number of cases, however, it would be useful to have even more
    configurations in conjunction with angle::PlatformParameters.
    gl_tests/MultiviewDrawTest.cpp solves this by creating a custom class
    that combines angle::PlatformParameters with test-specific
    configurations.  gl_tests/CopyTextureTest.cpp included numerous tests
    with hardcoded values for its configurations.
    
    This change introduces ANGLE_INSTANTIATE_TEST_COMBINE_N.  These macros
    take N testing::* parameter generators followed by the list of
    angle::PlatformParameters as per ANGLE_INSTANTIATE_TEST.  They then
    testing::Combine these generators, placing the angle::PlatformParameters
    list first.
    
    Tests that use this functionality would inherit from
    ANGLETestWithParams<std::tuple<angle::PlatformParameters, ...>> instead
    of ANGLETest, and instantiate their tests as such:
    
    ANGLE_INSTANTIATE_TEST_COMBINE_3(TestName,
                                     PrettyPrintFunction,
                                     testing::ValuesIn(listOfParameters),
                                     testing::Values(some, other, parameters),
                                     testing::Bool(),
                                     ES2_D3D9(),
                                     ES2_D3D11(),
                                     ES2_OPENGL(),
                                     ES2_OPENGLES(),
                                     ES2_VULKAN());
    
    The name of the test, as used by --gtest_filter, will be suffixed with
    the output of the PrettyPrintFunction.  Assuming the tuple type given to
    ANGLETestWithParams is Params, this function takes a
    ::testing::TestParamInfo<Params> input to pretty-print the name of the
    test variation.  It is recommended to output the platform first for
    consistency with other tests.
    
    gl_tests/CopyTextureTest.cpp is modified to use this macro.
    
    Bug: angleproject:3125
    Change-Id: I0311b84659578bf3c7b5e9673b41cc3a3adfc50d
    Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1506236
    Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
    Reviewed-by: 's avatarYuly Novikov <ynovikov@chromium.org>
    b6eb3412
ANGLETest.cpp 38.3 KB
EditWeb IDE
×

Replace ANGLETest.cpp

Attach a file by drag & drop or click to upload


Cancel
A new branch will be created in your fork and a new merge request will be started.