diff --git a/BUILD.gn b/BUILD.gn index 93dfa9ccc9df540fe5f2538267b489a12c349aae..599b35dae54885f7c4558b48c8c8c4993345e490 100755 --- a/BUILD.gn +++ b/BUILD.gn @@ -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 = [] diff --git a/README.md b/README.md index 557792aa83fac5844d47e6d10f26a064bbbf018b..20a010a3427b62281f556fa65c73c7dc1cd53fdd 100755 --- a/README.md +++ b/README.md @@ -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 **** 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. + + ``` + + false + false + true + ... ... + + ``` + + >![](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. ``` @@ -174,9 +192,26 @@ The Python environment is required. ``` - 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. + + ``` + + hispark + taurus + ipcamera + hb build + + ``` + + >![](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 **** 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: ``` diff --git a/README_zh.md b/README_zh.md index ee4f588a91cd723e512d3dccbde4959bfd7ade64..1187e67694ced29c3bd7b1f8fa3cc914e444c877 100755 --- a/README_zh.md +++ b/README_zh.md @@ -166,7 +166,26 @@ developertest/ 文件:developertest/config/user\_config.xml - 1. 支持hdc连接的被测设备。 + 1. 测试框架通用配置。 + + \[build\] \# 配置测试用例的编译参数,例如: + + ``` + + false + false + true + ... ... + + ``` + + >![](public_sys-resources/icon-note.gif) **说明:** + >测试用例的编译参数说明如下: + >example:是否编译测试用例示例,默认false。 + >version:是否编译测试版本,默认false。 + >testcase:是否编译测试用例,默认true。 + + 2. 支持hdc连接的被测设备。 \[device\] \# 配置标签为usb-hdc的环境信息,测试设备的IP地址和hdc映射的端口号,例如: @@ -178,7 +197,25 @@ developertest/ ``` - 2. 仅支持串口的被测设备。 + 3. 仅支持串口的被测设备。 + + \[board\_info\] \# 开发板配置信息,例如: + + ``` + + hispark + taurus + ipcamera + hb build + + ``` + + >![](public_sys-resources/icon-note.gif) **说明:** + >开发板配置信息如下: + >board\_series:开发板系列,默认hispark。 + >board\_type:开发板类型,默认taurus。 + >board\_product:目标产品,默认ipcamera。 + >build\_command:测试版本和用例的编译命令,默认hb build。 \[device\] \# 配置标签为ipcamera的串口信息,COM口和波特率,例如: diff --git a/aw/cxx/distributed/BUILD.gn b/aw/cxx/distributed/BUILD.gn index 250c023b516646c4524220ca660141d7bcc4ee4f..68888e0abc51d38a263d27404a49ebd399583d87 100755 --- a/aw/cxx/distributed/BUILD.gn +++ b/aw/cxx/distributed/BUILD.gn @@ -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" ] } diff --git a/aw/cxx/hwext/perf.cpp b/aw/cxx/hwext/perf.cpp index 63e0c98909449d0def4286439d02c66a60339469..e1414a510c4761c0d3abe5c2efc07218011bcbc9 100755 --- a/aw/cxx/hwext/perf.cpp +++ b/aw/cxx/hwext/perf.cpp @@ -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; } diff --git a/aw/java/distributed/src/ohos/junit/distribute/ISocketObserver.java b/aw/java/distributed/src/ohos/junit/distribute/ISocketObserver.java index b62ca0f8d1f11017e23283a31e5e43e04f93c532..c30e52d91a8f1dc6b98c64976237df19339b9189 100755 --- a/aw/java/distributed/src/ohos/junit/distribute/ISocketObserver.java +++ b/aw/java/distributed/src/ohos/junit/distribute/ISocketObserver.java @@ -16,7 +16,7 @@ package ohos.junit.distribute; /** - * Client for distribute socket + * Client for distributed socket */ public interface ISocketObserver { /** diff --git a/aw/python/distributed/__init__.py b/aw/python/distributed/__init__.py index 58269f6ff32ba27e57cd81e41a6ae2e882749d07..9f9f21be1e901da471c27d58d5d5eedf856af613 100755 --- a/aw/python/distributed/__init__.py +++ b/aw/python/distributed/__init__.py @@ -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 diff --git a/config/build_config.xml b/config/build_config.xml index 2c324932a2acd4f78422e6d4f25f699cac57c094..a6d368070fc200279d6fc2c313392c36cc9894a1 100755 --- a/config/build_config.xml +++ b/config/build_config.xml @@ -1,4 +1,4 @@ - + - - + + diff --git a/config/filter_config.xml b/config/filter_config.xml index dbceb4655b748dc778ac4c67fbf5ec91ab3c2e88..4c640fef6751eb88ec112d7432f22ebc5f7b35e5 100755 --- a/config/filter_config.xml +++ b/config/filter_config.xml @@ -1,4 +1,4 @@ - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/examples/sleep/include/sleep_ex.h b/examples/sleep/include/sleep_ex.h index 80d980aacbffd787d61f312fc3b6c6bfac7e2c08..d6ca5b3a60cd76ffeae4afc2278442d4b8ea40ae 100755 --- a/examples/sleep/include/sleep_ex.h +++ b/examples/sleep/include/sleep_ex.h @@ -14,7 +14,6 @@ */ #include -#include #include #include diff --git a/examples/sleep/test/xDevice_test_report_demo.xml b/examples/sleep/test/xDevice_test_report_demo.xml index 0216e36fae73b6999555c35c6c024ab3319e60a6..09c8ed0820643406d923df306206c5540658fa02 100755 --- a/examples/sleep/test/xDevice_test_report_demo.xml +++ b/examples/sleep/test/xDevice_test_report_demo.xml @@ -1,4 +1,4 @@ - + - - - - - - - - - + + + + + + + + + diff --git a/examples/string_utils/src/com/ohos/utils/StringUtils.java b/examples/string_utils/src/com/ohos/utils/StringUtils.java index 17ee9cd2858c1c629648c9225d8d3b1bcd33f35b..13df18cb8f5a1de52d4197738211be947720cec9 100755 --- a/examples/string_utils/src/com/ohos/utils/StringUtils.java +++ b/examples/string_utils/src/com/ohos/utils/StringUtils.java @@ -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(); } } diff --git a/examples/test/resource/sleep/spent_time_test/baseline.xml b/examples/test/resource/sleep/spent_time_test/baseline.xml index 2c1628b04700e9cd3b2617d7074b010b02f85747..579d5feb5735700a87a5f230af37e94eab355455 100755 --- a/examples/test/resource/sleep/spent_time_test/baseline.xml +++ b/examples/test/resource/sleep/spent_time_test/baseline.xml @@ -1,4 +1,4 @@ - + - - - - - + + + + + diff --git a/libs/jtr/common/java/src/ohos/unittest/CaseLevel.java b/libs/jtr/common/java/src/ohos/unittest/CaseLevel.java index 0361342a3f7c592270ee1adc8807c2e097d8e5a6..26f65810835900049935b677aee2bf156d7bc00d 100755 --- a/libs/jtr/common/java/src/ohos/unittest/CaseLevel.java +++ b/libs/jtr/common/java/src/ohos/unittest/CaseLevel.java @@ -1,5 +1,5 @@ /* - * 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 diff --git a/libs/jtr/common/java/src/ohos/unittest/CaseType.java b/libs/jtr/common/java/src/ohos/unittest/CaseType.java index 918db596c9e4cd7060c6781f89749ac588e691af..717847dd900897120f73d68f89d866af3e0ca46c 100755 --- a/libs/jtr/common/java/src/ohos/unittest/CaseType.java +++ b/libs/jtr/common/java/src/ohos/unittest/CaseType.java @@ -1,5 +1,5 @@ /* - * 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 diff --git a/libs/jtr/common/java/src/ohos/unittest/Level.java b/libs/jtr/common/java/src/ohos/unittest/Level.java index 95560e1518dd64d22805ee3f93a41a86f497b612..df5a081fc2565c7de598bb75a35a6feb888f988c 100755 --- a/libs/jtr/common/java/src/ohos/unittest/Level.java +++ b/libs/jtr/common/java/src/ohos/unittest/Level.java @@ -1,5 +1,5 @@ /* - * 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 diff --git a/libs/jtr/common/java/src/ohos/unittest/TestTarget.java b/libs/jtr/common/java/src/ohos/unittest/TestTarget.java index 1918f9f455739bbcd92e35e040e482242c05c781..1a95bbeb08bc376c1a1b3f5159299e7705c4b6d3 100755 --- a/libs/jtr/common/java/src/ohos/unittest/TestTarget.java +++ b/libs/jtr/common/java/src/ohos/unittest/TestTarget.java @@ -1,5 +1,5 @@ /* - * 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 diff --git a/libs/jtr/common/java/src/ohos/unittest/Type.java b/libs/jtr/common/java/src/ohos/unittest/Type.java index 7f929eae1359931814cc489d5f51d918aa9455d5..0d4a8422608a8c37d2fde140e14541d9faf0a87e 100755 --- a/libs/jtr/common/java/src/ohos/unittest/Type.java +++ b/libs/jtr/common/java/src/ohos/unittest/Type.java @@ -1,5 +1,5 @@ /* - * 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 diff --git a/libs/jtr/common/java/src/ohos/unittest/perf/BaseLine.java b/libs/jtr/common/java/src/ohos/unittest/perf/BaseLine.java index 6f88c6770393a6f6cce9160c9c9f703ef8cfcc22..5d66ded953df8c277457d8851c9a12e1aaeea1e1 100755 --- a/libs/jtr/common/java/src/ohos/unittest/perf/BaseLine.java +++ b/libs/jtr/common/java/src/ohos/unittest/perf/BaseLine.java @@ -1,5 +1,5 @@ /* - * 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 diff --git a/libs/jtr/common/java/src/ohos/unittest/perf/BaseLineParser.java b/libs/jtr/common/java/src/ohos/unittest/perf/BaseLineParser.java index c0f8f89b087f0a67287abc0aca97443e2ef88196..1504953c3f8431428c35789667b69856c520eb7d 100755 --- a/libs/jtr/common/java/src/ohos/unittest/perf/BaseLineParser.java +++ b/libs/jtr/common/java/src/ohos/unittest/perf/BaseLineParser.java @@ -1,5 +1,5 @@ /* - * 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 diff --git a/libs/jtr/common/java/src/ohos/unittest/perf/PerfVerify.java b/libs/jtr/common/java/src/ohos/unittest/perf/PerfVerify.java index 5c061c2cebc1bc9ccc9a8f453b4132064f64191b..3d0222f479ae706d5bbbd41de8b46821c20ec967 100755 --- a/libs/jtr/common/java/src/ohos/unittest/perf/PerfVerify.java +++ b/libs/jtr/common/java/src/ohos/unittest/perf/PerfVerify.java @@ -1,5 +1,5 @@ /* - * 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 diff --git a/libs/jtr/common/java/src/ohos/unittest/perf/VerifySingleton.java b/libs/jtr/common/java/src/ohos/unittest/perf/VerifySingleton.java index 3138c080fcde254a081b5b5f7261e9f65344c132..adb38510e3d1cc19e9a32407d143c490c7011c7a 100755 --- a/libs/jtr/common/java/src/ohos/unittest/perf/VerifySingleton.java +++ b/libs/jtr/common/java/src/ohos/unittest/perf/VerifySingleton.java @@ -1,5 +1,5 @@ /* - * 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