1 //  VK tests
2 //
3 //  Copyright (c) 2015-2016 The Khronos Group Inc.
4 //  Copyright (c) 2015-2016 Valve Corporation
5 //  Copyright (c) 2015-2016 LunarG, Inc.
6 //  Copyright (c) 2015-2016 Google, Inc.
7 //
8 //  Permission is hereby granted, free of charge, to any person obtaining a copy
9 //  of this software and/or associated documentation files (the "Materials"), to
10 //  deal in the Materials without restriction, including without limitation the
11 //  rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
12 //  sell copies of the Materials, and to permit persons to whom the Materials are
13 //  furnished to do so, subject to the following conditions:
14 //
15 //  The above copyright notice(s) and this permission notice shall be included in
16 //  all copies or substantial portions of the Materials.
17 //
18 //  THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
19 //  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
20 //  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
21 //
22 //  IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
23 //  DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
24 //  OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE MATERIALS OR THE
25 //  USE OR OTHER DEALINGS IN THE MATERIALS.
26 
27 #ifndef VKTESTFRAMEWORKANDROID_H
28 #define VKTESTFRAMEWORKANDROID_H
29 
30 #include "test_common.h"
31 #include "vktestbinding.h"
32 
33 #if defined(NDEBUG)
34 #define U_ASSERT_ONLY __attribute__((unused))
35 #else
36 #define U_ASSERT_ONLY
37 #endif
38 
39 // Can be used by tests to record additional details / description of test
40 #define TEST_DESCRIPTION(desc) RecordProperty("description", desc)
41 
42 #define ICD_SPV_MAGIC   0x07230203
43 
44 class VkTestFramework : public ::testing::Test
45 {
46 public:
47     VkTestFramework();
48     ~VkTestFramework();
49 
50     static void InitArgs(int *argc, char *argv[]);
51     static void Finish();
52 
53     VkFormat GetFormat(VkInstance instance, vk_testing::Device *device);
54     bool GLSLtoSPV(const VkShaderStageFlagBits shader_type,
55                    const char *pshader,
56                    std::vector<unsigned int> &spv);
57 
58     static bool m_use_glsl;
59 };
60 
61 class TestEnvironment : public ::testing::Environment
62 {
63  public:
64   void SetUp();
65 
66   void TearDown();
67 };
68 
69 #endif
70