[contrib] compare_tests: Print number of tests

Message ID CAKdteOYPwrbjb2Axq94E+LyUYkKSz0mWBkgU1q5oC=uXDtKK+g@mail.gmail.com
State New
Headers show
Series
  • [contrib] compare_tests: Print number of tests
Related show

Commit Message

Christophe Lyon July 12, 2018, 8:41 a.m.
Hi,

It can be useful to print the number of tests in each category, eg:
Tests that now work, but didn't before (65 tests):
instead of
Tests that now work, but didn't before:

This small patch does that.

OK?

Thanks,

Christophe
contrib/ChangeLog:

2018-07-12  Christophe Lyon  <christophe.lyon@linaro.org>

	* compare_tests: Print number of tests in each category.

Comments

Jeff Law July 12, 2018, 4:49 p.m. | #1
On 07/12/2018 02:41 AM, Christophe Lyon wrote:
> Hi,
> 
> It can be useful to print the number of tests in each category, eg:
> Tests that now work, but didn't before (65 tests):
> instead of
> Tests that now work, but didn't before:
> 
> This small patch does that.
> 
> OK?
> 
> Thanks,
> 
> Christophe
> 
> 
> compare_tests.chlog.txt
> 
> 
> contrib/ChangeLog:
> 
> 2018-07-12  Christophe Lyon  <christophe.lyon@linaro.org>
> 
> 	* compare_tests: Print number of tests in each category.
OK
jeff

Patch

diff --git a/contrib/compare_tests b/contrib/compare_tests
index 51a3719..2dfa864 100755
--- a/contrib/compare_tests
+++ b/contrib/compare_tests
@@ -129,7 +129,8 @@  grep '^PASS' "$before_s" | sed 's/^[^:]*:[ 	]//' | comm -12 $tmp1 - >$tmp2
 
 grep -s . $tmp2 >/dev/null
 if [ $? = 0 ]; then
-	echo "Tests that now fail, but worked before:"
+	num=`cat $tmp2 | wc -l`
+	echo "Tests that now fail, but worked before ($num tests):"
 	echo
 	cat $tmp2
 	echo
@@ -141,7 +142,8 @@  grep '^FAIL' "$before_s" | sed 's/^[^:]*:[ 	]//' | comm -12 $tmp1 - >$tmp2
 
 grep -s . $tmp2 >/dev/null
 if [ $? = 0 ]; then
-	echo "Tests that now work, but didn't before:"
+	num=`cat $tmp2 | wc -l`
+	echo "Tests that now work, but didn't before ($num tests):"
 	echo
 	cat $tmp2
 	[ -n "$strict" ] && echo "Strict test fails" && exit_status=1
@@ -153,7 +155,8 @@  grep '^[PF]A[SI][SL]' "$before_s" | sed 's/^[^:]*:[ 	]//' | comm -23 $tmp1 - >$t
 
 grep -s . $tmp2 >/dev/null
 if [ $? = 0 ]; then
-	echo "New tests that FAIL:"
+	num=`cat $tmp2 | wc -l`
+	echo "New tests that FAIL ($num tests):"
 	echo
 	cat $tmp2
 	echo
@@ -165,7 +168,8 @@  grep '^[PF]A[SI][SL]' "$before_s" | sed 's/^[^:]*:[ 	]//' | comm -23 $tmp1 - >$t
 
 grep -s . $tmp2 >/dev/null
 if [ $? = 0 ]; then
-	echo "New tests that PASS:"
+	num=`cat $tmp2 | wc -l`
+	echo "New tests that PASS ($num tests):"
 	echo
 	cat $tmp2
 	[ -n "$strict" ] && echo "Strict test fails" && exit_status=1
@@ -177,7 +181,8 @@  grep '^PASS' "$before_s" | sed 's/^[^:]*:[ 	]//' | comm -13 $tmp1 - >$tmp2
 
 grep -s . $tmp2 >/dev/null
 if [ $? = 0 ]; then
-	echo "Old tests that passed, that have disappeared: (Eeek!)"
+	num=`cat $tmp2 | wc -l`
+	echo "Old tests that passed, that have disappeared ($num tests): (Eeek!)"
 	echo
 	cat $tmp2
 	[ -n "$strict" ] && echo "Strict test fails" && exit_status=1
@@ -189,7 +194,8 @@  grep '^FAIL' "$before_s" | sed 's/^[^:]*:[ 	]//' | comm -13 $tmp1 - >$tmp2
 
 grep -s . $tmp2 >/dev/null
 if [ $? = 0 ]; then
-	echo "Old tests that failed, that have disappeared: (Eeek!)"
+	num=`cat $tmp2 | wc -l`
+	echo "Old tests that failed, that have disappeared ($num tests): (Eeek!)"
 	echo
 	cat $tmp2
 	[ -n "$strict" ] && echo "Strict test fails" && exit_status=1