Path: blob/main_old/src/tests/angle_end2end_tests_main.cpp
1693 views
//1// Copyright 2013 The ANGLE Project Authors. All rights reserved.2// Use of this source code is governed by a BSD-style license that can be3// found in the LICENSE file.4//56#include "gtest/gtest.h"7#include "test_utils/runner/TestSuite.h"8#include "util/OSWindow.h"910void ANGLEProcessTestArgs(int *argc, char *argv[]);1112// Register* functions handle setting up special tests that need complex parameterization.13// GoogleTest relies heavily on static initialization to register test functions. This can14// cause all sorts of issues if the right variables aren't initialized in the right order.15// This register function needs to be called explicitly after static initialization and16// before the test launcher starts. This is a safer and generally better way to initialize17// tests. It's also more similar to how the dEQP Test harness works. In the future we should18// likely specialize more register functions more like dEQP instead of relying on static init.19void RegisterContextCompatibilityTests();2021namespace22{23constexpr char kTestExpectationsPath[] = "src/tests/angle_end2end_tests_expectations.txt";24} // namespace2526int main(int argc, char **argv)27{28angle::TestSuite testSuite(&argc, argv);29ANGLEProcessTestArgs(&argc, argv);30RegisterContextCompatibilityTests();3132constexpr size_t kMaxPath = 512;33std::array<char, kMaxPath> foundDataPath;34if (!angle::FindTestDataPath(kTestExpectationsPath, foundDataPath.data(), foundDataPath.size()))35{36std::cerr << "Unable to find test expectations path (" << kTestExpectationsPath << ")\n";37return EXIT_FAILURE;38}3940// end2end test expectations only allow SKIP at the moment.41testSuite.setTestExpectationsAllowMask(angle::GPUTestExpectationsParser::kGpuTestSkip |42angle::GPUTestExpectationsParser::kGpuTestTimeout);4344if (!testSuite.loadAllTestExpectationsFromFile(std::string(foundDataPath.data())))45{46return EXIT_FAILURE;47}4849return testSuite.run();50}515253