# Copyright (c) 2023 Huawei Device Co., Ltd. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. import("//arkcompiler/ets_frontend/es2panda/es2abc_config.gni") import("//arkcompiler/runtime_core/ark_config.gni") import("$ark_root/tests/test_helper.gni") verifier_test_configs = [ "$ark_root:ark_config", "$ark_root/libpandabase:arkbase_public_config", "$ark_root/libpandafile:arkfile_public_config", sdk_libc_secshared_config, ] verifier_test_deps = [ "$ark_root/libpandabase:libarkbase_static", "$ark_root/libpandafile:libarkfile_static", "$ark_root/verifier:libarkverifier", ] verifier_test_js_files = [ "test_checksum", "test_constant_pool", "test_register_index", "test_constant_pool_content", ] verifier_test_ts_files = [ "test_literal_array" ] test_js_path = "//arkcompiler/runtime_core/verifier/tests/js/" test_ts_path = "//arkcompiler/runtime_core/verifier/tests/ts/" foreach(file, verifier_test_js_files) { es2abc_gen_abc("gen_${file}_abc") { test_js = "${test_js_path}${file}.js" test_abc = "$target_out_dir/${file}.abc" src_js = rebase_path(test_js) dst_file = rebase_path(test_abc) in_puts = [ test_js ] out_puts = [ test_abc ] } } foreach(file, verifier_test_ts_files) { es2abc_gen_abc("gen_${file}_abc") { test_ts = "${test_ts_path}${file}.ts" test_abc = "$target_out_dir/${file}.abc" src_js = rebase_path(test_ts) dst_file = rebase_path(test_abc) in_puts = [ test_ts ] out_puts = [ test_abc ] } } host_unittest_action("VerifierTest") { module_out_path = module_output_path sources = [ "utils.cpp", "verify_checksum_test.cpp", "verify_constant_pool_tests.cpp", "verify_register_index_test.cpp", ] include_dirs = [ "$ark_root/verifier" ] configs = verifier_test_configs deps = verifier_test_deps test_abc_dir = rebase_path(target_out_dir) defines = [ "GRAPH_TEST_ABC_DIR=\"${test_abc_dir}/\"" ] foreach(file, verifier_test_js_files) { deps += [ ":gen_${file}_abc" ] } foreach(file, verifier_test_ts_files) { deps += [ ":gen_${file}_abc" ] } } group("host_unittest") { testonly = true deps = [ ":VerifierTestAction" ] }