]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
tests: add --show-diff
authorKarel Zak <kzak@redhat.com>
Thu, 16 Feb 2017 13:14:54 +0000 (14:14 +0100)
committerKarel Zak <kzak@redhat.com>
Thu, 16 Feb 2017 13:14:54 +0000 (14:14 +0100)
Signed-off-by: Karel Zak <kzak@redhat.com>
.travis-functions.sh
tests/functions.sh
tests/run.sh

index 11e7707bb8eace07a28cbfc61af70203e816c416..898f57b84a8e4841aaa3a004f4dbabe9a5e32e75 100755 (executable)
@@ -31,7 +31,7 @@ function xconfigure
 
 function check_nonroot
 {
-       local opts="$MAKE_CHECK_OPTS"
+       local opts="$MAKE_CHECK_OPTS --show-diff"
 
        xconfigure \
                --disable-use-tty-group \
@@ -47,7 +47,7 @@ function check_nonroot
 
 function check_root
 {
-       local opts="$MAKE_CHECK_OPTS --parallel=1"
+       local opts="$MAKE_CHECK_OPTS --parallel=1 --show-diff"
 
        xconfigure \
                --enable-all-programs \
index 34d966a6e40884b0ffc1e04ee2c81830716d3900..b93522c02ffc894be3a06d28076844a2faf1776d 100644 (file)
@@ -273,6 +273,7 @@ function ts_init_env {
        ts_init_core_env
 
        TS_VERBOSE=$(ts_has_option "verbose" "$*")
+       TS_SHOWDIFF=$(ts_has_option "show-diff" "$*")
        TS_PARALLEL=$(ts_has_option "parallel" "$*")
        TS_KNOWN_FAIL=$(ts_has_option "known-fail" "$*")
        TS_SKIP_LOOPDEVS=$(ts_has_option "skip-loopdevs" "$*")
@@ -399,6 +400,13 @@ function ts_gen_diff {
 
        if [ $? -ne 0 ] || [ -s $TS_DIFF ]; then
                res=1
+               if [ "$TS_SHOWDIFF" == "yes" ]; then
+                       echo
+                       echo "diff-{{{"
+                       cat $TS_DIFF
+                       echo "}}}-diff"
+                       echo
+               fi
        else
                rm -f $TS_DIFF;
        fi
index 5e8d286c34c2c904f2eb191335e1a6b2c4e7a986..071fb8f5ffb5e43990c4038c442ce1aec38eb3d5 100755 (executable)
@@ -46,6 +46,7 @@ while [ -n "$1" ]; do
        --force |\
        --fake |\
        --memcheck |\
+       --show-diff |\
        --verbose  |\
        --skip-loopdevs |\
        --parsable)
@@ -82,6 +83,7 @@ while [ -n "$1" ]; do
                echo "  --fake            do not run, setup tests only"
                echo "  --memcheck        run with valgrind"
                echo "  --verbose         verbose mode"
+               echo "  --show-diff       show diff from failed tests"
                echo "  --nonroot         ignore test suite if user is root"
                echo "  --srcdir=<path>   autotools top source directory"
                echo "  --builddir=<path> autotools top build directory"