delete debug code for test xdevice

This commit is contained in:
hwb0703 2021-03-15 17:02:42 +08:00
parent c2c469f6ec
commit 3f3bd94d9b
7 changed files with 1 additions and 98 deletions

View File

@ -1,24 +0,0 @@
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
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.
***************************************************************
Copyright (C) 2011 The Android Open Source Project
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
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.

View File

@ -1,17 +0,0 @@
#!/usr/bin/env python3
# coding=utf-8
#
# 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
#
# 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.
#

View File

@ -1,44 +0,0 @@
#!/usr/bin/env python3
# coding=utf-8
#
# Copyright (c) 2021 Huawei Device Co., Ltd.
# Copyright (c) 2013 The Android Open Source Project
# 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.
#
from dataclasses import dataclass
__all__ = ["UsbConst", "AppConst"]
@dataclass
class UsbConst:
connector = "adb"
connector_type = "usb-adb"
push = "adb push"
pull = "adb pull"
shell = "adb shell"
server_port = "ANDROID_ADB_SERVER_PORT"
kill_server = "adb kill-server"
start_server = "adb start-server"
reboot = "adb reboot"
@dataclass
class AppConst:
entry_app = "Entry.apk"
app_ext = ".apk"
app_name = "APK"
wifi_app = "xDeviceService-wifi.apk"

View File

@ -36,7 +36,6 @@ def main():
'xdevice._core.executor',
'xdevice._core.report',
'xdevice._core.testkit',
'adapter.xdevice_adapter',
],
package_data={
'xdevice._core': [

View File

@ -24,7 +24,6 @@ from _core.exception import ParamError
from _core.logger import platform_logger
from _core.utils import get_local_ip
from xdevice_adapter.constants import UsbConst
__all__ = ["UserConfigManager"]
LOG = platform_logger("ConfigManager")
@ -194,8 +193,7 @@ class UserConfigManager(object):
def get_device(self, target_name):
for node in self.config_content.findall(target_name):
data_dic = {}
if node.attrib["type"] != "usb-hdc" and \
node.attrib["type"] != UsbConst.connector_type:
if node.attrib["type"] != "usb-hdc":
continue
data_dic["usb_type"] = node.attrib["type"]
for sub in node:

View File

@ -28,7 +28,6 @@ from _core.utils import get_filename_extension
from _core.utils import is_config_str
from _core.utils import unique_id
from xdevice_adapter.constants import AppConst
__all__ = ["TestSetSource", "TestSource", "find_test_descriptors",
"find_testdict_descriptors"]
@ -39,14 +38,12 @@ TestSource = namedtuple('TestSource', 'source_file source_string config_file '
TEST_TYPE_DICT = {"DEX": DeviceTestType.dex_test,
"HAP": DeviceTestType.hap_test,
AppConst.app_name: DeviceTestType.hap_test,
"PYT": HostDrivenTestType.device_test,
"JST": DeviceTestType.jsunit_test,
"CXX": DeviceTestType.cpp_test,
"BIN": DeviceTestType.lite_cpp_test}
EXT_TYPE_DICT = {".dex": DeviceTestType.dex_test,
".hap": DeviceTestType.hap_test,
AppConst.app_ext: DeviceTestType.hap_test,
".py": HostDrivenTestType.device_test,
".js": DeviceTestType.jsunit_test,
".bin": DeviceTestType.lite_cpp_test,
@ -386,8 +383,6 @@ def _get_test_type(config_file, test_driver, ext):
if ext in [".py", ".js", ".dex", ".hap", ".bin"] \
and ext in EXT_TYPE_DICT.keys():
test_type = EXT_TYPE_DICT[ext]
elif ext in [AppConst.app_ext] and ext in EXT_TYPE_DICT.keys():
test_type = DeviceTestType.hap_test
else:
test_type = DeviceTestType.cpp_test
return test_type

View File

@ -23,16 +23,12 @@ from dataclasses import dataclass
__all__ = ["Variables"]
SRC_DIR = os.path.abspath(os.path.dirname(os.path.dirname(__file__)))
SRC_ADAPTER_DIR = os.path.abspath(os.path.join(SRC_DIR, "adapter"))
MODULES_DIR = os.path.abspath(os.path.dirname(__file__))
TOP_DIR = os.path.abspath(
os.path.dirname(os.path.dirname(os.path.dirname(__file__))))
TOP_ADAPTER_DIR = os.path.abspath(os.path.join(TOP_DIR, "adapter"))
sys.path.insert(0, SRC_DIR)
sys.path.insert(1, MODULES_DIR)
sys.path.insert(2, TOP_DIR)
sys.path.insert(3, SRC_ADAPTER_DIR)
sys.path.insert(4, TOP_ADAPTER_DIR)
@dataclass