framework/replay: recently introduced HTML tags should be in innerHTML
[piglit.git] / tests / util / piglit-framework-cl-custom.h
blobd6b2b38c1575bea02fd1b2c2287afb656ed15eb8
1 /*
2 * Copyright © 2012 Blaž Tomažič <blaz.tomazic@gmail.com>
4 * Permission is hereby granted, free of charge, to any person obtaining a
5 * copy of this software and associated documentation files (the "Software"),
6 * to deal in the Software without restriction, including without limitation
7 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
8 * and/or sell copies of the Software, and to permit persons to whom the
9 * Software is furnished to do so, subject to the following conditions:
11 * The above copyright notice and this permission notice (including the next
12 * paragraph) shall be included in all copies or substantial portions of the
13 * Software.
15 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
18 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
20 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
21 * DEALINGS IN THE SOFTWARE.
24 #pragma once
25 #ifndef PIGLIT_FRAMEWORK_CL_CUSTOM_H
26 #define PIGLIT_FRAMEWORK_CL_CUSTOM_H
28 #include "piglit-framework-cl.h"
31 typedef const struct piglit_cl_custom_test_config
32 piglit_cl_custom_test_config_t;
33 typedef const struct piglit_cl_custom_test_env
34 piglit_cl_custom_test_env_t;
36 /**
37 * \brief Definition of CUSTOM test function.
39 * Every test must implement this function.
41 * @param argc Argument count passed to \c main().
42 * @param argv Argument vector passed to \c main().
43 * @param config Test configuration.
44 * @param env Test environment.
45 * @return Result of test.
47 typedef enum piglit_result
48 piglit_cl_custom_test_t(const int argc,
49 const char** argv,
50 piglit_cl_custom_test_config_t* config,
51 piglit_cl_custom_test_env_t* env);
53 /**
54 * \struct piglit_cl_custom_test_config
56 * \brief Test configuration for CUSTOM tests.
58 PIGLIT_CL_DEFINE_TEST_CONFIG_BEGIN(struct piglit_cl_custom_test_config)
60 piglit_cl_custom_test_t* _custom_test; /**< CUSTOM test function.
61 (internal) */
63 PIGLIT_CL_DEFINE_TEST_CONFIG_END
65 piglit_cl_get_empty_test_config_t piglit_cl_get_empty_custom_test_config;
66 piglit_cl_test_run_t piglit_cl_custom_test_run;
68 /**
69 * \def PIGLIT_CL_CUSTOM_TEST_CONFIG_BEGIN
71 * Extension of \c PIGLIT_CL_TEST_CONFIG_BEGIN macro to be used by
72 * CUSTOM tests.
73 * This macro must be used to create an CUSTOM test configuration
74 * instance and must be followed by \c PIGLIT_CL_TEST_CUSTOM_CONFIG_END macro.
76 * In beetween \c PIGLIT_CL_CUSTOM_TEST_CONFIG_BEGIN and
77 * \c PIGLIT_CL_CUSTOM_TEST_CONFIG_END macros you can set the test
78 * configuration values.
81 /**
82 * \def PIGLIT_CL_CUSTOM_TEST_CONFIG_END
84 * Extension of \c PIGLIT_CL_TEST_CONFIG_END macro to be used by
85 * CUSTOM tests. It defines function prototypes for functions used by
86 * an CUSTOM test.
87 * This macro must be used to create a test configuration instance
88 * and must follow \c PIGLIT_CL_CUSTOM_TEST_CONFIG_BEGIN macro.
91 #define PIGLIT_CL_CUSTOM_TEST_CONFIG_BEGIN \
92 piglit_cl_custom_test_t piglit_cl_test; \
94 PIGLIT_CL_TEST_CONFIG_BEGIN(struct piglit_cl_custom_test_config, \
95 piglit_cl_get_empty_custom_test_config, \
96 piglit_cl_custom_test_run)
98 #define PIGLIT_CL_CUSTOM_TEST_CONFIG_END \
99 config._custom_test = piglit_cl_test; \
101 PIGLIT_CL_TEST_CONFIG_END
104 * \brief Environment for CUSTOM tests.
106 * Defines environment used by CUSTOM tests.
108 struct piglit_cl_custom_test_env {
109 int version; /**< Version of OpenCL to test against.
110 Holds valid version if \c run_per_platform
111 or \c run_per_device is \c true. */
112 cl_platform_id platform_id; /**< OpenCL platform id.
113 Holds valid platform id if
114 \c run_per_platform or \c run_per_device
115 is \c true. */
116 cl_device_id device_id; /**< OpenCL device id.
117 Holds valid device id if \c run_per_device is
118 \c true. */
122 #endif //PIGLIT_FRAMEWORK_CL_CUSTOM_H