Package: util-linux / 2.25.2-6

verbose-tests.patch Patch series | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
From: Andreas Henriksson <andreas@fatal.se>
Date: Wed, 30 Jul 2014 14:28:17 +0200
Subject: verbose-tests

Enable verbose tests and print content of failing tests output file.
---
 tests/Makemodule.am |  2 +-
 tests/functions.sh  | 11 +++++++++++
 2 files changed, 12 insertions(+), 1 deletion(-)

diff --git a/tests/Makemodule.am b/tests/Makemodule.am
index 61798c9..efdc5b0 100644
--- a/tests/Makemodule.am
+++ b/tests/Makemodule.am
@@ -13,7 +13,7 @@ clean-local-tests:
 
 CLEAN_LOCALS += clean-local-tests
 
-TS_OPTS = --nonroot
+TS_OPTS = --nonroot --verbose
 TS_COMMAND = $(top_srcdir)/tests/run.sh \
 	--srcdir=$(abs_top_srcdir) --builddir=$(abs_top_builddir) \
 	--parallel $(TS_OPTS)
diff --git a/tests/functions.sh b/tests/functions.sh
index 6ac59c4..b0c0bfe 100644
--- a/tests/functions.sh
+++ b/tests/functions.sh
@@ -94,6 +94,17 @@ function ts_failed_subtest {
 		ts_report " $msg ($1)"
 	fi
 
+	if [ "$TS_VERBOSE" = "yes" ]; then
+		echo ========= script: $TS_SCRIPT =================
+		echo ================= OUTPUT =====================
+		cat -n $TS_OUTPUT
+		echo ================= EXPECTED ===================
+		cat -n $TS_EXPECTED
+		echo ================= O/E diff ===================
+		diff -u $TS_OUTPUT $TS_EXPECTED
+		echo ==============================================
+	fi
+
 	return $ret
 }