diff --git a/adapter/LICENSE b/adapter/LICENSE deleted file mode 100755 index 1b49cb7af0e9a66df0cb92ba59066227c2bee861..0000000000000000000000000000000000000000 --- a/adapter/LICENSE +++ /dev/null @@ -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. \ No newline at end of file diff --git a/adapter/xdevice_adapter/__init__.py b/adapter/xdevice_adapter/__init__.py deleted file mode 100755 index d8daf3c4b297c8f25d9018f3245ab388ed07ebc1..0000000000000000000000000000000000000000 --- a/adapter/xdevice_adapter/__init__.py +++ /dev/null @@ -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. -# diff --git a/adapter/xdevice_adapter/constants.py b/adapter/xdevice_adapter/constants.py deleted file mode 100755 index 3a917c6b49903093deb9e77dfa086e51a4d38e90..0000000000000000000000000000000000000000 --- a/adapter/xdevice_adapter/constants.py +++ /dev/null @@ -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" diff --git a/setup.py b/setup.py index 42c7d8822446f72b15a87f69bed0030e110ebc97..c06bb1d09fd5ce0173712e7bde1830eee63a78fd 100755 --- a/setup.py +++ b/setup.py @@ -36,7 +36,6 @@ def main(): 'xdevice._core.executor', 'xdevice._core.report', 'xdevice._core.testkit', - 'adapter.xdevice_adapter', ], package_data={ 'xdevice._core': [ diff --git a/src/xdevice/_core/config/config_manager.py b/src/xdevice/_core/config/config_manager.py index e2b4fab202f8e3f3aa053ca8ae61d172f28be434..9c5edd1c48fe7151a2c0a67faa3bb19c8025a945 100755 --- a/src/xdevice/_core/config/config_manager.py +++ b/src/xdevice/_core/config/config_manager.py @@ -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: diff --git a/src/xdevice/_core/executor/source.py b/src/xdevice/_core/executor/source.py index e2bb2504b2397ec0e1575880ddfa34c7f64952f0..9c050de34ee4a91e38ce8d04bc96f4aac2761bb9 100755 --- a/src/xdevice/_core/executor/source.py +++ b/src/xdevice/_core/executor/source.py @@ -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 diff --git a/src/xdevice/variables.py b/src/xdevice/variables.py index 594ad67d5587cc4892b5cecbf8d1ce704b3aafd4..6712ad86bbbfda6dbbc98c06c9fba566935c5e68 100755 --- a/src/xdevice/variables.py +++ b/src/xdevice/variables.py @@ -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