1/* 2 * Copyright (c) 2015-2016 The Khronos Group Inc. 3 * Copyright (c) 2015-2016 Valve Corporation 4 * Copyright (c) 2015-2016 LunarG, Inc. 5 * 6 * Permission is hereby granted, free of charge, to any person obtaining a copy 7 * of this software and/or associated documentation files (the "Materials"), to 8 * deal in the Materials without restriction, including without limitation the 9 * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or 10 * sell copies of the Materials, and to permit persons to whom the Materials are 11 * furnished to do so, subject to the following conditions: 12 * 13 * The above copyright notice(s) and this permission notice shall be included in 14 * all copies or substantial portions of the Materials. 15 * 16 * THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 19 * 20 * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, 21 * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR 22 * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE MATERIALS OR THE 23 * USE OR OTHER DEALINGS IN THE MATERIALS. 24 * 25 * Author: Chia-I Wu <olvaffe@gmail.com> 26 * Author: Chris Forbes <chrisf@ijw.co.nz> 27 * Author: Courtney Goeltzenleuchter <courtney@LunarG.com> 28 * Author: Mark Lobodzinski <mark@lunarg.com> 29 * Author: Mike Stroyan <mike@LunarG.com> 30 * Author: Tobin Ehlis <tobine@google.com> 31 * Author: Tony Barbour <tony@LunarG.com> 32 */ 33 34#ifndef TEST_ENVIRONMENT_H 35#define TEST_ENVIRONMENT_H 36 37#include "vktestbinding.h" 38 39namespace vk_testing { 40class Environment : public ::testing::Environment { 41 public: 42 Environment(); 43 44 bool parse_args(int argc, char **argv); 45 46 virtual void SetUp(); 47 virtual void TearDown(); 48 49 const std::vector<Device *> &devices() { return devs_; } 50 Device &default_device() { return *(devs_[default_dev_]); } 51 VkInstance get_instance() { return inst; } 52 VkPhysicalDevice gpus[16]; 53 54 private: 55 VkApplicationInfo app_; 56 uint32_t default_dev_; 57 VkInstance inst; 58 59 std::vector<Device *> devs_; 60}; 61} 62#endif // TEST_ENVIRONMENT_H 63