coreutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH 15/17] maint: fix syntax checks 'sc_root_tests'


From: Stefano Lattarini
Subject: [PATCH 15/17] maint: fix syntax checks 'sc_root_tests'
Date: Sun, 2 Sep 2012 21:55:17 +0200

* cfg.mk: Don't work by trying to parse the (now gone) file
'tests/Makefile.am'; rather, look at the contents of the make
variable $(all_root_test).  Fix few unrelated cosmetic issues
while at it.
---
 cfg.mk | 19 +++++--------------
 1 file changed, 5 insertions(+), 14 deletions(-)

diff --git a/cfg.mk b/cfg.mk
index eeb271c..9d36fd2 100644
--- a/cfg.mk
+++ b/cfg.mk
@@ -94,21 +94,12 @@ sc_prohibit_jm_in_m4:
 
 # Ensure that each root-requiring test is run via the "check-root" rule.
 sc_root_tests:
-       @if test -d tests \
-             && grep check-root tests/Makefile.am>/dev/null 2>&1; then \
-       t1=sc-root.expected; t2=sc-root.actual;                         \
-       grep -nl '^ *require_root_$$'                                   \
-         $$($(VC_LIST) tests) |sed s,tests/,, |sort > $$t1;            \
-       sed -n '/^root_tests =[  ]*\\$$/,/[^\]$$/p'                     \
-         $(srcdir)/tests/Makefile.am                                   \
-           | sed 's/^  *//;/^root_tests =/d'                           \
-           | tr -s '\012\\' '  ' | fmt -1 | sort > $$t2;               \
-       diff -u $$t1 $$t2 || diff=1 || diff=;                           \
+       @t1=sc-root.expected; t2=sc-root.actual;                        \
+       grep -nl '^ *require_root_$$' `$(VC_LIST) tests` | sort > $$t1; \
+       for t in $(all_root_tests); do echo $$t; done | sort > $$t2;    \
+       st=0; diff -u $$t1 $$t2 || st=1;                                \
        rm -f $$t1 $$t2;                                                \
-       test "$$diff"                                                   \
-         && { echo 'tests/Makefile.am: missing check-root action'>&2;  \
-              exit 1; } || :;                                          \
-       fi
+       exit $$st
 
 # Ensure that all version-controlled test cases are listed in $(all_tests).
 sc_tests_list_consistency:
-- 
1.7.12




reply via email to

[Prev in Thread] Current Thread [Next in Thread]