blob: a520f9bf8543058fff27d6ab901a40678600f176 [file] [log] [blame]
Michael Lentine83ab3412015-11-03 16:20:30 -08001// VK tests
2//
Karl Schultz929a1002016-02-04 11:33:21 -07003// 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.
Michael Lentine83ab3412015-11-03 16:20:30 -08007//
Karl Schultz929a1002016-02-04 11:33:21 -07008// 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:
Michael Lentine83ab3412015-11-03 16:20:30 -080014//
Karl Schultz929a1002016-02-04 11:33:21 -070015// The above copyright notice(s) and this permission notice shall be included in
16// all copies or substantial portions of the Materials.
Michael Lentine83ab3412015-11-03 16:20:30 -080017//
Karl Schultz929a1002016-02-04 11:33:21 -070018// THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
Michael Lentine83ab3412015-11-03 16:20:30 -080019// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
Karl Schultz929a1002016-02-04 11:33:21 -070020// 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.
Michael Lentine83ab3412015-11-03 16:20:30 -080026
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
44class VkTestFramework : public ::testing::Test
45{
46public:
47 VkTestFramework();
48 ~VkTestFramework();
49
50 static void InitArgs(int *argc, char *argv[]);
51 static void Finish();
52
Michael Lentineb62cc052015-12-09 08:44:25 -080053 VkFormat GetFormat(VkInstance instance, vk_testing::Device *device);
Michael Lentinedcbb5532015-11-24 09:50:46 -060054 bool GLSLtoSPV(const VkShaderStageFlagBits shader_type,
Michael Lentine83ab3412015-11-03 16:20:30 -080055 const char *pshader,
56 std::vector<unsigned int> &spv);
57
58 static bool m_use_glsl;
59};
60
61class TestEnvironment : public ::testing::Environment
62{
63 public:
64 void SetUp();
65
66 void TearDown();
67};
68
69#endif