Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Xts Acts
提交
2bb74c84
X
Xts Acts
项目概览
OpenHarmony
/
Xts Acts
1 年多 前同步成功
通知
9
Star
22
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
X
Xts Acts
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
2bb74c84
编写于
4月 18, 2023
作者:
C
chengxingzhen
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
xts-ams支持release版本调试调优-修改格式
Signed-off-by:
N
chengxingzhen
<
chengxingzhen@huawei.com
>
上级
61870610
变更
5
显示空白变更内容
内联
并排
Showing
5 changed file
with
160 addition
and
162 deletion
+160
-162
ability/ability_runtime/stage/actsdebuggabletest/actsdebuggabletest/entry/src/main/ets/TestRunner/OpenHarmonyTestRunner.ts
...st/entry/src/main/ets/TestRunner/OpenHarmonyTestRunner.ts
+53
-53
ability/ability_runtime/stage/actsdebuggabletest/actsdebuggabletest/entry/src/main/ets/entryability/EntryAbility.ts
...gabletest/entry/src/main/ets/entryability/EntryAbility.ts
+39
-39
ability/ability_runtime/stage/actsdebuggabletest/actsdebuggabletest/entry/src/main/ets/pages/Index.ets
...est/actsdebuggabletest/entry/src/main/ets/pages/Index.ets
+0
-2
ability/ability_runtime/stage/actsdebuggabletest/actsdebuggabletest/entry/src/main/ets/testability/TestAbility.ets
...ggabletest/entry/src/main/ets/testability/TestAbility.ets
+43
-43
ability/ability_runtime/stage/actsdebuggabletest/actsdebuggabletest/entry/src/main/ets/testability/pages/Index.ets
...ggabletest/entry/src/main/ets/testability/pages/Index.ets
+25
-25
未找到文件。
ability/ability_runtime/stage/actsdebuggabletest/actsdebuggabletest/entry/src/main/ets/TestRunner/OpenHarmonyTestRunner.ts
浏览文件 @
2bb74c84
...
...
@@ -14,11 +14,11 @@
*/
import
hilog
from
'
@ohos.hilog
'
;
import
TestRunner
from
'
@ohos.application.testRunner
'
import
AbilityDelegatorRegistry
from
'
@ohos.app.ability.abilityDelegatorRegistry
'
import
TestRunner
from
'
@ohos.application.testRunner
'
;
import
AbilityDelegatorRegistry
from
'
@ohos.app.ability.abilityDelegatorRegistry
'
;
var
abilityDelegator
=
undefined
var
abilityDelegatorArguments
=
undefined
let
abilityDelegator
=
undefined
;
let
abilityDelegatorArguments
=
undefined
;
function
translateParamsToString
(
parameters
)
{
const
keySet
=
new
Set
([
...
...
@@ -29,10 +29,10 @@ function translateParamsToString(parameters) {
let
targetParams
=
''
;
for
(
const
key
in
parameters
)
{
if
(
keySet
.
has
(
key
))
{
targetParams
=
`
${
targetParams
}
${
key
}
${
parameters
[
key
]}
`
targetParams
=
`
${
targetParams
}
${
key
}
${
parameters
[
key
]}
`
;
}
}
return
targetParams
.
trim
()
return
targetParams
.
trim
();
}
async
function
onAbilityCreateCallback
()
{
...
...
@@ -57,20 +57,20 @@ export default class OpenHarmonyTestRunner implements TestRunner {
async
onRun
()
{
hilog
.
isLoggable
(
0x0000
,
'
testTag
'
,
hilog
.
LogLevel
.
INFO
);
hilog
.
info
(
0x0000
,
'
testTag
'
,
'
%{public}s
'
,
'
OpenHarmonyTestRunner onRun run
'
);
abilityDelegatorArguments
=
AbilityDelegatorRegistry
.
getArguments
()
abilityDelegator
=
AbilityDelegatorRegistry
.
getAbilityDelegator
()
var
testAbilityName
=
abilityDelegatorArguments
.
bundleName
+
'
.TestAbility
'
abilityDelegatorArguments
=
AbilityDelegatorRegistry
.
getArguments
();
abilityDelegator
=
AbilityDelegatorRegistry
.
getAbilityDelegator
();
let
testAbilityName
=
abilityDelegatorArguments
.
bundleName
+
'
.TestAbility
'
;
let
lMonitor
=
{
abilityName
:
testAbilityName
,
onAbilityCreate
:
onAbilityCreateCallback
,
};
abilityDelegator
.
addAbilityMonitor
(
lMonitor
,
addAbilityMonitorCallback
)
var
cmd
=
'
aa start -d 0 -a TestAbility
'
+
'
-b
'
+
abilityDelegatorArguments
.
bundleName
cmd
+=
'
'
+
translateParamsToString
(
abilityDelegatorArguments
.
parameters
)
var
debug
=
abilityDelegatorArguments
.
parameters
[
'
-D
'
]
if
(
debug
==
'
true
'
)
let
cmd
=
'
aa start -d 0 -a TestAbility
'
+
'
-b
'
+
abilityDelegatorArguments
.
bundleName
;
cmd
+=
'
'
+
translateParamsToString
(
abilityDelegatorArguments
.
parameters
);
let
debug
=
abilityDelegatorArguments
.
parameters
[
'
-D
'
];
if
(
debug
=
==
'
true
'
)
{
cmd
+=
'
-D
'
cmd
+=
'
-D
'
;
}
hilog
.
isLoggable
(
0x0000
,
'
testTag
'
,
hilog
.
LogLevel
.
INFO
);
hilog
.
info
(
0x0000
,
'
testTag
'
,
'
cmd : %{public}s
'
,
cmd
);
...
...
@@ -80,7 +80,7 @@ export default class OpenHarmonyTestRunner implements TestRunner {
hilog
.
info
(
0x0000
,
'
testTag
'
,
'
executeShellCommand : err : %{public}s
'
,
JSON
.
stringify
(
err
)
??
''
);
hilog
.
info
(
0x0000
,
'
testTag
'
,
'
executeShellCommand : data : %{public}s
'
,
d
.
stdResult
??
''
);
hilog
.
info
(
0x0000
,
'
testTag
'
,
'
executeShellCommand : data : %{public}s
'
,
d
.
exitCode
??
''
);
})
});
hilog
.
info
(
0x0000
,
'
testTag
'
,
'
%{public}s
'
,
'
OpenHarmonyTestRunner onRun end
'
);
}
}
\ No newline at end of file
ability/ability_runtime/stage/actsdebuggabletest/actsdebuggabletest/entry/src/main/ets/entryability/EntryAbility.ts
浏览文件 @
2bb74c84
ability/ability_runtime/stage/actsdebuggabletest/actsdebuggabletest/entry/src/main/ets/pages/Index.ets
浏览文件 @
2bb74c84
...
...
@@ -13,8 +13,6 @@
* limitations under the License.
*/
import AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry'
@Entry
@Component
struct Index {
...
...
ability/ability_runtime/stage/actsdebuggabletest/actsdebuggabletest/entry/src/main/ets/testability/TestAbility.ets
浏览文件 @
2bb74c84
...
...
@@ -26,13 +26,13 @@ export default class TestAbility extends Ability {
hilog.info(0x0000, 'testTag', '%{public}s', 'TestAbility onCreate');
hilog.info(0x0000, 'testTag', '%{public}s', 'want param:' + JSON.stringify(want) ?? '');
hilog.info(0x0000, 'testTag', '%{public}s', 'launchParam:'+ JSON.stringify(launchParam) ?? '');
var abilityDelegator: any
abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator()
var abilityDelegatorArguments: any
abilityDelegatorArguments = AbilityDelegatorRegistry.getArguments()
let abilityDelegator: any;
abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator();
let abilityDelegatorArguments: any;
abilityDelegatorArguments = AbilityDelegatorRegistry.getArguments();
hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.INFO);
hilog.info(0x0000, 'testTag', '%{public}s', 'start run testcase!!!');
Hypium.hypiumTest(abilityDelegator, abilityDelegatorArguments, testsuite)
Hypium.hypiumTest(abilityDelegator, abilityDelegatorArguments, testsuite);
}
onDestroy() {
...
...
ability/ability_runtime/stage/actsdebuggabletest/actsdebuggabletest/entry/src/main/ets/testability/pages/Index.ets
浏览文件 @
2bb74c84
...
...
@@ -22,7 +22,7 @@ struct Index {
hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.INFO);
hilog.info(0x0000, 'testTag', '%{public}s', 'TestAbility index aboutToAppear');
}
@State message: string = 'Hello Debuggable'
@State message: string = 'Hello Debuggable';
build() {
Row() {
Column() {
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录