Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

Update the verify_exported script to include the symbols for ICU data #7647

Merged
merged 1 commit into from
Jan 30, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions testing/symbols/pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
name: verify_exported
dependencies:
path: 1.6.2
collection: 1.14.11
24 changes: 14 additions & 10 deletions testing/symbols/verify_exported.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import 'dart:convert';
import 'dart:io';

import 'package:path/path.dart' as p;
import 'package:collection/collection.dart' show MapEquality;

// This script verifies that the release binaries only export the expected
// symbols.
Expand Down Expand Up @@ -92,16 +93,19 @@ int _checkAndroid(String outPath, String nmPath, Iterable<String> builds) {
continue;
}
final Iterable<NmEntry> entries = NmEntry.parse(nmResult.stdout);
if (entries.isEmpty) {
print('ERROR: $libFlutter exports no symbol');
print(' Expected exactly one symbol "JNI_OnLoad" of type "T", but got none.');
failures++;
} else if (entries.length > 1 || entries.first.type != 'T' || entries.first.name != 'JNI_OnLoad') {
print('ERROR: $libFlutter exports unexpected symbols.');
print(' Expected exactly one symbol "JNI_OnLoad" of type "T", but got instead:');
print(entries.fold<String>('', (String previous, NmEntry entry) {
return '${previous == '' ? '' : '$previous\n'} ${entry.type} ${entry.name}';
}));
final Map<String, String> entryMap = Map.fromIterable(
entries,
key: (entry) => entry.name,
value: (entry) => entry.type);
final Map<String, String> expectedSymbols = {
'JNI_OnLoad': 'T',
'_binary_icudtl_dat_size': 'A',
'_binary_icudtl_dat_start': 'D',
};
if (!MapEquality<String, String>().equals(entryMap, expectedSymbols)) {
print('ERROR: $libFlutter exports the wrong symbols');
print(' Expected $expectedSymbols');
print(' Library has $entryMap.');
failures++;
} else {
print('OK: $libFlutter');
Expand Down