1# Copyright (c) 2021 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("//arkcompiler/ets_runtime/js_runtime_config.gni") 15import("//arkcompiler/ets_runtime/test/test_helper.gni") 16 17module_output_path = "ets_runtime" 18 19host_unittest_action("JSHelper_ArrayHelper_Test") { 20 module_out_path = module_output_path 21 22 sources = [ 23 # test file 24 "array_helper_test.cpp", 25 ] 26 27 configs = [ 28 "../../../:ecma_test_config", 29 "../../../:icu_path_test_config", 30 ] 31 32 deps = [ "../../../:libark_jsruntime_test" ] 33 34 # hiviewdfx libraries 35 external_deps = hiviewdfx_ext_deps 36 external_deps += [ 37 "icu:shared_icui18n", 38 "icu:shared_icuuc", 39 "runtime_core:libarkassembler_static", 40 "zlib:libz", 41 42 #sdk_libc_secshared_dep, 43 ] 44 deps += hiviewdfx_deps 45} 46 47host_unittest_action("JSHelper_AtomicHelper_Test") { 48 module_out_path = module_output_path 49 50 sources = [ 51 # test file 52 "atomic_helper_test.cpp", 53 ] 54 55 configs = [ 56 "../../../:ecma_test_config", 57 "../../../:icu_path_test_config", 58 ] 59 60 deps = [ "../../../:libark_jsruntime_test" ] 61 62 # hiviewdfx libraries 63 external_deps = hiviewdfx_ext_deps 64 external_deps += [ 65 "icu:shared_icui18n", 66 "icu:shared_icuuc", 67 "runtime_core:libarkassembler_static", 68 "zlib:libz", 69 70 #sdk_libc_secshared_dep, 71 ] 72 deps += hiviewdfx_deps 73} 74 75host_unittest_action("JSHelper_BitHelper_Test") { 76 module_out_path = module_output_path 77 78 sources = [ 79 # test file 80 "bit_helper_test.cpp", 81 ] 82 83 configs = [ 84 "../../../:ecma_test_config", 85 "../../../:icu_path_test_config", 86 ] 87 88 deps = [ "../../../:libark_jsruntime_test" ] 89 90 # hiviewdfx libraries 91 external_deps = hiviewdfx_ext_deps 92 external_deps += [ 93 "icu:shared_icui18n", 94 "icu:shared_icuuc", 95 "runtime_core:libarkassembler_static", 96 "zlib:libz", 97 98 #sdk_libc_secshared_dep, 99 ] 100 deps += hiviewdfx_deps 101} 102 103host_unittest_action("Builtins_Base_Test") { 104 module_out_path = module_output_path 105 106 sources = [ 107 # test file 108 "builtins_base_test.cpp", 109 ] 110 111 configs = [ 112 "../../../:ecma_test_config", 113 "../../../:icu_path_test_config", 114 ] 115 116 deps = [ "../../../:libark_jsruntime_test" ] 117 118 # hiviewdfx libraries 119 external_deps = hiviewdfx_ext_deps 120 external_deps += [ 121 "icu:shared_icui18n", 122 "icu:shared_icuuc", 123 "runtime_core:libarkassembler_static", 124 "zlib:libz", 125 126 #sdk_libc_secshared_dep, 127 ] 128 deps += hiviewdfx_deps 129} 130 131host_unittest_action("JSHelper_ErrorHelper_Test") { 132 module_out_path = module_output_path 133 134 sources = [ 135 # test file 136 "error_helper_test.cpp", 137 ] 138 139 configs = [ 140 "../../../:ecma_test_config", 141 "../../../:icu_path_test_config", 142 ] 143 144 deps = [ "../../../:libark_jsruntime_test" ] 145 146 # hiviewdfx libraries 147 external_deps = hiviewdfx_ext_deps 148 external_deps += [ 149 "icu:shared_icui18n", 150 "icu:shared_icuuc", 151 "runtime_core:libarkassembler_static", 152 "zlib:libz", 153 154 #sdk_libc_secshared_dep, 155 ] 156 deps += hiviewdfx_deps 157} 158 159host_unittest_action("JS_Ason_Test") { 160 module_out_path = module_output_path 161 162 sources = [ 163 # test file 164 "ason_test.cpp", 165 ] 166 167 configs = [ 168 "../../../:ecma_test_config", 169 "../../../:icu_path_test_config", 170 ] 171 172 deps = [ "../../../:libark_jsruntime_test" ] 173 174 # hiviewdfx libraries 175 external_deps = hiviewdfx_ext_deps 176 external_deps += [ 177 "icu:shared_icui18n", 178 "icu:shared_icuuc", 179 "runtime_core:libarkassembler_static", 180 "zlib:libz", 181 182 #sdk_libc_secshared_dep, 183 ] 184 deps += hiviewdfx_deps 185} 186 187host_unittest_action("JSHelper_FilePathHelper_Test") { 188 module_out_path = module_output_path 189 190 sources = [ 191 # test file 192 "file_path_helper_test.cpp", 193 ] 194 195 configs = [ 196 "../../../:ecma_test_config", 197 "../../../:icu_path_test_config", 198 ] 199 200 deps = [ "../../../:libark_jsruntime_test" ] 201 202 # hiviewdfx libraries 203 external_deps = hiviewdfx_ext_deps 204 external_deps += [ 205 "icu:shared_icui18n", 206 "icu:shared_icuuc", 207 "runtime_core:libarkassembler_static", 208 "zlib:libz", 209 210 #sdk_libc_secshared_dep, 211 ] 212 deps += hiviewdfx_deps 213} 214 215host_unittest_action("GC_RingBuffer_Test") { 216 module_out_path = module_output_path 217 218 sources = [ 219 # test file 220 "gc_ring_buffer_test.cpp", 221 ] 222 223 configs = [ 224 "../../../:ecma_test_config", 225 "../../../:icu_path_test_config", 226 ] 227 228 deps = [ "../../../:libark_jsruntime_test" ] 229 230 # hiviewdfx libraries 231 external_deps = hiviewdfx_ext_deps 232 external_deps += [ 233 "icu:shared_icui18n", 234 "icu:shared_icuuc", 235 "runtime_core:libarkassembler_static", 236 "zlib:libz", 237 238 #sdk_libc_secshared_dep, 239 ] 240 deps += hiviewdfx_deps 241} 242 243host_unittest_action("JS_JsonParser_Test") { 244 module_out_path = module_output_path 245 246 sources = [ 247 # test file 248 "json_parser_test.cpp", 249 ] 250 251 configs = [ 252 "../../../:ecma_test_config", 253 "../../../:icu_path_test_config", 254 ] 255 256 deps = [ "../../../:libark_jsruntime_test" ] 257 258 # hiviewdfx libraries 259 external_deps = hiviewdfx_ext_deps 260 external_deps += [ 261 "icu:shared_icui18n", 262 "icu:shared_icuuc", 263 "runtime_core:libarkassembler_static", 264 "zlib:libz", 265 266 #sdk_libc_secshared_dep, 267 ] 268 deps += hiviewdfx_deps 269} 270 271host_unittest_action("JS_JsonStringIfier_Test") { 272 module_out_path = module_output_path 273 274 sources = [ 275 # test file 276 "json_stringifier_test.cpp", 277 ] 278 279 configs = [ 280 "../../../:ecma_test_config", 281 "../../../:icu_path_test_config", 282 ] 283 284 deps = [ "../../../:libark_jsruntime_test" ] 285 286 # hiviewdfx libraries 287 external_deps = hiviewdfx_ext_deps 288 external_deps += [ 289 "icu:shared_icui18n", 290 "icu:shared_icuuc", 291 "runtime_core:libarkassembler_static", 292 "zlib:libz", 293 294 #sdk_libc_secshared_dep, 295 ] 296 deps += hiviewdfx_deps 297} 298 299host_unittest_action("JSHelper_MathHelper_Test") { 300 module_out_path = module_output_path 301 302 sources = [ 303 # test file 304 "math_helper_test.cpp", 305 ] 306 307 configs = [ 308 "../../../:ecma_test_config", 309 "../../../:icu_path_test_config", 310 ] 311 312 deps = [ "../../../:libark_jsruntime_test" ] 313 314 # hiviewdfx libraries 315 external_deps = hiviewdfx_ext_deps 316 external_deps += [ 317 "icu:shared_icui18n", 318 "icu:shared_icuuc", 319 "runtime_core:libarkassembler_static", 320 "zlib:libz", 321 322 #sdk_libc_secshared_dep, 323 ] 324 deps += hiviewdfx_deps 325} 326 327host_unittest_action("JSHelper_DtoaHelper_Test") { 328 module_out_path = module_output_path 329 330 sources = [ 331 # test file 332 "dtoa_helper_test.cpp", 333 ] 334 335 configs = [ 336 "../../../:ecma_test_config", 337 "../../../:icu_path_test_config", 338 ] 339 340 deps = [ "../../../:libark_jsruntime_test" ] 341 342 # hiviewdfx libraries 343 external_deps = hiviewdfx_ext_deps 344 external_deps += [ 345 "icu:shared_icui18n", 346 "icu:shared_icuuc", 347 "runtime_core:libarkassembler_static", 348 "zlib:libz", 349 350 #sdk_libc_secshared_dep, 351 ] 352 deps += hiviewdfx_deps 353} 354 355host_unittest_action("JSHelper_NumberHelper_Test") { 356 module_out_path = module_output_path 357 if (ark_standalone_build && is_ohos && run_with_qemu) { 358 defines = [ "RUN_WITH_QEMU" ] 359 } 360 sources = [ 361 # test file 362 "number_helper_test.cpp", 363 ] 364 365 configs = [ 366 "../../../:ecma_test_config", 367 "../../../:icu_path_test_config", 368 ] 369 370 deps = [ "../../../:libark_jsruntime_test" ] 371 372 # hiviewdfx libraries 373 external_deps = hiviewdfx_ext_deps 374 external_deps += [ 375 "icu:shared_icui18n", 376 "icu:shared_icuuc", 377 "runtime_core:libarkassembler_static", 378 "zlib:libz", 379 380 #sdk_libc_secshared_dep, 381 ] 382 deps += hiviewdfx_deps 383} 384 385host_unittest_action("JSHelper_StringHelper_Test") { 386 module_out_path = module_output_path 387 388 sources = [ 389 # test file 390 "string_helper_test.cpp", 391 ] 392 393 configs = [ 394 "../../../:ecma_test_config", 395 "../../../:icu_path_test_config", 396 ] 397 398 deps = [ "../../../:libark_jsruntime_test" ] 399 400 # hiviewdfx libraries 401 external_deps = hiviewdfx_ext_deps 402 external_deps += [ 403 "icu:shared_icui18n", 404 "icu:shared_icuuc", 405 "runtime_core:libarkassembler_static", 406 "zlib:libz", 407 408 #sdk_libc_secshared_dep, 409 ] 410 deps += hiviewdfx_deps 411} 412 413host_unittest_action("JSHelper_TypeArrayHelper_Test") { 414 module_out_path = module_output_path 415 416 sources = [ 417 # test file 418 "typed_array_helper_test.cpp", 419 ] 420 421 configs = [ 422 "../../../:ecma_test_config", 423 "../../../:icu_path_test_config", 424 ] 425 426 deps = [ "../../../:libark_jsruntime_test" ] 427 428 # hiviewdfx libraries 429 external_deps = hiviewdfx_ext_deps 430 external_deps += [ 431 "icu:shared_icui18n", 432 "icu:shared_icuuc", 433 "runtime_core:libarkassembler_static", 434 "zlib:libz", 435 436 #sdk_libc_secshared_dep, 437 ] 438 deps += hiviewdfx_deps 439} 440 441host_unittest_action("JSHelper_UtfHelper_Test") { 442 module_out_path = module_output_path 443 444 sources = [ 445 # test file 446 "utf_helper_test.cpp", 447 ] 448 449 configs = [ 450 "../../../:ecma_test_config", 451 "../../../:icu_path_test_config", 452 ] 453 454 deps = [ "../../../:libark_jsruntime_test" ] 455 456 # hiviewdfx libraries 457 external_deps = hiviewdfx_ext_deps 458 external_deps += [ 459 "icu:shared_icui18n", 460 "icu:shared_icuuc", 461 "runtime_core:libarkassembler_static", 462 "zlib:libz", 463 464 #sdk_libc_secshared_dep, 465 ] 466 deps += hiviewdfx_deps 467} 468 469host_unittest_action("JSHelper_JsonHelper_Test") { 470 module_out_path = module_output_path 471 472 sources = [ 473 # test file 474 "json_helper_test.cpp", 475 ] 476 477 configs = [ 478 "../../../:ecma_test_config", 479 "../../../:icu_path_test_config", 480 ] 481 482 deps = [ "../../../:libark_jsruntime_test" ] 483 484 # hiviewdfx libraries 485 external_deps = hiviewdfx_ext_deps 486 external_deps += [ 487 "icu:shared_icui18n", 488 "icu:shared_icuuc", 489 "runtime_core:libarkassembler_static", 490 "zlib:libz", 491 492 #sdk_libc_secshared_dep, 493 ] 494 deps += hiviewdfx_deps 495} 496 497group("unittest") { 498 testonly = true 499 500 # deps file 501 deps = [ 502 ":Builtins_Base_Test", 503 ":GC_RingBuffer_Test", 504 ":JSHelper_ArrayHelper_Test", 505 ":JSHelper_AtomicHelper_Test", 506 ":JSHelper_BitHelper_Test", 507 ":JSHelper_DtoaHelper_Test", 508 ":JSHelper_ErrorHelper_Test", 509 ":JSHelper_FilePathHelper_Test", 510 ":JSHelper_JsonHelper_Test", 511 ":JSHelper_MathHelper_Test", 512 ":JSHelper_NumberHelper_Test", 513 ":JSHelper_StringHelper_Test", 514 ":JSHelper_TypeArrayHelper_Test", 515 ":JSHelper_UtfHelper_Test", 516 ":JS_Ason_Test", 517 ":JS_JsonParser_Test", 518 ":JS_JsonStringIfier_Test", 519 ] 520} 521 522group("host_unittest") { 523 testonly = true 524 525 # deps file 526 deps = [ 527 ":Builtins_Base_TestAction", 528 ":GC_RingBuffer_TestAction", 529 ":JSHelper_ArrayHelper_TestAction", 530 ":JSHelper_AtomicHelper_TestAction", 531 ":JSHelper_BitHelper_TestAction", 532 ":JSHelper_DtoaHelper_TestAction", 533 ":JSHelper_ErrorHelper_TestAction", 534 ":JSHelper_FilePathHelper_TestAction", 535 ":JSHelper_JsonHelper_TestAction", 536 ":JSHelper_MathHelper_TestAction", 537 ":JSHelper_NumberHelper_TestAction", 538 ":JSHelper_StringHelper_TestAction", 539 ":JSHelper_TypeArrayHelper_TestAction", 540 ":JSHelper_UtfHelper_TestAction", 541 ":JS_Ason_TestAction", 542 ":JS_JsonParser_TestAction", 543 ":JS_JsonStringIfier_TestAction", 544 ] 545 if (is_mac) { 546 deps -= [ 547 ":Builtins_Base_TestAction", 548 ":GC_RingBuffer_TestAction", 549 ":JSHelper_ArrayHelper_TestAction", 550 ":JSHelper_AtomicHelper_TestAction", 551 ":JSHelper_BitHelper_TestAction", 552 ":JSHelper_DtoaHelper_TestAction", 553 ":JSHelper_ErrorHelper_TestAction", 554 ":JSHelper_FilePathHelper_TestAction", 555 ":JSHelper_JsonHelper_TestAction", 556 ":JSHelper_MathHelper_TestAction", 557 ":JSHelper_NumberHelper_TestAction", 558 ":JSHelper_StringHelper_TestAction", 559 ":JSHelper_TypeArrayHelper_TestAction", 560 ":JSHelper_UtfHelper_TestAction", 561 ":JS_Ason_TestAction", 562 ":JS_JsonParser_TestAction", 563 ":JS_JsonStringIfier_TestAction", 564 ] 565 } 566} 567