• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 //
2 // Copyright 2013 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 #include "gtest/gtest.h"
8 #include "test_utils/runner/TestSuite.h"
9 #include "util/OSWindow.h"
10 
11 void ANGLEProcessTestArgs(int *argc, char *argv[]);
12 
13 // Register* functions handle setting up special tests that need complex parameterization.
14 // GoogleTest relies heavily on static initialization to register test functions. This can
15 // cause all sorts of issues if the right variables aren't initialized in the right order.
16 // This register function needs to be called explicitly after static initialization and
17 // before the test launcher starts. This is a safer and generally better way to initialize
18 // tests. It's also more similar to how the dEQP Test harness works. In the future we should
19 // likely specialize more register functions more like dEQP instead of relying on static init.
20 void RegisterContextCompatibilityTests();
21 
22 // If we ever move to a text-based expectations format, we should move this list in that file.
23 namespace
24 {
25 const char *kSlowTests[]               = {"GLSLTest.VerifyMaxVertexUniformVectors*",
26                             "MultiThreadingTest.MultiContextDeleteDraw*"};
27 constexpr char kTestExpectationsPath[] = "src/tests/angle_end2end_tests_expectations.txt";
28 }  // namespace
29 
main(int argc,char ** argv)30 int main(int argc, char **argv)
31 {
32     angle::TestSuite testSuite(&argc, argv);
33     ANGLEProcessTestArgs(&argc, argv);
34     RegisterContextCompatibilityTests();
35     testSuite.registerSlowTests(kSlowTests, ArraySize(kSlowTests));
36 
37     constexpr size_t kMaxPath = 512;
38     std::array<char, kMaxPath> foundDataPath;
39     if (!angle::FindTestDataPath(kTestExpectationsPath, foundDataPath.data(), foundDataPath.size()))
40     {
41         std::cerr << "Unable to find test expectations path (" << kTestExpectationsPath << ")\n";
42         return EXIT_FAILURE;
43     }
44 
45     // end2end test expectations only allow SKIP at the moment.
46     testSuite.setTestExpectationsAllowMask(angle::GPUTestExpectationsParser::kGpuTestSkip);
47 
48     if (!testSuite.loadAllTestExpectationsFromFile(std::string(foundDataPath.data())))
49     {
50         return EXIT_FAILURE;
51     }
52 
53     return testSuite.run();
54 }
55