Skip to content

Commit 2ff902f

Browse files
committed
test: check the metadata writer's output byte by byte
The writer and the runtime have to agree on the metadata's layout, and only the device suite checked that, indirectly and on one set of field widths. WriterFormatTest writes a small hand-built tree and reads it back with a parser that knows only the format and fails unless every byte of the value stream belongs to exactly one record. It runs at three sets of widths: one-byte fields, the two- and three-byte ones ordinary apps get, and the widened ones. It covers signatures shared between methods, a 256-type signature (and a 257-type one being refused), a class with only static members, getter-only and setter-only properties, and static fields declared by the class itself and by a base class. The generator's unit tests were not run in CI. runMetadataGeneratorTests runs them, and the pull request workflow now calls it.
1 parent 5776ab3 commit 2ff902f

3 files changed

Lines changed: 528 additions & 0 deletions

File tree

‎.github/workflows/pull_request.yml‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,8 @@ jobs:
162162
run: ./download_v8.sh
163163
- name: SBG tests
164164
run: ./gradlew runSbgTests --stacktrace
165+
- name: Metadata generator tests
166+
run: ./gradlew runMetadataGeneratorTests --stacktrace
165167
- name: Enable KVM
166168
run: |
167169
echo 'KERNEL=="kvm", GROUP="kvm", MODE="0666", OPTIONS+="static_node=kvm"' | sudo tee /etc/udev/rules.d/99-kvm4all.rules

‎build.gradle‎

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -454,6 +454,17 @@ task runSbgTests (type: Exec, dependsOn: 'runAstTests') {
454454
}
455455
}
456456

457+
task runMetadataGeneratorTests (type: Exec) {
458+
doFirst {
459+
workingDir "$TEST_APP_PATH"
460+
if (isWinOs) {
461+
commandLine "cmd", "/c", "gradlew", ":android-metadata-generator:test", "--warning-mode", "all"
462+
} else {
463+
commandLine "./gradlew", ":android-metadata-generator:test", "--warning-mode", "all"
464+
}
465+
}
466+
}
467+
457468
def getRunTestsBuildArguments = { taskName ->
458469
def arguments = []
459470
if (isWinOs) {

0 commit comments

Comments
 (0)