提交 3d02b79b 编写于 作者: H hwb0703

modify readme and code style

上级 274b5ef9
......@@ -11,6 +11,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
group("make_temp_test") {
testonly = true
deps = []
......
......@@ -158,13 +158,31 @@ The Python environment is required.
```
- Configure the developers test module
- Configure the developers test module.
in the configuration file **developertest/config/user\_config.xml**.
Configuration file: **developertest/config/user\_config.xml**
1. For devices that support the Harmony device connector \(hdc\), modify the configuration file as follows:
1. Modify basic configuration parameters.
Between the **<device\>** tags with the **"usb-hdc"** attribute, configure the test device IP address and the matched hdc port. For example
\[build\] \# Set build parameters of the test case.
```
<build>
<example>false</example>
<version>false</version>
<testcase>true</testcase>
... ...
</build>
```
>![](public_sys-resources/icon-note.gif) **NOTE:**
>**example**: whether to build the test case example. The default value is **false**.
>**version**: whether to build the test version. The default value is **false**.
>**testcase**: whether to build the test case. The default value is **true**.
2. For devices that support the Harmony device connector \(hdc\), modify the configuration file as follows:
\[device\] \# Configure the device information with the **"usb-hdc"** attribute, including the test device IP address and the matched hdc port.
```
<device type="usb-hdc">
......@@ -174,9 +192,26 @@ The Python environment is required.
</device>
```
2. For devices that only support the serial port connection, modify the configuration file as follows:
3. For devices that support serial port connection only, modify the configuration file as follows:
\[board\_info\] \# Configure development board information.
```
<board_info>
<board_series>hispark</board_series>
<board_type>taurus</board_type>
<board_product>ipcamera</board_product>
<build_command>hb build</build_command>
</board_info>
```
>![](public_sys-resources/icon-note.gif) **NOTE:**
>**board\_series**: development board series. The default value is **hispark**.
>**board\_type**: development board type. The default value is **taurus**.
>**board\_product**: target product. The default value is **ipcamera**.
>**build\_command**: command used for building the test version and test case. The default value is **hb build**.
Between the **<device\>** tags with the **"ipcamera"** attribute, configure the serial port information, including the COM port and baud rate. For example:
\[device\] \# Configure the serial port information with the **"ipcamera"** attribute, including the COM port and baud rate. For example:
```
<device type="com" label="ipcamera">
......
......@@ -166,7 +166,26 @@ developertest/
文件:developertest/config/user\_config.xml
1. 支持hdc连接的被测设备。
1. 测试框架通用配置。
\[build\] \# 配置测试用例的编译参数,例如:
```
<build>
<example>false</example>
<version>false</version>
<testcase>true</testcase>
... ...
</build>
```
>![](public_sys-resources/icon-note.gif) **说明:**
>测试用例的编译参数说明如下:
>example:是否编译测试用例示例,默认false。
>version:是否编译测试版本,默认false。
>testcase:是否编译测试用例,默认true。
2. 支持hdc连接的被测设备。
\[device\] \# 配置标签为usb-hdc的环境信息,测试设备的IP地址和hdc映射的端口号,例如:
......@@ -178,7 +197,25 @@ developertest/
</device>
```
2. 仅支持串口的被测设备。
3. 仅支持串口的被测设备。
\[board\_info\] \# 开发板配置信息,例如:
```
<board_info>
<board_series>hispark</board_series>
<board_type>taurus</board_type>
<board_product>ipcamera</board_product>
<build_command>hb build</build_command>
</board_info>
```
>![](public_sys-resources/icon-note.gif) **说明:**
>开发板配置信息如下:
>board\_series:开发板系列,默认hispark。
>board\_type:开发板类型,默认taurus。
>board\_product:目标产品,默认ipcamera。
>build\_command:测试版本和用例的编译命令,默认hb build。
\[device\] \# 配置标签为ipcamera的串口信息,COM口和波特率,例如:
......
......@@ -32,6 +32,10 @@ ohos_static_library("distributedtest_lib") {
"//third_party/googletest:gtest",
"//utils/native/base:utils",
]
external_deps = [ "hilog:libhilog" ]
if (is_standard_system) {
external_deps = [ "hiviewdfx_hilog_native:libhilog" ]
} else {
external_deps = [ "hilog:libhilog" ]
}
public_configs = [ ":distributedtest_config" ]
}
......@@ -28,11 +28,8 @@ namespace TestAW {
#define ERR_MSG(...) fprintf(stderr, __VA_ARGS__)
#define INF_MSG(...) fprintf(stdout, __VA_ARGS__)
#if 0
#define DBG_MSG(...) fprintf(stdout,__VA_ARGS__)
#else
#define DBG_MSG(...)
#endif
#define DBG_MSG(...) fprintf(stdout, __VA_ARGS__)
#define ID_LARGER_IS_BETTER true
#define ID_SMALLER_IS_BETTER false
#define _max(a,b) (((a)>=(b)) ? (a) : (b) )
......@@ -152,7 +149,7 @@ double BaseLineManager::StrToDouble(const string& str)
bool BaseLineManager::GetExtraValueDouble(const string testcaseName, const string extra, double &value)
{
if (testcaseName == "" || extra == "") {
DBG_MSG("[ ERROR ] invalid arguments: testcaseName=%s, extra=%s\n", testcaseName.c_str(), extra);
DBG_MSG("[ ERROR ] invalid arguments: testcaseName=%s, extra=%s\n", testcaseName.c_str(), extra.c_str());
return false;
}
......@@ -238,7 +235,7 @@ bool GtestPerfTestCase::Initialize()
m_bHasFloatRange = m_pManager->GetExtraValueDouble(m_strCaseName, "floatrange", m_dbFloatRange);
// check values is valid, and update them.
if (m_bHasFloatRange && (m_dbFloatRange < 0 || m_dbFloatRange >= 1)) {
DBG_MSG("[ ERROR ] %s has invalid float range: %f.\n", m_strCaseName, m_dbFloatRange);
DBG_MSG("[ ERROR ] %s has invalid float range: %f.\n", m_strCaseName.c_str(), m_dbFloatRange);
m_bHasFloatRange = false;
}
......
......@@ -16,7 +16,7 @@
package ohos.junit.distribute;
/**
* Client for distribute socket
* Client for distributed socket
*/
public interface ISocketObserver {
/**
......
......@@ -16,8 +16,12 @@
# limitations under the License.
#
import os
import sys
from distributed.common.common import get_resource_dir
from distributed.common.common import get_result_dir
from distributed.common.common import create_empty_result_file
from distributed.distribute.distribute import Distribute
from distributed.common.manager import DeviceManager
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="UTF-8"?>
<!-- Copyright (c) 2021 Huawei Device Co., Ltd.
Licensed under the Apache License, Version 2.0 (the "License");
......@@ -14,12 +14,12 @@
limitations under the License.
-->
<build_config>
<common_subsystem>
<option name="foundation_app" />
<option name="hiworld_demo" />
<option name="build_hit" />
<option name="developtools" />
<option name="utils" />
<option name="common" />
</common_subsystem>
<common_subsystem>
<option name="foundation_app" />
<option name="hiworld_demo" />
<option name="build_hit" />
<option name="developtools" />
<option name="utils" />
<option name="common" />
</common_subsystem>
</build_config>
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="UTF-8"?>
<!-- Copyright (c) 2021 Huawei Device Co., Ltd.
Licensed under the Apache License, Version 2.0 (the "License");
......@@ -14,32 +14,32 @@
limitations under the License.
-->
<TestFileConfig>
<testfile_name>
<phone>
<item></item>
</phone>
<ivi>
<item></item>
</ivi>
<wearable>
<item></item>
</wearable>
<intellitv>
<item></item>
</intellitv>
</testfile_name>
<subsystem_name>
<phone>
<item></item>
</phone>
<ivi>
<item></item>
</ivi>
<wearable>
<item></item>
</wearable>
<intellitv>
<item></item>
</intellitv>
</subsystem_name>
<testfile_name>
<phone>
<item></item>
</phone>
<ivi>
<item></item>
</ivi>
<wearable>
<item></item>
</wearable>
<intellitv>
<item></item>
</intellitv>
</testfile_name>
<subsystem_name>
<phone>
<item></item>
</phone>
<ivi>
<item></item>
</ivi>
<wearable>
<item></item>
</wearable>
<intellitv>
<item></item>
</intellitv>
</subsystem_name>
</TestFileConfig>
......@@ -14,7 +14,6 @@
*/
#include <sys/socket.h>
#include <linux/genetlink.h>
#include <string>
#include <unistd.h>
......
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="UTF-8"?>
<!-- Copyright (c) 2021 Huawei Device Co., Ltd.
Licensed under the Apache License, Version 2.0 (the "License");
......@@ -13,62 +13,13 @@
See the License for the specific language governing permissions and
limitations under the License.
-->
<testsuites disabled="disabled"
runmodules=""
modules=""
productinfo=""
endtime=""
starttime=""
unavailable=""
ignored=""
errors=""
failures=""
tests=""
taskid="">
<testsuite disabled="disabled"
unavailable=""
ignored=""
errors=""
failures=""
tests=""
message=""
time=""
name="testsuite_name"
modulename="module_name">
<testcase message=""
time=""
name="method_name/py_name"
result="true/false"
status="run/disabled/ignored"
classname="class_name" />
<testcase message=""
time=""
name="method_name/py_name"
result="true/false"
status="run/disabled/ignored"
classname="class_name" />
</testsuite>
<testsuite disabled="disabled"
unavailable=""
ignored=""
errors=""
failures=""
tests=""
message=""
time=""
name="testsuite_name"
modulename="module_name">
<testcase message=""
time=""
name="method_name/py_name"
result="true/false"
status="run/disabled/ignored"
classname="class_name" />
<testcase message=""
time=""
name="method_name/py_name"
result="true/false"
status="run/disabled/ignored"
classname="class_name" />
</testsuite>
<testsuites disabled="" runmodules="" modules="" productinfo="" endtime="" starttime="" unavailable="" ignored="" errors="" failures="" tests="" taskid="">
<testsuite disabled="" unavailable="" ignored="" errors="" failures="" tests="" message="" time="" name="testsuite_name" modulename="module_name">
<testcase message="" time="" name="method_name/py_name" result="true/false" status="run/disabled/ignored" classname="class_name"/>
<testcase message="" time="" name="method_name/py_name" result="true/false" status="run/disabled/ignored" classname="class_name"/>
</testsuite>
<testsuite disabled="" unavailable="" ignored="" errors="" failures="" tests="" message="" time="" name="testsuite_name" modulename="module_name">
<testcase message="" time="" name="method_name/py_name" result="true/false" status="run/disabled/ignored" classname="class_name"/>
<testcase message="" time="" name="method_name/py_name" result="true/false" status="run/disabled/ignored" classname="class_name"/>
</testsuite>
</testsuites>
......@@ -12,11 +12,11 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.ohos.utils;
import java.util.Locale;
/**
* handle string method
*/
......@@ -33,7 +33,6 @@ public class StringUtils {
if (str == null) {
return EMPTY_STRING;
}
return str.toLowerCase(Locale.getDefault());
}
......@@ -47,7 +46,6 @@ public class StringUtils {
if (str == null) {
return EMPTY_STRING;
}
return str.toUpperCase(Locale.getDefault());
}
......@@ -61,7 +59,6 @@ public class StringUtils {
if (str == null) {
return EMPTY_STRING;
}
return new StringBuffer(str).reverse().toString();
}
}
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="UTF-8"?>
<!-- Copyright (c) 2021 Huawei Device Co., Ltd.
Licensed under the Apache License, Version 2.0 (the "License");
......@@ -13,22 +13,9 @@
See the License for the specific language governing permissions and
limitations under the License.
-->
<configuration datetime="2019-12-12 10:33:10"
url="http://127.0.0.1/dummy">
<item name="SpentTime001"
baseline="1200"
lastvalue="1200"
floatrange="0.05"></item>
<item name="SpentTime002"
baseline="1000"
lastvalue="1000"
floatrange="0.06"></item>
<item name="SpentTime003"
baseline="110"
lastvalue="110"
floatrange="0.05"></item>
<item name="SpentTime004"
baseline="108"
lastvalue="108"
floatrange="0.05"></item>
<configuration datetime="2019-12-12 10:33:10" url="http://127.0.0.1/dummy">
<item name="SpentTime001" baseline="1200" lastvalue="1200" floatrange="0.05"></item>
<item name="SpentTime002" baseline="1000" lastvalue="1000" floatrange="0.06"></item>
<item name="SpentTime003" baseline="110" lastvalue="110" floatrange="0.05"></item>
<item name="SpentTime004" baseline="108" lastvalue="108" floatrange="0.05"></item>
</configuration>
/*
* Copyright (c) 2020 Huawei Device Co., Ltd.
* Copyright (c) 2021 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
......
/*
* Copyright (c) 2020 Huawei Device Co., Ltd.
* Copyright (c) 2021 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
......
/*
* Copyright (c) 2020 Huawei Device Co., Ltd.
* Copyright (c) 2021 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
......
/*
* Copyright (c) 2020 Huawei Device Co., Ltd.
* Copyright (c) 2021 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
......
/*
* Copyright (c) 2020 Huawei Device Co., Ltd.
* Copyright (c) 2021 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
......
/*
* Copyright (c) 2020 Huawei Device Co., Ltd.
* Copyright (c) 2021 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
......
/*
* Copyright (c) 2020 Huawei Device Co., Ltd.
* Copyright (c) 2021 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
......
/*
* Copyright (c) 2020 Huawei Device Co., Ltd.
* Copyright (c) 2021 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
......
/*
* Copyright (c) 2020 Huawei Device Co., Ltd.
* Copyright (c) 2021 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
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册