From dec3329c8b28154fd25eb07f8d61c609b22c70d5 Mon Sep 17 00:00:00 2001 From: hu0475 Date: Wed, 12 Jul 2023 19:48:16 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=A3=80=E8=A7=86=E6=84=8F?= =?UTF-8?q?=E8=A7=81=E5=92=8Cgn=E6=A0=BC=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: hu0475 --- commonlibrary/BUILD.gn | 2 +- commonlibrary/crossplatform/BUILD.gn | 4 +--- .../commonlibraryTreeMapetstest/BUILD.gn | 18 +++++++++++++++++- .../commonlibraryTreeMapetstest/Test.json | 9 +-------- .../src/main/ets/TestAbility/TestAbility.ets | 14 ++++++++++++++ .../src/main/ets/TestAbility/pages/Index.ets | 14 ++++++++++++++ .../src/main/ets/test/List.test.ets | 14 ++++++++++++++ 7 files changed, 62 insertions(+), 13 deletions(-) diff --git a/commonlibrary/BUILD.gn b/commonlibrary/BUILD.gn index 2109ccf67..ff1e721a0 100644 --- a/commonlibrary/BUILD.gn +++ b/commonlibrary/BUILD.gn @@ -1,4 +1,4 @@ -# Copyright (C) 2022 Huawei Device Co., Ltd. +# 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 diff --git a/commonlibrary/crossplatform/BUILD.gn b/commonlibrary/crossplatform/BUILD.gn index fc4b351c8..492d23109 100644 --- a/commonlibrary/crossplatform/BUILD.gn +++ b/commonlibrary/crossplatform/BUILD.gn @@ -15,8 +15,6 @@ import("//test/xts/tools/build/suite.gni") group("crossplatform") { testonly = true if (is_standard_system) { - deps = [ - "commonlibraryTreeMapetstest:TreeMap_ets_test", - ] + deps = [ "commonlibraryTreeMapetstest:TreeMap_ets_test" ] } } diff --git a/commonlibrary/crossplatform/commonlibraryTreeMapetstest/BUILD.gn b/commonlibrary/crossplatform/commonlibraryTreeMapetstest/BUILD.gn index d54ce1111..26668df1b 100644 --- a/commonlibrary/crossplatform/commonlibraryTreeMapetstest/BUILD.gn +++ b/commonlibrary/crossplatform/commonlibraryTreeMapetstest/BUILD.gn @@ -1,3 +1,15 @@ +# 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("//test/xts/tools/build/suite.gni") ohos_js_hap_suite("TreeMap_ets_test") { @@ -8,6 +20,7 @@ ohos_js_hap_suite("TreeMap_ets_test") { ] ets2abc = true certificate_profile = "./signature/openharmony_sx.p7b" + # hap_name: HAP的名字,可选,默认为目标名 hap_name = "TreeMap_ets_test" subsystem_name = "commonlibrary" @@ -16,6 +29,7 @@ ohos_js_hap_suite("TreeMap_ets_test") { ohos_app_scope("windowStage_app_profile") { # app_profile: HAP的AppScope中的app.json,只在Stage模型下使用 app_profile = "AppScope/app.json" + # sources: 资源文件路径 sources = [ "AppScope/resources" ] } @@ -26,8 +40,10 @@ ohos_js_assets("windowStage_js_assets") { ohos_resources("windowStage_resources") { # sources: 资源文件路径 sources = [ "src/main/resources" ] + # deps: 当前目标的依赖 deps = [ ":windowStage_app_profile" ] + # hap_profile: HAP的config.json,Stage模型对应module.json hap_profile = "src/main/module.json" -} \ No newline at end of file +} diff --git a/commonlibrary/crossplatform/commonlibraryTreeMapetstest/Test.json b/commonlibrary/crossplatform/commonlibraryTreeMapetstest/Test.json index 561a43d42..879a5e5db 100644 --- a/commonlibrary/crossplatform/commonlibraryTreeMapetstest/Test.json +++ b/commonlibrary/crossplatform/commonlibraryTreeMapetstest/Test.json @@ -1,20 +1,13 @@ { "description": "Configuration for hjunit demo Tests", - // 指定设备执行的驱动 "driver": { "type": "OHJSUnitTest", - //test-timeout: 测试hap 整体执行用例的执行时长 "test-timeout": "60000", - //shell-timeout: aa test 拉起命令执行时长 "shell-timeout": "60000", - //bundle-name: 与HAP的app.json 中 bundleName 保持一致 "bundle-name": "ohos.acts.commonlibrary.crossplatform.TreeMap.normal", - //module-name: 与HAP的module.json 中"module"字段的 name 保持一致 "module-name": "entry_test" - //testcase-timeout: 测试hap 单条用例的执行时长 - //"testcase-timeout": 5000 }, - // kit的作用主要是为了支撑测试执行活动,在测试前执行预制操作(Setup),在测试后执行清理操作(Teardown) + "kits": [ { "test-file-name": [ diff --git a/commonlibrary/crossplatform/commonlibraryTreeMapetstest/src/main/ets/TestAbility/TestAbility.ets b/commonlibrary/crossplatform/commonlibraryTreeMapetstest/src/main/ets/TestAbility/TestAbility.ets index 2d889f4fd..368aef919 100644 --- a/commonlibrary/crossplatform/commonlibraryTreeMapetstest/src/main/ets/TestAbility/TestAbility.ets +++ b/commonlibrary/crossplatform/commonlibraryTreeMapetstest/src/main/ets/TestAbility/TestAbility.ets @@ -1,3 +1,17 @@ +/* + * 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 UIAbility from '@ohos.app.ability.UIAbility'; import AbilityDelegatorRegistry from '@ohos.app.ability.abilityDelegatorRegistry'; import hilog from '@ohos.hilog'; diff --git a/commonlibrary/crossplatform/commonlibraryTreeMapetstest/src/main/ets/TestAbility/pages/Index.ets b/commonlibrary/crossplatform/commonlibraryTreeMapetstest/src/main/ets/TestAbility/pages/Index.ets index 166366593..e95640899 100644 --- a/commonlibrary/crossplatform/commonlibraryTreeMapetstest/src/main/ets/TestAbility/pages/Index.ets +++ b/commonlibrary/crossplatform/commonlibraryTreeMapetstest/src/main/ets/TestAbility/pages/Index.ets @@ -1,3 +1,17 @@ +/* + * 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 hilog from '@ohos.hilog'; @Entry diff --git a/commonlibrary/crossplatform/commonlibraryTreeMapetstest/src/main/ets/test/List.test.ets b/commonlibrary/crossplatform/commonlibraryTreeMapetstest/src/main/ets/test/List.test.ets index 1b02130a3..5a7752173 100644 --- a/commonlibrary/crossplatform/commonlibraryTreeMapetstest/src/main/ets/test/List.test.ets +++ b/commonlibrary/crossplatform/commonlibraryTreeMapetstest/src/main/ets/test/List.test.ets @@ -1,3 +1,17 @@ +/* + * 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 TreeMapTest from './TreeMap.test' export default function testsuite() { -- GitLab