[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH] maint: add new syntax-check rule to prohibit use of skip_
From: |
Jim Meyering |
Subject: |
[PATCH] maint: add new syntax-check rule to prohibit use of skip_ |
Date: |
Fri, 13 May 2011 18:58:16 +0200 |
Jim Meyering wrote:
> (as with any global change like this,
> I'll write a syntax checking rule, too)
>
> Subject: [PATCH] tests: use skip_test_, not skip_
And here it is:
>From 76f49e601eb630d9f3d7c34676f38a5083f318fc Mon Sep 17 00:00:00 2001
From: Jim Meyering <address@hidden>
Date: Fri, 13 May 2011 18:57:31 +0200
Subject: [PATCH] maint: add new syntax-check rule to prohibit use of skip_
* cfg.mk (sc_prohibit_skip_): New rule.
* tests/init.cfg (skip_test_): Add a comment.
---
cfg.mk | 6 ++++++
tests/init.cfg | 3 +++
2 files changed, 9 insertions(+), 0 deletions(-)
diff --git a/cfg.mk b/cfg.mk
index 9869eba..15cf98c 100644
--- a/cfg.mk
+++ b/cfg.mk
@@ -221,6 +221,12 @@ sc_prohibit_emacs__indent_tabs_mode__setting:
halt='use of emacs indent-tabs-mode: setting' \
$(_sc_search_regexp)
+# Use skip_test_ rather than init.sh's "skip_" function.
+sc_prohibit_skip_:
+ @prohibit=' skip[_] ' \
+ halt="use init.cfg's skip_test_, not init.sh's skip_" \
+ $(_sc_search_regexp)
+
# Ensure that each file that contains fail=1 also contains fail=0.
# Otherwise, setting file=1 in the environment would make tests fail
# unexpectedly.
diff --git a/tests/init.cfg b/tests/init.cfg
index 55d7571..3a59bbd 100644
--- a/tests/init.cfg
+++ b/tests/init.cfg
@@ -34,6 +34,9 @@ sanitize_path_()
export PATH
}
+# Use this function rather than init.sh's skip_.
+# The "skip_" function emits its diagnostic only to one stream.
+# This one emits it both to the tty and to the log file.
skip_test_()
{
echo "$0: skipping test: $@" | head -1 1>&9
--
1.7.5.1.398.g86d1d