Hash :
5df9f523
Author :
Date :
2014-05-16T10:37:47
Automate the DEQP tests by wrapping them in the gtest suite. BUG=angle:497 Change-Id: If0a72c053bccccc4369ec78dd70173bbadb1be7b Reviewed-on: https://chromium-review.googlesource.com/200044 Reviewed-by: Jamie Madill <jmadill@chromium.org> Tested-by: Geoff Lang <geofflang@chromium.org>
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63
//
// Copyright (c) 2014 The ANGLE Project Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
//
#include "gtest/gtest.h"
#include "deqp_tests.h"
#include <EGL/eglext.h>
#include <map>
#include <string>
#include <vector>
int main(int argc, char** argv)
{
testing::InitGoogleTest(&argc, argv);
typedef std::pair<std::string, EGLNativeDisplayType> NameDisplayTypePair;
typedef std::map<std::string, EGLNativeDisplayType> DisplayTypeMap;
DisplayTypeMap allDisplays;
allDisplays["d3d11"] = EGL_D3D11_ONLY_DISPLAY_ANGLE;
// Iterate through the command line arguments and check if they are config names
std::vector<NameDisplayTypePair> requestedDisplays;
for (size_t i = 1; i < static_cast<size_t>(argc); i++)
{
DisplayTypeMap::const_iterator iter = allDisplays.find(argv[i]);
if (iter != allDisplays.end())
{
requestedDisplays.push_back(*iter);
}
}
// If no configs were requested, run them all
if (requestedDisplays.empty())
{
for (DisplayTypeMap::const_iterator i = allDisplays.begin(); i != allDisplays.end(); i++)
{
requestedDisplays.push_back(*i);
}
}
// Run each requested config
int rt = 0;
for (size_t i = 0; i < requestedDisplays.size(); i++)
{
DEQPConfig config;
config.displayType = requestedDisplays[i].second;
config.width = 256;
config.height = 256;
config.hidden = false;
SetCurrentConfig(config);
std::cout << "Running test configuration \"" << requestedDisplays[i].first << "\".\n";
rt |= RUN_ALL_TESTS();
}
return rt;
}