1# Copyright (c) 2024 Huawei Device Co., Ltd. 2# Licensed under the Apache License, Version 2.0 (the "License"); 3# you may not use this file except in compliance with the License. 4# You may obtain a copy of the License at 5# 6# http://www.apache.org/licenses/LICENSE-2.0 7# 8# Unless required by applicable law or agreed to in writing, software 9# distributed under the License is distributed on an "AS IS" BASIS, 10# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11# See the License for the specific language governing permissions and 12# limitations under the License. 13 14import("//build/config/features.gni") 15import("//build/test.gni") 16import("//build/ohos.gni") 17import("//foundation/graphic/graphic_3d/lume/lume_config.gni") 18 19module_output_path = "graphic_3d/graphic_3d/lume/LumeMeta" 20 21config("lume3d_config") { 22 visibility = [ ":*" ] 23 24 include_dirs = [ 25 "${LUME_BASE_PATH}/api", 26 "${LUME_CORE_PATH}/api", 27 "${LUME_RENDER_PATH}/api", 28 "${LUME_CORE3D_PATH}/api", 29 "${LUME_META_PATH}/include", 30 "${LUME_SCENE_PATH}/include", 31 ] 32 33 if (current_os == "ohos") { 34 include_dirs += [ "${LUME_CORE_PATH}/api/platform/ohos" ] 35 } 36 37 configs = [] 38 39 cflags = [ 40 "-Wall", 41 "-fexceptions", 42 "-Wno-sign-compare", 43 "-Wno-unused-variable", 44 "-Wno-unused-private-field", 45 "-Wno-implicit-fallthrough", 46 "-Wno-reorder", 47 "-Wno-unused-function", 48 "-Wno-tautological-unsigned-zero-compare", 49 "-Wno-ignored-qualifiers", 50 "-Wno-unused-lambda-capture", 51 "-Wno-unused-but-set-variable", 52 53 "-DCORE_PUBLIC=__attribute__((visibility(\"default\")))", 54 "-DCORE_BUILD_2D = 0", 55 "-DCORE_BUILD_VULKAN=0", 56 "-DCORE_BUILD_GL=0", 57 "-DCORE_BUILD_GLES=1", 58 "-DCORE_DEV_ENABLED=0", 59 "-DCORE_TESTS_ENABLED=0", 60 "-DCORE_GL_DEBUG=0", 61 "-DCORE_VALIDATION_ENABLED = 0", 62 "-DCORE_VULKAN_VALIDATION_ENABLED = 0", 63 "-DCORE_EMBEDDED_ASSETS_ENABLED = 2", 64 "-DCORE_ENABLE_GPU_QUERIES=0", 65 "-DCORE_DEBUG_GPU_RESOURCE_IDS = 0", 66 "-DCORE_DEBUG_COMMAND_MARKERS_ENABLED = 0", 67 "-DCORE_DEBUG_MARKERS_ENABLED = 0", 68 "-DRENDER_HAS_GL_BACKEND=0", 69 "-DRENDER_HAS_GLES_BACKEND = 1", 70 "-DRENDER_HAS_VULKAN_BACKEND = 1", 71 "-DVK_USE_PLATFORM_ANDROID_KHR = 1", 72 "-DCORE_LOG_NO_DEBUG=0", 73 "-DCORE_LOG_TO_DEBUG_OUTPUT=1", 74 "-DCORE_LOG_TO_CONSOLE", 75 "-DCORE_DYNAMIC=1", 76 ] 77} 78 79ohos_unittest("lume_meta_test") { 80 module_out_path = module_output_path 81 resource_config_file = "//foundation/graphic/graphic_3d/test/resource/ohos_test.xml" 82 83 include_dirs = [ 84 "${LUME_BASE_PATH}/api", 85 "${LUME_CORE_PATH}/api", 86 "${LUME_RENDER_PATH}/api", 87 "${LUME_CORE3D_PATH}/api", 88 "${LUME_CORE3D_PATH}/src", 89 "${LUME_CORE_PATH}/src", 90 "${LUME_META_PATH}/include", 91 "${LUME_SCENE_PATH}/include", 92 "${LUME_CORE_PATH}/api/platform/ohos", 93 "${LUME_CORE_PATH}/ecshelper", 94 "${LUME_ROOT}/../3d_widget_adapter/core/include", 95 "${LUME_ROOT}/../3d_scene_adapter/core/include", 96 "//foundation/graphic/graphic_3d/lume/LumeMeta/test/", 97 ] 98 99 configs = [ 100 ":lume3d_config", 101 "${LUME_ROOT}/../3d_widget_adapter:widget_adapter_config", 102 "${LUME_ROOT}/../3d_scene_adapter:scene_adapter_config", 103 "${LUME_CORE_PATH}:lume_component_help_config", 104 ] 105 106 cflags = [ 107 "-g", 108 "-O0", 109 "-Wno-unused-variable", 110 "-fno-omit-frame-pointer", 111 "-Dprivate=public", 112 "-Dprotected=public" 113 ] 114 115 cflags_cc = [ 116 "-g", 117 "-O0", 118 "-Wno-unused-variable", 119 "-fno-omit-frame-pointer", 120 "-Dprivate=public", 121 "-Dprotected=public", 122 "-Wno-missing-braces", 123 "-Wno-unused-local-typedef", 124 "-Wtautological-pointer-compare" 125 ] 126 127 sources = [ 128 "helpers/animation_test_base.cpp", 129 "helpers/animation_test_base.h", 130 "helpers/serialisation_utils.cpp", 131 "helpers/serialisation_utils.h", 132 "helpers/test_data_helpers.h", 133 "helpers/testing_macros.h", 134 "helpers/test_utils.cpp", 135 "helpers/test_utils.h", 136 "helpers/testing_objects.cpp", 137 "helpers/testing_objects.h", 138 "helpers/util.h", 139 "src/api/property/ArrayPropertyEventHandlerTest.cpp", 140 "src/api/property/CustomValueTest.cpp", 141 "src/api/property/PropertyInfoTest.cpp", 142 "src/api/BitfieldPropertyTest.cpp", 143 "src/api/CompatibleValueUtilTest.cpp", 144 "src/api/DeferredCallbackTest.cpp", 145 "src/api/FunctionTest.cpp", 146 "src/api/MutexTest.cpp", 147 "src/api/NumberTest.cpp", 148 "src/api/ObjectTest.cpp", 149 # "src/api/ObjectApiTest.cpp", 150 "src/api/TimerTest.cpp", 151 "src/base/BaseObjectTest.cpp", 152 "src/base/CaptureBindTest.cpp", 153 "src/base/IdTests.cpp", 154 "src/base/TimeSpan.cpp", 155 "src/base/VersionTest.cpp", 156 "src/ext/InterfaceHelperTest.cpp", 157 "src/interface/animation/AnimationControllerTest.cpp", 158 "src/interface/animation/AnimationSeekingTest.cpp", 159 "src/interface/animation/AnimationTest.cpp", 160 "src/interface/animation/BezierCurveTest.cpp", 161 "src/interface/animation/StaggeredAnimationTest.cpp", 162 "src/interface/loaders/CsvLoaderTest.cpp", 163 "src/interface/model/DataModelTest.cpp", 164 "src/interface/model/InstantiatingObjectProviderTest.cpp", 165 "src/interface/property/ArrayPropertyTest.cpp", 166 "src/interface/property/ModifierTest.cpp", 167 "src/interface/property/PropertyTest.cpp", 168 "TestRunner.cpp", 169 ] 170 171 defines = [ 172 "CORE_HAS_GLES_BACKEND=1", 173 "CORE_HAS_VULKAN_BACKEND=1", 174 ] 175 176 deps = [ 177 "//foundation/graphic/graphic_3d/3d_widget_adapter:lib3dWidgetAdapter", 178 "//foundation/graphic/graphic_3d/lume/LumeMeta:libPluginMetaObject", 179 ] 180 181 external_deps = [ 182 "napi:ace_napi", 183 "graphic_2d:EGL", 184 "graphic_2d:GLESv3", 185 "c_utils:utils", 186 "graphic_2d:librender_service_client", 187 "graphic_surface:surface", 188 "hilog:libhilog", 189 "hitrace:hitrace_meter", 190 "init:libbegetutil", 191 "ability_runtime:ability_context_native", 192 "ability_runtime:app_context", 193 "ability_runtime:data_ability_helper", 194 "ability_runtime:ability_manager", 195 "ability_runtime:napi_base_context", 196 "ability_runtime:napi_common", 197 "bundle_framework:appexecfwk_base", 198 "bundle_framework:appexecfwk_core", 199 "googletest:gmock", 200 "googletest:gtest" 201 ] 202 203 part_name = "graphic_3d" 204 subsystem_name = "graphic" 205} 206 207ohos_unittest("lume_meta_test_1") { 208 module_out_path = module_output_path 209 210 include_dirs = [ 211 "${LUME_BASE_PATH}/api", 212 "${LUME_CORE_PATH}/api", 213 "${LUME_RENDER_PATH}/api", 214 "${LUME_CORE3D_PATH}/api", 215 "${LUME_CORE3D_PATH}/src", 216 "${LUME_CORE_PATH}/src", 217 "${LUME_META_PATH}/include", 218 "${LUME_SCENE_PATH}/include", 219 "${LUME_CORE_PATH}/api/platform/ohos", 220 "${LUME_CORE_PATH}/ecshelper", 221 "${LUME_ROOT}/../3d_widget_adapter/core/include", 222 "${LUME_ROOT}/../3d_scene_adapter/core/include", 223 "//foundation/graphic/graphic_3d/lume/LumeMeta/test/", 224 ] 225 226 configs = [ 227 ":lume3d_config", 228 "${LUME_ROOT}/../3d_widget_adapter:widget_adapter_config", 229 "${LUME_ROOT}/../3d_scene_adapter:scene_adapter_config", 230 "${LUME_CORE_PATH}:lume_component_help_config", 231 ] 232 233 cflags = [ 234 "-g", 235 "-O0", 236 "-Wno-unused-variable", 237 "-fno-omit-frame-pointer", 238 "-Dprivate=public", 239 "-Dprotected=public" 240 ] 241 242 cflags_cc = [ 243 "-g", 244 "-O0", 245 "-Wno-unused-variable", 246 "-fno-omit-frame-pointer", 247 "-Dprivate=public", 248 "-Dprotected=public", 249 "-Wno-missing-braces", 250 "-Wno-unused-local-typedef", 251 "-Wtautological-pointer-compare" 252 ] 253 254 sources = [ 255 "helpers/animation_test_base.cpp", 256 "helpers/animation_test_base.h", 257 "helpers/serialisation_utils.cpp", 258 "helpers/serialisation_utils.h", 259 "helpers/test_data_helpers.h", 260 "helpers/testing_macros.h", 261 "helpers/test_utils.cpp", 262 "helpers/test_utils.h", 263 "helpers/testing_objects.cpp", 264 "helpers/testing_objects.h", 265 "helpers/util.h", 266 "src/interface/animation/SequentialAnimationTest.cpp", 267 "src/interface/animation/SpeedAnimationModifierTest.cpp", 268 "TestRunner.cpp", 269 ] 270 271 defines = [ 272 "CORE_HAS_GLES_BACKEND=1", 273 "CORE_HAS_VULKAN_BACKEND=1", 274 ] 275 276 deps = [ 277 "//foundation/graphic/graphic_3d/3d_widget_adapter:lib3dWidgetAdapter", 278 "//foundation/graphic/graphic_3d/lume/LumeMeta:libPluginMetaObject", 279 ] 280 281 external_deps = [ 282 "napi:ace_napi", 283 "graphic_2d:EGL", 284 "graphic_2d:GLESv3", 285 "c_utils:utils", 286 "graphic_2d:librender_service_client", 287 "graphic_surface:surface", 288 "hilog:libhilog", 289 "hitrace:hitrace_meter", 290 "init:libbegetutil", 291 "ability_runtime:ability_context_native", 292 "ability_runtime:app_context", 293 "ability_runtime:data_ability_helper", 294 "ability_runtime:ability_manager", 295 "ability_runtime:napi_base_context", 296 "ability_runtime:napi_common", 297 "bundle_framework:appexecfwk_base", 298 "bundle_framework:appexecfwk_core", 299 "googletest:gmock", 300 "googletest:gtest" 301 ] 302 303 part_name = "graphic_3d" 304 subsystem_name = "graphic" 305} 306 307group("unittest") { 308 testonly = true 309 deps = [] 310 deps += [ 311 # deps file 312 ":lume_meta_test", 313 ":lume_meta_test_1" 314 ] 315}