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