提交 8cc31bfb 编写于 作者: A alex__hold 提交者: alex_hold
上级 a85b082d
......@@ -127,8 +127,6 @@ class DeviceTestType(object):
DeviceTestType enumeration
"""
cpp_test = "CppTest"
dex_test = "DexTest"
dex_junit_test = "DexJUnitTest"
hap_test = "HapTest"
junit_test = "JUnitTest"
jsunit_test = "JSUnitTest"
......@@ -158,10 +156,8 @@ class HostDrivenTestType(object):
TEST_DRIVER_SET = {
DeviceTestType.cpp_test,
DeviceTestType.dex_test,
DeviceTestType.hap_test,
DeviceTestType.junit_test,
DeviceTestType.dex_junit_test,
DeviceTestType.jsunit_test,
DeviceTestType.cpp_test_lite,
DeviceTestType.ctest_lite,
......
......@@ -48,7 +48,7 @@ from xdevice_extension._core.utils import convert_serial
__all__ = ["STSKit", "PushKit", "PropertyCheckKit", "ShellKit", "WifiKit",
"ConfigKit", "AppInstallKit", "junit_para_parse",
"gtest_para_parse", "junit_dex_para_parse", "reset_junit_para"]
"gtest_para_parse", "reset_junit_para"]
LOG = platform_logger("Kit")
......@@ -648,7 +648,7 @@ class AppInstallKit(ITestKit):
def remount(device):
cmd = "target mount" \
cmd = "mount -o rw,remount /" \
if device.usb_type == DeviceConnectorType.hdc else "remount"
device.hdc_command(cmd)
......@@ -753,62 +753,6 @@ def junit_para_parse(device, junit_paras, prefix_char="-e"):
return " ".join(ret_str)
def junit_dex_para_parse(device, junit_paras, prefix_char="--"):
"""To parse the para of junit
Args:
device: the device running
junit_paras: the para dict of junit
prefix_char: the prefix char of parsed cmd
Returns:
the new para using in a command like -e testFile xxx
-e coverage true...
"""
ret_str = []
path = "/%s/%s/%s/%s" % ("data", "local", "tmp", "ajur")
include_file = "%s/%s" % (path, "includes.txt")
exclude_file = "%s/%s" % (path, "excludes.txt")
if not isinstance(junit_paras, dict):
LOG.warning("The para of junit is not the dict format as required")
return ""
# Disable screen keyguard
disable_key_guard = junit_paras.get('disable-keyguard')
if not disable_key_guard or disable_key_guard[0].lower() != 'false':
from xdevice_extension._core.driver.drivers import disable_keyguard
disable_keyguard(device)
for para_name in junit_paras.keys():
path = "/%s/%s/%s/%s/" % ("data", "local", "tmp", "ajur")
if para_name.strip() == 'test-file-include-filter':
for file_name in junit_paras[para_name]:
device.push_file(file_name, include_file)
device.execute_shell_command(
'chown -R shell:shell %s' % path)
ret_str.append(prefix_char + " ".join(['testFile', include_file]))
elif para_name.strip() == "test-file-exclude-filter":
for file_name in junit_paras[para_name]:
device.push_file(file_name, include_file)
device.execute_shell_command(
'chown -R shell:shell %s' % path)
ret_str.append(prefix_char + " ".join(['notTestFile',
exclude_file]))
elif para_name.strip() == "test" or para_name.strip() == "class":
result = _get_class(junit_paras, prefix_char, para_name.strip())
ret_str.append(result)
elif para_name.strip() == "include-annotation":
ret_str.append(prefix_char + " ".join(
['annotation', ",".join(junit_paras[para_name])]))
elif para_name.strip() == "exclude-annotation":
ret_str.append(prefix_char + " ".join(
['notAnnotation', ",".join(junit_paras[para_name])]))
else:
ret_str.append(prefix_char + " ".join(
[para_name, ",".join(junit_paras[para_name])]))
return " ".join(ret_str)
def timeout_callback(proc):
try:
LOG.error("Error: execute command timeout.")
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册