• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 //  VK tests
2 //
3 //  Copyright (c) 2015-2019 The Khronos Group Inc.
4 //  Copyright (c) 2015-2019 Valve Corporation
5 //  Copyright (c) 2015-2019 LunarG, Inc.
6 //  Copyright (c) 2015-2019 Google, Inc.
7 //
8 // Licensed under the Apache License, Version 2.0 (the "License");
9 // you may not use this file except in compliance with the License.
10 // You may obtain a copy of the License at
11 //
12 //     http://www.apache.org/licenses/LICENSE-2.0
13 //
14 // Unless required by applicable law or agreed to in writing, software
15 // distributed under the License is distributed on an "AS IS" BASIS,
16 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17 // See the License for the specific language governing permissions and
18 // limitations under the License.
19 
20 #ifndef VKTESTFRAMEWORKANDROID_H
21 #define VKTESTFRAMEWORKANDROID_H
22 
23 #include "spirv-tools/libspirv.h"
24 #include "test_common.h"
25 
26 #if defined(NDEBUG)
27 #define U_ASSERT_ONLY __attribute__((unused))
28 #else
29 #define U_ASSERT_ONLY
30 #endif
31 
32 // Can be used by tests to record additional details / description of test
33 #define TEST_DESCRIPTION(desc) RecordProperty("description", desc)
34 
35 #define ICD_SPV_MAGIC 0x07230203
36 
37 class VkTestFramework : public ::testing::Test {
38    public:
39     VkTestFramework();
40     ~VkTestFramework();
41 
42     static void InitArgs(int *argc, char *argv[]);
43     static void Finish();
44 
45     VkFormat GetFormat(VkInstance instance, vk_testing::Device *device);
46     bool GLSLtoSPV(const VkShaderStageFlagBits shader_type, const char *pshader, std::vector<unsigned int> &spv,
47                    bool debug = false);
48     bool ASMtoSPV(const spv_target_env target_env, const uint32_t options, const char *pasm, std::vector<unsigned int> &spv);
49     static bool m_devsim_layer;
50 };
51 
52 class TestEnvironment : public ::testing::Environment {
53    public:
54     void SetUp();
55 
56     void TearDown();
57 };
58 
59 #endif
60