Commit Graph
6 Commits
Author SHA1 Message Date
Nico Weber ce8bb2fa58 Improve standards conformance of ANGLE's testing code.
ANGLE's testing code recently got enabled in Chromium's builds. While it
builds fine with cl.exe, it isn't quite standards-conformant and doesn't
build with clang. Fix this.

There were three issues:

1. ANGLE_TYPED_TEST_CASE() is a variadic macro that tries to use
   __VA_ARGS__ as argument to a variadic template and then pass
   that template to another macro. However, [cpp.replace] describes
   that ANGLE_TYPED_TEST_CASE(Test, int, float) should be expanded
   to TYPED_TEST_CASE(Test, ::testing::Types<int, float>) which
   should be interpreted as a "call" of TYPED_TEST_CASE with the
   3 macro arguments `Test`, `::testing::Types<int`, and `float>`.
   As a fix, use a typedef for the variadic template and refer to
   it through the typedef in the macro call.

2. `#version` was used on its own line in a substitution of the
   SHADER_SOURCE macro. [cpp]p1 says that every line starting with
   a `#` is a preprocessing directive, and [cpp.replace]p11 says
   "If there are sequences of preprocessing tokens within the list
   of arguments that would otherwise act as preprocessing directives,
   the behavior is undefined" (with a footnote that this includes
   non-directives -- # followed by unknown text). As a fix, merge the
   `#version` line with the previous line. Now the line doesn't start
   with `#` and things are fine.

3. Unqualified lookup usually doesn't look into dependent bases. If
   this is desired, one usually has to make the call qualified, a
   good explanation for this is at
   http://eli.thegreenplace.net/2012/02/06/dependent-name-lookup-for-c-templates
   cl.exe doesn't implement this rule, and clang tries to emulate
   cl.exe's behavior to a certain extend when in Microsoft mode.
   However, that seems to not work for member templates with explicit
   types (filed http://llvm.org/PR22066 for this, but since it's not
   needed to parse Microsoft headers and not standards-conformant,
   I'm not sure if we'll fix that). As a fix, don't provide an explicit
   type, the inferred type is the same. This is also consistent with
   all the other tests in this file. (We might clean up -Wmicrosoft
   warnings in the future; if so I'll add the explicit this->s that
   are missing in this file when we do.)

BUG=chromium:445406

Change-Id: I77a2f3ab9601a1f0f39b56ed3d05217f123155b8
Reviewed-on: https://chromium-review.googlesource.com/238090
Reviewed-by: Jamie Madill <[email protected]>
Reviewed-by: Brandon Jones <[email protected]>
Tested-by: Geoff Lang <[email protected]>
2015-01-05 16:11:43 +00:00
Geoff Lang 0d3683c425 Update ANGLE_platform_angle to allow requesting of Renderer versions.
Added enums to allow users to request major and minor versions of the
underlying API and if a WARP device is used.

BUG=angle:490

Change-Id: I0bfb2ac8d327da28a47cc8e6346300e47ab9538c
Reviewed-on: https://chromium-review.googlesource.com/225081
Reviewed-by: Shannon Woods <[email protected]>
Tested-by: Geoff Lang <[email protected]>
2014-11-03 17:56:14 +00:00
Austin Kinross 18b931d5e0 Configure Google Tests to run against multiple renderers/GLES versions
BUG=angle:611

Change-Id: I7d43612171c439045038db9ae82fd8716c0b31c6
Reviewed-on: https://chromium-review.googlesource.com/220400
Reviewed-by: Geoff Lang <[email protected]>
Tested-by: Austin Kinross <[email protected]>
2014-09-30 21:51:38 +00:00
Jamie Madill 5599c8f6ff Use shared compile helpers in the ANGLE tests.
BUG=angle:730

Change-Id: Ib3bd646c73355449105e6cf79bdcf0a14b391fd2
Reviewed-on: https://chromium-review.googlesource.com/213550
Tested-by: Jamie Madill <[email protected]>
Reviewed-by: Geoff Lang <[email protected]>
2014-08-27 17:37:07 +00:00
Jamie Madill b759a74873 Fix test class names to reflect their class-ness.
Style guide dictates a camel case scheme for classes. Since the tests
are actually classes, update their names to reflect that.

Change-Id: Ib7422b6d8c5de8414765439704fc103eae8b2d63
Reviewed-on: https://chromium-review.googlesource.com/208680
Tested-by: Jamie Madill <[email protected]>
Reviewed-by: Zhenyao Mo <[email protected]>
2014-07-17 20:32:47 +00:00
Geoff Lang 2c254d8f0e Add swizzle tests.
Change-Id: If04bc249b9da8306896c89c28bb057c2cf4da511
Reviewed-on: https://chromium-review.googlesource.com/181771
Reviewed-by: Jamie Madill <[email protected]>
Reviewed-by: Shannon Woods <[email protected]>
Tested-by: Geoff Lang <[email protected]>
2014-01-15 20:04:43 +00:00