Debian Codegraph @

tests/framework/util/test_defines.h

raw
1 /*
2 * Copyright (c) 2025 The Khronos Group Inc.
3 * Copyright (c) 2025 Valve Corporation
4 * Copyright (c) 2025 LunarG, Inc.
5 *
6 * Permission is hereby granted, free of charge, to any person obtaining a copy
7 * of this software and/or associated documentation files (the "Materials"), to
8 * deal in the Materials without restriction, including without limitation the
9 * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
10 * sell copies of the Materials, and to permit persons to whom the Materials are
11 * furnished to do so, subject to the following conditions:
12 *
13 * The above copyright notice(s) and this permission notice shall be included in
14 * all copies or substantial portions of the Materials.
15 *
16 * THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
19 *
20 * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
21 * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
22 * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE MATERIALS OR THE
23 * USE OR OTHER DEALINGS IN THE MATERIALS.
24 *
25 */
26
27 #pragma once
28
29 #if defined(__GNUC__) && __GNUC__ >= 4
30 #define FRAMEWORK_EXPORT __attribute__((visibility("default")))
31 #elif defined(__SUNPRO_C) && (__SUNPRO_C >= 0x590)
32 #define FRAMEWORK_EXPORT __attribute__((visibility("default")))
33 #elif defined(_WIN32)
34 #define FRAMEWORK_EXPORT __declspec(dllexport)
35 #else
36 #define FRAMEWORK_EXPORT
37 #endif
38
39 // Set of platforms with a common set of functionality which is queried throughout the program
40 #if defined(__linux__) || defined(__APPLE__) || defined(__Fuchsia__) || defined(__QNX__) || defined(__FreeBSD__) || \
41 defined(__OpenBSD__) || defined(__NetBSD__) || defined(__DragonFly__) || defined(__GNU__)
42 #define TESTING_COMMON_UNIX_PLATFORMS 1
43 #else
44 #define TESTING_COMMON_UNIX_PLATFORMS 0
45 #endif
46
47 #define TESTING_VULKAN_DIR "vulkan/"
48
49 #include FRAMEWORK_CONFIG_HEADER
50
51 enum class ManifestCategory { implicit_layer, explicit_layer, icd, settings };
52
53 // Controls whether to create a manifest and where to put it
54 enum class ManifestDiscoveryType {
55 generic, // put the manifest in the regular locations
56 unsecured_generic, // put the manifest in a user folder rather than system
57 none, // Do not write the manifest anywhere (for Direct Driver Loading)
58 null_dir, // put the manifest in the 'null_dir' which the loader does not search in (D3DKMT for instance)
59 env_var, // use the corresponding env-var for it
60 add_env_var, // use the corresponding add-env-var for it
61 override_folder, // add to a special folder for the override layer to use
62 #if defined(_WIN32)
63 windows_app_package, // let the app package search find it
64 #endif
65 #if defined(__APPLE__)
66 macos_bundle, // place it in a location only accessible to macos bundles
67 #endif
68 };
69
70 enum class LibraryPathType {
71 absolute, // default for testing - the exact path of the binary
72 relative, // Relative to the manifest file
73 default_search_paths, // Dont add any path information to the library_path - force the use of the default search paths
74 };
75
76 // Locations that files can go in the test framework
77 enum class ManifestLocation {
78 null,
79 driver,
80 driver_env_var,
81 explicit_layer,
82 explicit_layer_env_var,
83 explicit_layer_add_env_var,
84 implicit_layer,
85 implicit_layer_env_var,
86 implicit_layer_add_env_var,
87 override_layer,
88 #if defined(_WIN32)
89 windows_app_package,
90 #endif
91 #if defined(__APPLE__)
92 macos_bundle,
93 #endif
94 settings_location,
95 unsecured_driver,
96 unsecured_explicit_layer,
97 unsecured_implicit_layer,
98 unsecured_settings,
99 };