• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1#!/usr/bin/env python3
2#
3# Copyright 2018 - The Android Open Source Project
4#
5# Licensed under the Apache License, Version 2.0 (the "License");
6# you may not use this file except in compliance with the License.
7# You may obtain a copy of the License at
8#
9#     http://www.apache.org/licenses/LICENSE-2.0
10#
11# Unless required by applicable law or agreed to in writing, software
12# distributed under the License is distributed on an "AS IS" BASIS,
13# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14# See the License for the specific language governing permissions and
15# limitations under the License.
16
17"""
18Unittest constants.
19
20Unittest constants get their own file since they're used purely for testing and
21should not be combined with constants_defaults as part of normal aidegen
22operation.
23"""
24
25import os
26
27from aidegen.lib import common_util
28
29# The data below is only for test usage.
30TEST_DATA_PATH = os.path.join(common_util.get_aidegen_root_dir(), "test_data")
31IDEA_SH_FIND = [
32    '/opt/intellij-ce-2018.1/bin/idea.sh', '/opt/intellij-ce-2017.2/bin/idea.sh'
33]  # script path data
34
35SH_GOLDEN_SAMPLE = '/opt/intellij-ce-2018.1/bin/idea.sh'
36
37IDEA_SH_FIND_NONE = ''  # Neither IntelliJ CE nor UE script exists.
38TEST_PATH = 'path'
39TEST_MODULE = 'test'
40ANDROID_SOURCE_DICT = {
41    'test_data/project/level11/level21': True,
42    'test_data/project/level11/level22/level31': False,
43    'test_data/project/level12/level22': False,
44}
45JAR_DEP_LIST = ['test1.jar', 'test2.jar']
46ANDROID_PROJECT_PATH = os.path.join(TEST_DATA_PATH, 'android_project')
47MODULE_PATH = 'packages/apps/test'
48MODULE_INFO = {
49    'path': [MODULE_PATH],
50    'srcs': [
51        'packages/apps/test/src/main/java/com/android/java.java',
52        'packages/apps/test/tests/com/android/test.java',
53    ],
54    'dependencies': [],
55    'installed': []
56}
57PATH_TO_MULT_MODULES_WITH_MULTI_ARCH = 'shared/path/to/be/used2'
58TESTABLE_MODULES_WITH_SHARED_PATH = [
59    'multiarch', 'multiarch1', 'multiarch2', 'multiarch3', 'multiarch3_32'
60]
61CC_NAME_TO_MODULE_INFO = {
62    "multiarch": {
63        "path": [
64            "shared/path/to/be/used2"
65        ],
66        "module_name": "multiarch"
67    },
68    "multiarch1": {
69        "path": [
70            "shared/path/to/be/used2/arch1"
71        ],
72        "module_name": "multiarch1"
73    },
74    "multiarch2": {
75        "path": [
76            "shared/path/to/be/used2/arch2"
77        ],
78        "module_name": "multiarch2"
79    },
80    "multiarch3": {
81        "path": [
82            "shared/path/to/be/used2/arch3"
83        ],
84        "module_name": "multiarch3"
85    },
86    "multiarch3_32": {
87        "path": [
88            "shared/path/to/be/used2/arch3_32"
89        ],
90        "module_name": "multiarch3_32"
91    }
92}
93CC_MODULE_INFO = {
94    "clang": "${ANDROID_ROOT}/prebuilts/clang/host/linux-x86/bin/clang",
95    "clang++": "${ANDROID_ROOT}/prebuilts/clang/host/linux-x86/bin/clang++",
96    "modules": CC_NAME_TO_MODULE_INFO
97}
98