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 * Licensed under the Apache License, Version 2.0 (the "License"); 7 * you may not use this file except in compliance with the License. 8 * You may obtain a copy of the License at 9 * 10 * http://www.apache.org/licenses/LICENSE-2.0 11 * 12 * Unless required by applicable law or agreed to in writing, software 13 * distributed under the License is distributed on an "AS IS" BASIS, 14 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 * See the License for the specific language governing permissions and 16 * limitations under the License. 17 * 18 * Author: Chia-I Wu <olvaffe@gmail.com> 19 * Author: Chris Forbes <chrisf@ijw.co.nz> 20 * Author: Courtney Goeltzenleuchter <courtney@LunarG.com> 21 * Author: Mark Lobodzinski <mark@lunarg.com> 22 * Author: Mike Stroyan <mike@LunarG.com> 23 * Author: Tobin Ehlis <tobine@google.com> 24 * Author: Tony Barbour <tony@LunarG.com> 25 */ 26 27 #ifndef TEST_ENVIRONMENT_H 28 #define TEST_ENVIRONMENT_H 29 30 #include "vktestbinding.h" 31 32 namespace vk_testing { 33 class Environment : public ::testing::Environment { 34 public: 35 Environment(); 36 37 bool parse_args(int argc, char **argv); 38 39 virtual void SetUp(); 40 virtual void TearDown(); 41 devices()42 const std::vector<Device *> &devices() { return devs_; } default_device()43 Device &default_device() { return *(devs_[default_dev_]); } get_instance()44 VkInstance get_instance() { return inst; } 45 VkPhysicalDevice gpus[16]; 46 47 private: 48 VkApplicationInfo app_; 49 uint32_t default_dev_; 50 VkInstance inst; 51 52 std::vector<Device *> devs_; 53 }; 54 } // namespace vk_testing 55 #endif // TEST_ENVIRONMENT_H 56