blob: a784644e815c5436f4bfcfd101dc3191e55c4c7f [file] [log] [blame]
Karl Schultz99e9d1d2016-02-02 17:17:23 -07001/*
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 Ashburn43b53e82016-04-19 11:30:31 -06006 * 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 Schultz99e9d1d2016-02-02 17:17:23 -07009 *
Jon Ashburn43b53e82016-04-19 11:30:31 -060010 * http://www.apache.org/licenses/LICENSE-2.0
Karl Schultz99e9d1d2016-02-02 17:17:23 -070011 *
Jon Ashburn43b53e82016-04-19 11:30:31 -060012 * 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 Schultz99e9d1d2016-02-02 17:17:23 -070017 *
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 Barbour34888cf2015-03-02 16:38:52 -070027#ifndef TEST_ENVIRONMENT_H
28#define TEST_ENVIRONMENT_H
Chia-I Wu5b66aa52015-04-16 22:02:10 +080029
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -060030#include "vktestbinding.h"
Tony Barbour34888cf2015-03-02 16:38:52 -070031
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -060032namespace vk_testing {
Tony Barbour34888cf2015-03-02 16:38:52 -070033class Environment : public ::testing::Environment {
Mark Lobodzinskicc7c3052017-01-26 13:34:13 -070034 public:
Tony Barbour34888cf2015-03-02 16:38:52 -070035 Environment();
36
37 bool parse_args(int argc, char **argv);
38
39 virtual void SetUp();
Tony Barbour34888cf2015-03-02 16:38:52 -070040 virtual void TearDown();
Tony Barbour34888cf2015-03-02 16:38:52 -070041
42 const std::vector<Device *> &devices() { return devs_; }
43 Device &default_device() { return *(devs_[default_dev_]); }
Jon Ashburncedc15f2015-05-21 18:13:33 -060044 VkInstance get_instance() { return inst; }
Tony Barbour8205d902015-04-16 15:59:00 -060045 VkPhysicalDevice gpus[16];
Tony Barbour34888cf2015-03-02 16:38:52 -070046
Mark Lobodzinskicc7c3052017-01-26 13:34:13 -070047 private:
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -060048 VkApplicationInfo app_;
Courtney Goeltzenleuchter0abdb662015-10-07 13:28:58 -060049 uint32_t default_dev_;
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -060050 VkInstance inst;
Tony Barbour34888cf2015-03-02 16:38:52 -070051
52 std::vector<Device *> devs_;
53};
54}
Mark Lobodzinskicc7c3052017-01-26 13:34:13 -070055#endif // TEST_ENVIRONMENT_H