blob: 9f6891e880a3c2fc96e448af02a7e6ec1b993549 [file] [log] [blame]
Tony Barbour92400bb2015-03-02 16:38:52 -07001#ifndef TEST_ENVIRONMENT_H
2#define TEST_ENVIRONMENT_H
Chia-I Wuf8693382015-04-16 22:02:10 +08003
Courtney Goeltzenleuchterd8e229c2015-04-08 15:36:08 -06004#include "vktestbinding.h"
Tony Barbour92400bb2015-03-02 16:38:52 -07005
Courtney Goeltzenleuchterd8e229c2015-04-08 15:36:08 -06006namespace vk_testing {
Tony Barbour92400bb2015-03-02 16:38:52 -07007class Environment : public ::testing::Environment {
8public:
9 Environment();
10
11 bool parse_args(int argc, char **argv);
12
13 virtual void SetUp();
Tony Barbour92400bb2015-03-02 16:38:52 -070014 virtual void TearDown();
Tony Barbour92400bb2015-03-02 16:38:52 -070015
16 const std::vector<Device *> &devices() { return devs_; }
17 Device &default_device() { return *(devs_[default_dev_]); }
Jon Ashburn07daee72015-05-21 18:13:33 -060018 VkInstance get_instance() { return inst; }
Tony Barbourd1c35722015-04-16 15:59:00 -060019 VkPhysicalDevice gpus[16];
Tony Barbour92400bb2015-03-02 16:38:52 -070020
21private:
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -060022 VkApplicationInfo app_;
Tony Barbour92400bb2015-03-02 16:38:52 -070023 int default_dev_;
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -060024 VkInstance inst;
Tony Barbour92400bb2015-03-02 16:38:52 -070025
26 std::vector<Device *> devs_;
27};
28}
29#endif // TEST_ENVIRONMENT_H