Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
PojavLauncherTeam
GitHub Repository: PojavLauncherTeam/angle
Path: blob/main_old/src/tests/angle_end2end_tests_main.cpp
1693 views
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
namespace
23
{
24
constexpr char kTestExpectationsPath[] = "src/tests/angle_end2end_tests_expectations.txt";
25
} // namespace
26
27
int main(int argc, char **argv)
28
{
29
angle::TestSuite testSuite(&argc, argv);
30
ANGLEProcessTestArgs(&argc, argv);
31
RegisterContextCompatibilityTests();
32
33
constexpr size_t kMaxPath = 512;
34
std::array<char, kMaxPath> foundDataPath;
35
if (!angle::FindTestDataPath(kTestExpectationsPath, foundDataPath.data(), foundDataPath.size()))
36
{
37
std::cerr << "Unable to find test expectations path (" << kTestExpectationsPath << ")\n";
38
return EXIT_FAILURE;
39
}
40
41
// end2end test expectations only allow SKIP at the moment.
42
testSuite.setTestExpectationsAllowMask(angle::GPUTestExpectationsParser::kGpuTestSkip |
43
angle::GPUTestExpectationsParser::kGpuTestTimeout);
44
45
if (!testSuite.loadAllTestExpectationsFromFile(std::string(foundDataPath.data())))
46
{
47
return EXIT_FAILURE;
48
}
49
50
return testSuite.run();
51
}
52
53