Karl Schultz | 99e9d1d | 2016-02-02 17:17:23 -0700 | [diff] [blame] | 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 | * |
Karl Schultz | 99e9d1d | 2016-02-02 17:17:23 -0700 | [diff] [blame] | 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 | |
Tony Barbour | 34888cf | 2015-03-02 16:38:52 -0700 | [diff] [blame] | 34 | #ifndef TEST_ENVIRONMENT_H |
| 35 | #define TEST_ENVIRONMENT_H |
Chia-I Wu | 5b66aa5 | 2015-04-16 22:02:10 +0800 | [diff] [blame] | 36 | |
Courtney Goeltzenleuchter | 9cc421e | 2015-04-08 15:36:08 -0600 | [diff] [blame] | 37 | #include "vktestbinding.h" |
Tony Barbour | 34888cf | 2015-03-02 16:38:52 -0700 | [diff] [blame] | 38 | |
Courtney Goeltzenleuchter | 9cc421e | 2015-04-08 15:36:08 -0600 | [diff] [blame] | 39 | namespace vk_testing { |
Tony Barbour | 34888cf | 2015-03-02 16:38:52 -0700 | [diff] [blame] | 40 | class Environment : public ::testing::Environment { |
Karl Schultz | 99e9d1d | 2016-02-02 17:17:23 -0700 | [diff] [blame] | 41 | public: |
Tony Barbour | 34888cf | 2015-03-02 16:38:52 -0700 | [diff] [blame] | 42 | Environment(); |
| 43 | |
| 44 | bool parse_args(int argc, char **argv); |
| 45 | |
| 46 | virtual void SetUp(); |
Tony Barbour | 34888cf | 2015-03-02 16:38:52 -0700 | [diff] [blame] | 47 | virtual void TearDown(); |
Tony Barbour | 34888cf | 2015-03-02 16:38:52 -0700 | [diff] [blame] | 48 | |
| 49 | const std::vector<Device *> &devices() { return devs_; } |
| 50 | Device &default_device() { return *(devs_[default_dev_]); } |
Jon Ashburn | cedc15f | 2015-05-21 18:13:33 -0600 | [diff] [blame] | 51 | VkInstance get_instance() { return inst; } |
Tony Barbour | 8205d90 | 2015-04-16 15:59:00 -0600 | [diff] [blame] | 52 | VkPhysicalDevice gpus[16]; |
Tony Barbour | 34888cf | 2015-03-02 16:38:52 -0700 | [diff] [blame] | 53 | |
Karl Schultz | 99e9d1d | 2016-02-02 17:17:23 -0700 | [diff] [blame] | 54 | private: |
Courtney Goeltzenleuchter | 382489d | 2015-04-10 08:34:15 -0600 | [diff] [blame] | 55 | VkApplicationInfo app_; |
Courtney Goeltzenleuchter | 0abdb66 | 2015-10-07 13:28:58 -0600 | [diff] [blame] | 56 | uint32_t default_dev_; |
Courtney Goeltzenleuchter | 382489d | 2015-04-10 08:34:15 -0600 | [diff] [blame] | 57 | VkInstance inst; |
Tony Barbour | 34888cf | 2015-03-02 16:38:52 -0700 | [diff] [blame] | 58 | |
| 59 | std::vector<Device *> devs_; |
| 60 | }; |
| 61 | } |
| 62 | #endif // TEST_ENVIRONMENT_H |