webkit  2cdf99a9e3038c7e01b3c37e8ad903ecbe5eecf1
https://github.com/WebKit/webkit
gles_conformance_tests.h
Go to the documentation of this file.
1 //
2 // Copyright (c) 2014 The ANGLE Project Authors. All rights reserved.
3 // Use of this source code is governed by a BSD-style license that can be
4 // found in the LICENSE file.
5 //
6 
7 #ifndef CONFORMANCE_TESTS_CONFORMANCE_TEST_H_
8 #define CONFORMANCE_TESTS_CONFORMANCE_TEST_H_
9 
10 #include "gtest/gtest.h"
11 
12 #include <EGL/egl.h>
13 #include <EGL/eglext.h>
14 
15 #include <string>
16 
17 struct D3D9
18 {
19  static EGLNativeDisplayType GetNativeDisplay()
20  {
21  return EGL_DEFAULT_DISPLAY;
22  }
23 };
24 
25 struct D3D11
26 {
27  static EGLNativeDisplayType GetNativeDisplay()
28  {
30  }
31 };
32 
33 #define CONFORMANCE_TESTS_ES2 2
34 #define CONFORMANCE_TESTS_ES3 3
35 
36 #if CONFORMANCE_TESTS_TYPE == CONFORMANCE_TESTS_ES2
37  typedef testing::Types<D3D9, D3D11> ConformanceTestTypes;
38 #elif CONFORMANCE_TESTS_TYPE == CONFORMANCE_TESTS_ES3
39  typedef testing::Types<D3D11> ConformanceTestTypes;
40 #else
41 # error "Unknown CONFORMANCE_TESTS_TYPE"
42 #endif
43 
44 #define DEFINE_CONFORMANCE_TEST_CLASS(name) \
45  template <typename T> class name : public ConformanceTest<T> { }; \
46  TYPED_TEST_CASE(name, ConformanceTestTypes);
47 
48 template <typename T>
50 {
51  public:
53  : mNativeDisplay(T::GetNativeDisplay())
54  {
55  }
56 
57  protected:
58  void run(const std::string &testPath)
59  {
60  RunConformanceTest(testPath, mNativeDisplay);
61  }
62 
63  private:
64  EGLNativeDisplayType mNativeDisplay;
65 };
66 
67 void RunConformanceTest(const std::string &testPath, EGLNativeDisplayType nativeDisplay);
68 
69 #endif // CONFORMANCE_TESTS_CONFORMANCE_TEST_H_
static EGLNativeDisplayType GetNativeDisplay()
Definition: gles_conformance_tests.h:27
Definition: gles_conformance_tests.h:25
Definition: gles_conformance_tests.h:49
static EGLNativeDisplayType GetNativeDisplay()
Definition: gles_conformance_tests.h:19
void run(const std::string &testPath)
Definition: gles_conformance_tests.h:58
void RunConformanceTest(const std::string &testPath, EGLNativeDisplayType nativeDisplay)
Definition: gles_conformance_tests.cpp:49
TestSubObjConstructor T
Definition: TestTypedefs.idl:84
#define EGL_DEFAULT_DISPLAY
Definition: egl.h:239
Definition: gles_conformance_tests.h:17
GLsizei const GLchar *const * string
Definition: gl2.h:479
Definition: gtest.h:341
#define EGL_D3D11_ONLY_DISPLAY_ANGLE
Definition: eglext.h:491
ConformanceTest()
Definition: gles_conformance_tests.h:52