| Jim Tang | ec94b16 | 2018-05-04 07:17:23 +0000 | [diff] [blame] | 1 | // Copyright (C) 2018 The Android Open Source Project | 
|  | 2 | // | 
|  | 3 | // Licensed under the Apache License, Version 2.0 (the "License"); | 
|  | 4 | // you may not use this file except in compliance with the License. | 
|  | 5 | // You may obtain a copy of the License at | 
|  | 6 | // | 
|  | 7 | //      http://www.apache.org/licenses/LICENSE-2.0 | 
|  | 8 | // | 
|  | 9 | // Unless required by applicable law or agreed to in writing, software | 
|  | 10 | // distributed under the License is distributed on an "AS IS" BASIS, | 
|  | 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | 
|  | 12 | // See the License for the specific language governing permissions and | 
|  | 13 | // limitations under the License. | 
|  | 14 |  | 
| yangbill | 78ef63e | 2018-08-31 00:11:25 +0800 | [diff] [blame] | 15 | python_defaults { | 
|  | 16 | name: "atest_lib_default", | 
|  | 17 | pkg_path: "atest", | 
|  | 18 | version: { | 
|  | 19 | py2: { | 
|  | 20 | enabled: false, | 
|  | 21 | embedded_launcher: false, | 
|  | 22 | }, | 
|  | 23 | py3: { | 
|  | 24 | enabled: true, | 
|  | 25 | embedded_launcher: false, | 
|  | 26 | }, | 
|  | 27 | }, | 
|  | 28 | } | 
|  | 29 |  | 
| yangbill | 7a48120 | 2018-10-23 16:20:02 +0800 | [diff] [blame] | 30 | // Remove this defaults after python3 migration is finished. | 
|  | 31 | python_defaults { | 
|  | 32 | name: "atest_py2_default", | 
|  | 33 | pkg_path: "atest", | 
|  | 34 | version: { | 
|  | 35 | py2: { | 
|  | 36 | enabled: true, | 
|  | 37 | embedded_launcher: false, | 
|  | 38 | }, | 
|  | 39 | py3: { | 
|  | 40 | enabled: false, | 
|  | 41 | embedded_launcher: false, | 
|  | 42 | }, | 
|  | 43 | }, | 
|  | 44 | } | 
|  | 45 |  | 
| Jim Tang | ec94b16 | 2018-05-04 07:17:23 +0000 | [diff] [blame] | 46 | python_binary_host { | 
|  | 47 | name: "atest", | 
|  | 48 | main: "atest.py", | 
|  | 49 | srcs: [ | 
|  | 50 | "**/*.py", | 
|  | 51 | ], | 
|  | 52 | exclude_srcs: [ | 
|  | 53 | "*_unittest.py", | 
|  | 54 | "*/*_unittest.py", | 
|  | 55 | ], | 
| Jim Tang | ae8eb44 | 2018-10-29 16:42:33 +0800 | [diff] [blame^] | 56 | libs: [ | 
|  | 57 | "py-mock", | 
|  | 58 | ], | 
| yangbill | 7a48120 | 2018-10-23 16:20:02 +0800 | [diff] [blame] | 59 | defaults: ["atest_py2_default"], | 
| Jim Tang | ec94b16 | 2018-05-04 07:17:23 +0000 | [diff] [blame] | 60 | } | 
| yangbill | 78ef63e | 2018-08-31 00:11:25 +0800 | [diff] [blame] | 61 |  | 
|  | 62 | python_library_host { | 
|  | 63 | name: "atest_module_info", | 
|  | 64 | defaults: ["atest_lib_default"], | 
|  | 65 | srcs: [ | 
|  | 66 | "module_info.py", | 
|  | 67 | "atest_utils.py", | 
|  | 68 | "constants.py", | 
|  | 69 | "constants_default.py" | 
|  | 70 | ], | 
|  | 71 | } | 
| Kevin Cheng | 5d6e157 | 2018-10-23 11:43:42 -0700 | [diff] [blame] | 72 |  | 
|  | 73 | // Move asuite_default and asuite_metrics to //tools/asuite when atest is | 
|  | 74 | // running as a prebuilt. | 
|  | 75 | python_defaults { | 
|  | 76 | name: "asuite_default", | 
|  | 77 | pkg_path: "asuite", | 
|  | 78 | version: { | 
|  | 79 | py2: { | 
|  | 80 | enabled: true, | 
|  | 81 | embedded_launcher: false, | 
|  | 82 | }, | 
|  | 83 | py3: { | 
|  | 84 | enabled: true, | 
|  | 85 | embedded_launcher: false, | 
|  | 86 | }, | 
|  | 87 | }, | 
|  | 88 | } | 
|  | 89 |  | 
|  | 90 | python_library_host { | 
|  | 91 | name: "asuite_metrics", | 
|  | 92 | defaults: ["asuite_default"], | 
|  | 93 | srcs: [ | 
|  | 94 | "asuite_metrics.py", | 
|  | 95 | ], | 
|  | 96 | } | 
| Jim Tang | ae8eb44 | 2018-10-29 16:42:33 +0800 | [diff] [blame^] | 97 |  | 
|  | 98 | python_test_host { | 
|  | 99 | name: "atest_unittests", | 
|  | 100 | main: "atest_run_unittests.py", | 
|  | 101 | pkg_path: "atest", | 
|  | 102 | srcs: [ | 
|  | 103 | "**/*.py", | 
|  | 104 | ], | 
|  | 105 | data: [ | 
|  | 106 | "unittest_data/**/*", | 
|  | 107 | "unittest_data/**/.*", | 
|  | 108 | ], | 
|  | 109 | test_config: "atest_unittests.xml", | 
|  | 110 | test_suites: ["general-tests"], | 
|  | 111 | defaults: ["atest_py2_default"], | 
|  | 112 | } |