Files
apfstests/tools/compare-failures
T
Dave Chinner f3e65e9150 fstests: convert top level files and tools to SPDX
Scripted conversion, see script in initial SPDX license commit
message. Many files required touch-ups after the script had run
because of the old and widely different formats. most touchups were
to remove excess empty comment lines the script left behind.

Signed-off-by: Dave Chinner <dchinner@redhat.com>
2018-06-09 11:36:01 +10:00

52 lines
1.2 KiB
Bash
Executable File

#!/bin/bash
# SPDX-License-Identifier: GPL-2.0
# Copyright (c) 2017 Red Hat, Inc. All Rights Reserved.
#
# Compare test failures across runs
#
# Takes multiple "results" files as arguments, comprised of the
# stdout from a ./check run, each containing a Failures: line.
#
# Outputs a table of failures for comparison across runs
#
filter_names() {
sed -e s/btrfs/b/ \
-e s/cifs/c/g \
-e s/f2fs/f/g \
-e s/generic/g/g \
-e s/overlay/o/g \
-e s/shared/s/g \
-e s/udf/u/g \
-e s/xfs/x/g
}
# ALLFAILURES: A B C D E F G
# THESEFAILURES: A C D G
# We want to print the header (ALLFAILURES) and then
# if a run didn't fail a particular test, print spaces instead
# All tests that failed in any run, all on one line, unique
ALLFAILURES=`grep -h ^Failures: $* \
| tr " " "\n" \
| sort | uniq \
| filter_names \
| tr "\n" " " \
| sed -e "s/^Failures: //g"`
# Header
echo "Failures:"
echo $ALLFAILURES
echo $ALLFAILURES | sed -e "s/./-/g"
# Per-file failures
for FILE in $*; do
THESEFAILURES=`grep ^Failures: $FILE | filter_names`
for FAILURE in $ALLFAILURES; do
CELL=`echo $THESEFAILURES \
| grep -wo "$FAILURE" || echo $FAILURE | sed -e "s/./ /g"`
echo -n "$CELL "
done
echo $FILE
done