print intermediate and raw A/B results when not silent (#54676)

* print intermediate A/B results when not silent
* print raw A/B results when in loud mode
* add tests; handle missing metrics more gracefully
* use less fancy section header on Windows
This commit is contained in:
Yegor
2020-04-16 14:36:42 -07:00
committed by GitHub
parent ce83aaf38d
commit 20803507fd
6 changed files with 187 additions and 18 deletions

View File

@@ -189,11 +189,18 @@ void mkdirs(Directory directory) {
bool exists(FileSystemEntity entity) => entity.existsSync();
void section(String title) {
title = '╡ ••• $title ••• ╞';
final String line = '═' * math.max((80 - title.length) ~/ 2, 2);
String output = '$line$title$line';
if (output.length == 79)
output += '═';
String output;
if (Platform.isWindows) {
// Windows doesn't cope well with characters produced for *nix systems, so
// just output the title with no decoration.
output = title;
} else {
title = '╡ ••• $title ••• ╞';
final String line = '═' * math.max((80 - title.length) ~/ 2, 2);
output = '$line$title$line';
if (output.length == 79)
output += '═';
}
print('\n\n$output\n');
}