Skip to content

Commit 3bddc3a

Browse files
committed
Minor bug fixes.
1 parent ae9a3e3 commit 3bddc3a

File tree

4 files changed

+31
-4
lines changed

4 files changed

+31
-4
lines changed

docker/android-system.sh

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -599,8 +599,7 @@ print(f"{major}.{minor}")')
599599
mkdir -p "${PYTHON_TMPDIR}"
600600
python3 -m pip install sly==0.4.0 --prefix "${PYTHON_TMPDIR}"
601601

602-
python3 "${PYTHON_TMPDIR}/scripts/build-system.py \
603-
remove_tests.py" \
602+
python3 "${PYTHON_TMPDIR}/scripts/build-system.py" \
604603
--remove-tests \
605604
--verbose
606605
}

docker/android/android/soong.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,7 @@ def sequence(self, prod):
220220
def sequence(self, prod):
221221
return [prod.list_item]
222222

223-
@_('string PLUS list_item')
223+
@_('list_item PLUS list_item')
224224
def list_item(self, prod):
225225
return BinaryOperator(prod[0], '+', prod[2])
226226

docker/android/tests/Addition.bp

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,3 +51,12 @@ tri_list = ["value0"] + ["value1"] + ["value2"]
5151
tri_scope = {} + {
5252
name: "target",
5353
} + {}
54+
// test sequence lhs and rhs strings
55+
home = "dir/"
56+
test = "test.c"
57+
58+
files = [
59+
home + "file.c",
60+
"test/" + test,
61+
home + test,
62+
]

docker/android/tests/test_soong.py

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ def test():
7070
def test_addition():
7171
path = os.path.join(TEST_DIR, 'Addition.bp')
7272
ast = soong.load(open(path))
73-
assert len(ast) == 24
73+
assert len(ast) == 27
7474
assert ast[0].is_assignment()
7575
assert ast[1].is_binary_operator_assignment()
7676
assert ast[2].is_assignment()
@@ -114,6 +114,25 @@ def test_addition():
114114
assert ast[20].expr.op == '+'
115115
assert ast[20].expr.rhs == 2
116116

117+
assert ast[26].name == 'files'
118+
assert ast[26].expr.is_list()
119+
assert len(ast[26].expr) == 3
120+
121+
assert ast[26].expr[0].lhs == 'home'
122+
assert ast[26].expr[0].lhs.is_ident()
123+
assert ast[26].expr[0].rhs == 'file.c'
124+
assert ast[26].expr[0].rhs.is_string()
125+
126+
assert ast[26].expr[1].lhs == 'test/'
127+
assert ast[26].expr[1].lhs.is_string()
128+
assert ast[26].expr[1].rhs == 'test'
129+
assert ast[26].expr[1].rhs.is_ident()
130+
131+
assert ast[26].expr[2].lhs == 'home'
132+
assert ast[26].expr[2].lhs.is_ident()
133+
assert ast[26].expr[2].rhs == 'test'
134+
assert ast[26].expr[2].rhs.is_ident()
135+
117136

118137
def test_empty():
119138
path = os.path.join(TEST_DIR, 'Empty.bp')

0 commit comments

Comments
 (0)