1#!/bin/bash
2
3set -eu
4
5# Ignore passing tests.
6files=($(
7  grep -e 'failures=.[^0]' -e 'errors=.[^0]' {android/,}*/target/surefire-reports/*.xml -l |
8    sed -e 's/TEST-//; s/.xml$//'))
9
10for file in "${files[@]}"; do
11  # Dump file-output.txt and file.txt.
12  # Use tail to include a filename header before each (and maybe truncate).
13  tail -n 9999 "${file}"*.txt
14done
15