1 //
2 // Copyright (c) 2017 The Khronos Group Inc.
3 //
4 // Licensed under the Apache License, Version 2.0 (the "License");
5 // you may not use this file except in compliance with the License.
6 // You may obtain a copy of the License at
7 //
8 // http://www.apache.org/licenses/LICENSE-2.0
9 //
10 // Unless required by applicable law or agreed to in writing, software
11 // distributed under the License is distributed on an "AS IS" BASIS,
12 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 // See the License for the specific language governing permissions and
14 // limitations under the License.
15 //
16 #include "harness/compat.h"
17
18 #include "harness/testHarness.h"
19 #include "procs.h"
20 #include <stdio.h>
21 #include <string.h>
22
23 #if !defined(_WIN32)
24 #include <unistd.h>
25 #endif
26
27 test_definition test_list[] = {
28 ADD_TEST(load_program_source),
29 ADD_TEST(load_multistring_source),
30 ADD_TEST(load_two_kernel_source),
31 ADD_TEST(load_null_terminated_source),
32 ADD_TEST(load_null_terminated_multi_line_source),
33 ADD_TEST(load_null_terminated_partial_multi_line_source),
34 ADD_TEST(load_discreet_length_source),
35 ADD_TEST(get_program_source),
36 ADD_TEST(get_program_build_info),
37 ADD_TEST(get_program_info),
38
39 ADD_TEST(large_compile),
40 ADD_TEST(async_build),
41
42 ADD_TEST(options_build_optimizations),
43 ADD_TEST(options_build_macro),
44 ADD_TEST(options_build_macro_existence),
45 ADD_TEST(options_include_directory),
46 ADD_TEST(options_denorm_cache),
47
48 ADD_TEST(preprocessor_define_udef),
49 ADD_TEST(preprocessor_include),
50 ADD_TEST(preprocessor_line_error),
51 ADD_TEST(preprocessor_pragma),
52
53 ADD_TEST(opencl_c_versions),
54 ADD_TEST(compiler_defines_for_extensions),
55 ADD_TEST(image_macro),
56
57 ADD_TEST(simple_compile_only),
58 ADD_TEST(simple_static_compile_only),
59 ADD_TEST(simple_extern_compile_only),
60 ADD_TEST(simple_compile_with_callback),
61 ADD_TEST(simple_embedded_header_compile),
62 ADD_TEST(simple_link_only),
63 ADD_TEST(two_file_regular_variable_access),
64 ADD_TEST(two_file_regular_struct_access),
65 ADD_TEST(two_file_regular_function_access),
66 ADD_TEST(simple_link_with_callback),
67 ADD_TEST(simple_embedded_header_link),
68 ADD_TEST(execute_after_simple_compile_and_link),
69 ADD_TEST(execute_after_simple_compile_and_link_no_device_info),
70 ADD_TEST(execute_after_simple_compile_and_link_with_defines),
71 ADD_TEST(execute_after_simple_compile_and_link_with_callbacks),
72 ADD_TEST(execute_after_simple_library_with_link),
73 ADD_TEST(execute_after_two_file_link),
74 ADD_TEST(execute_after_embedded_header_link),
75 ADD_TEST(execute_after_included_header_link),
76 ADD_TEST(execute_after_serialize_reload_object),
77 ADD_TEST(execute_after_serialize_reload_library),
78 ADD_TEST(simple_library_only),
79 ADD_TEST(simple_library_with_callback),
80 ADD_TEST(simple_library_with_link),
81 ADD_TEST(two_file_link),
82 ADD_TEST(multi_file_libraries),
83 ADD_TEST(multiple_files),
84 ADD_TEST(multiple_libraries),
85 ADD_TEST(multiple_files_multiple_libraries),
86 ADD_TEST(multiple_embedded_headers),
87
88 ADD_TEST(program_binary_type),
89 ADD_TEST(compile_and_link_status_options_log),
90
91 ADD_TEST_VERSION(pragma_unroll, Version(2, 0)),
92
93 ADD_TEST_VERSION(features_macro, Version(3, 0)),
94 ADD_TEST(unload_valid),
95 // ADD_TEST(unload_invalid), // disabling temporarily, see GitHub #977
96 ADD_TEST(unload_repeated),
97 ADD_TEST(unload_compile_unload_link),
98 ADD_TEST(unload_build_unload_create_kernel),
99 ADD_TEST(unload_link_different),
100 ADD_TEST(unload_build_threaded),
101 ADD_TEST(unload_build_info),
102 ADD_TEST(unload_program_binaries),
103
104 };
105
106 const int test_num = ARRAY_SIZE(test_list);
107
main(int argc,const char * argv[])108 int main(int argc, const char *argv[])
109 {
110 return runTestHarness(argc, argv, test_num, test_list, false, 0);
111 }
112