diff mbox

Remove special makefile rules / .sh files for some localedata tests

Message ID Pine.LNX.4.64.1406091644080.30530@digraph.polyomino.org.uk
State New
Headers show

Commit Message

Joseph Myers June 9, 2014, 4:44 p.m. UTC
The localedata tests tst-mbswcs and tst-wctype use custom .sh scripts
and makefile rules, but have no need to do so.  tst-mbswcs.sh runs a
series of test programs in succession (and nothing special is done
with the output of the programs); this patch makes the separate tests
into ordinary tests run directly by the usual makefile rules.
tst-wctype.sh runs one test with an environment variable and input
redirection; generic makefile rules also cover that, so again this
patch converts it into an ordinary test.  (The makefile dependency of
tst-wctype.out on sort-test.out that this patch removes appears to be
a cut-and-paste error; the test does not appear to use that file.
There is already a generic dependency of ordinary tests in this
directory on $(addprefix $(objpfx),$(CTYPE_FILES)).)

Tested x86_64.

localedata/ChangeLog:
2014-06-09  Joseph Myers  <joseph@codesourcery.com>

	* Makefile (test-srcs): Remove tst-mbswcs1, tst-mbswcs2,
	tst-mbswcs3, tst-mbswcs4, tst-mbswcs5 and tst-wctype.
	(generated): Remove tst-mbswcs.out.
	(tests): Add tst-mbswcs1, tst-mbswcs2, tst-mbswcs3, tst-mbswcs4,
	tst-mbswcs5 and tst-wctype.
	(tests-special): Remove $(objpfx)tst-mbswcs.out and
	$(objpfx)tst-wctype.out.
	($(objpfx)tst-mbswcs.out): Remove rule.
	($(objpfx)tst-wctype.out): Likewise.
	(tst-wctype-ENV): New variable.
	* tst-mbswcs.sh: Remove file.
	* tst-wctype.sh: Likewise.

Comments

Andreas Schwab June 9, 2014, 6 p.m. UTC | #1
"Joseph S. Myers" <joseph@codesourcery.com> writes:

> localedata/ChangeLog:
> 2014-06-09  Joseph Myers  <joseph@codesourcery.com>
>
> 	* Makefile (test-srcs): Remove tst-mbswcs1, tst-mbswcs2,
> 	tst-mbswcs3, tst-mbswcs4, tst-mbswcs5 and tst-wctype.
> 	(generated): Remove tst-mbswcs.out.
> 	(tests): Add tst-mbswcs1, tst-mbswcs2, tst-mbswcs3, tst-mbswcs4,
> 	tst-mbswcs5 and tst-wctype.
> 	(tests-special): Remove $(objpfx)tst-mbswcs.out and
> 	$(objpfx)tst-wctype.out.
> 	($(objpfx)tst-mbswcs.out): Remove rule.
> 	($(objpfx)tst-wctype.out): Likewise.
> 	(tst-wctype-ENV): New variable.
> 	* tst-mbswcs.sh: Remove file.
> 	* tst-wctype.sh: Likewise.

This is ok.

Andreas.
diff mbox

Patch

diff --git a/localedata/Makefile b/localedata/Makefile
index 6dc2524..76eeedf 100644
--- a/localedata/Makefile
+++ b/localedata/Makefile
@@ -34,8 +34,7 @@  vpath %.h tests-mbwc
 
 
 test-srcs := collate-test xfrm-test tst-fmon tst-rpmatch tst-trans \
-	     tst-mbswcs1 tst-mbswcs2 tst-mbswcs3 tst-mbswcs4 tst-mbswcs5 \
-	     tst-ctype tst-wctype tst-langinfo tst-langinfo-static tst-numeric
+	     tst-ctype tst-langinfo tst-langinfo-static tst-numeric
 test-input := de_DE.ISO-8859-1 en_US.ISO-8859-1 da_DK.ISO-8859-1 \
 	      hr_HR.ISO-8859-2 sv_SE.ISO-8859-1 tr_TR.UTF-8 fr_FR.UTF-8 \
 	      si_LK.UTF-8
@@ -52,7 +51,7 @@  fmon-tests = n01y12 n02n40 n10y31 n11y41 n12y11 n20n32 n30y20 n41n00 \
 	     y01y10 y02n22 y22n42 y30y21 y32n31 y40y00 y42n21
 
 generated += $(test-input) $(test-output) sort-test.out tst-locale.out \
-	     tst-mbswcs.out tst-leaks.mtrace mtrace-tst-leaks.out
+	     tst-leaks.mtrace mtrace-tst-leaks.out
 generated-dirs += $(ld-test-names) tt_TT de_DE.437			\
 		  $(addprefix tstfmon_,$(fmon-tests))			\
 
@@ -73,8 +72,9 @@  locale_test_suite := tst_iswalnum tst_iswalpha tst_iswcntrl            \
 		     tst_wctype tst_wcwidth
 
 tests = $(locale_test_suite) tst-digits tst-setlocale bug-iconv-trans \
-	tst-leaks tst-mbswcs6 tst-xlocale1 tst-xlocale2 bug-usesetlocale \
-	tst-strfmon1 tst-sscanf bug-setlocale1 tst-setlocale2
+	tst-leaks tst-mbswcs1 tst-mbswcs2 tst-mbswcs3 tst-mbswcs4 tst-mbswcs5 \
+	tst-mbswcs6 tst-xlocale1 tst-xlocale2 bug-usesetlocale \
+	tst-strfmon1 tst-sscanf bug-setlocale1 tst-setlocale2 tst-wctype
 tests-static = bug-setlocale1-static
 tests += $(tests-static)
 ifeq (yes,$(build-shared))
@@ -93,8 +93,7 @@  tests: $(objdir)/iconvdata/gconv-modules
 
 tests-special += $(objpfx)sort-test.out $(objpfx)tst-fmon.out \
 		 $(objpfx)tst-locale.out $(objpfx)tst-rpmatch.out \
-		 $(objpfx)tst-trans.out $(objpfx)tst-mbswcs.out \
-		 $(objpfx)tst-ctype.out $(objpfx)tst-wctype.out \
+		 $(objpfx)tst-trans.out $(objpfx)tst-ctype.out \
 		 $(objpfx)tst-langinfo.out $(objpfx)tst-langinfo-static.out \
 		 $(objpfx)tst-numeric.out
 tests-static += tst-langinfo-static
@@ -189,24 +188,12 @@  $(objpfx)tst-trans.out: tst-trans.sh $(objpfx)tst-trans \
 		 '$(test-program-prefix-before-env)' \
 		 '$(test-program-prefix-after-env)'; \
 	$(evaluate-test)
-$(objpfx)tst-mbswcs.out: tst-mbswcs.sh $(objpfx)tst-mbswcs1 \
-			 $(objpfx)tst-mbswcs2 $(objpfx)tst-mbswcs3 \
-			 $(objpfx)tst-mbswcs4 $(objpfx)tst-mbswcs5 \
-			 $(addprefix $(objpfx),$(CTYPE_FILES))
-	$(SHELL) $< $(common-objpfx) '$(test-program-prefix)'; \
-	$(evaluate-test)
 $(objpfx)tst-ctype.out: tst-ctype.sh $(objpfx)tst-ctype \
 			$(objpfx)sort-test.out \
 			$(addprefix $(objpfx),$(CTYPE_FILES))
 	$(SHELL) $< $(common-objpfx) '$(test-program-cmd-before-env)' \
 		 '$(run-program-env)' '$(test-program-cmd-after-env)'; \
 	$(evaluate-test)
-$(objpfx)tst-wctype.out: tst-wctype.sh $(objpfx)tst-wctype \
-			$(objpfx)sort-test.out tst-wctype.input \
-			$(addprefix $(objpfx),$(CTYPE_FILES))
-	$(SHELL) $< $(common-objpfx) '$(test-program-cmd-before-env)' \
-		 '$(run-program-env)' '$(test-program-cmd-after-env)'; \
-	$(evaluate-test)
 $(objpfx)tst-langinfo.out: tst-langinfo.sh $(objpfx)tst-langinfo \
 			$(objpfx)sort-test.out \
 			$(addprefix $(objpfx),$(CTYPE_FILES))
@@ -250,6 +237,7 @@  $(INSTALL-SUPPORTED-LOCALES): install-locales-dir
 	echo ' done'; \
 
 tst-setlocale-ENV = LC_ALL=ja_JP.EUC-JP
+tst-wctype-ENV = LC_ALL=ja_JP.EUC-JP
 
 tst-leaks-ENV = MALLOC_TRACE=$(objpfx)tst-leaks.mtrace
 $(objpfx)mtrace-tst-leaks.out: $(objpfx)tst-leaks.out
diff --git a/localedata/tst-mbswcs.sh b/localedata/tst-mbswcs.sh
deleted file mode 100755
index 1cfc482..0000000
--- a/localedata/tst-mbswcs.sh
+++ /dev/null
@@ -1,43 +0,0 @@ 
-#! /bin/sh
-# Testing the implementation of the mb*towc*() and wc*tomb*() functions.
-# Copyright (C) 2000-2014 Free Software Foundation, Inc.
-# This file is part of the GNU C Library.
-
-# The GNU C Library is free software; you can redistribute it and/or
-# modify it under the terms of the GNU Lesser General Public
-# License as published by the Free Software Foundation; either
-# version 2.1 of the License, or (at your option) any later version.
-
-# The GNU C Library is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-# Lesser General Public License for more details.
-
-# You should have received a copy of the GNU Lesser General Public
-# License along with the GNU C Library; if not, see
-# <http://www.gnu.org/licenses/>.
-
-set -e
-
-common_objpfx=$1; shift
-test_program_prefix=$1; shift
-
-status=0
-
-# Run the test programs.
-${test_program_prefix} ${common_objpfx}localedata/tst-mbswcs1 \
-  > ${common_objpfx}localedata/tst-mbswcs.out || status=1
-
-${test_program_prefix} ${common_objpfx}localedata/tst-mbswcs2 \
-  >> ${common_objpfx}localedata/tst-mbswcs.out || status=1
-
-${test_program_prefix} ${common_objpfx}localedata/tst-mbswcs3 \
-  >> ${common_objpfx}localedata/tst-mbswcs.out || status=1
-
-${test_program_prefix} ${common_objpfx}localedata/tst-mbswcs4 \
-  >> ${common_objpfx}localedata/tst-mbswcs.out || status=1
-
-${test_program_prefix} ${common_objpfx}localedata/tst-mbswcs5 \
-  >> ${common_objpfx}localedata/tst-mbswcs.out || status=1
-
-exit $status
diff --git a/localedata/tst-wctype.sh b/localedata/tst-wctype.sh
deleted file mode 100755
index 53b88b5..0000000
--- a/localedata/tst-wctype.sh
+++ /dev/null
@@ -1,33 +0,0 @@ 
-#! /bin/sh
-# Test locale-define character classes.
-# Copyright (C) 1999-2014 Free Software Foundation, Inc.
-# This file is part of the GNU C Library.
-
-# The GNU C Library is free software; you can redistribute it and/or
-# modify it under the terms of the GNU Lesser General Public
-# License as published by the Free Software Foundation; either
-# version 2.1 of the License, or (at your option) any later version.
-
-# The GNU C Library is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-# Lesser General Public License for more details.
-
-# You should have received a copy of the GNU Lesser General Public
-# License along with the GNU C Library; if not, see
-# <http://www.gnu.org/licenses/>.
-
-set -e
-
-common_objpfx=$1
-tst_wctype_before_env=$2
-run_program_env=$3
-tst_wctype_after_env=$4
-
-# Run the test program.
-${tst_wctype_before_env} \
-${run_program_env} \
-LC_ALL=ja_JP.EUC-JP ${tst_wctype_after_env} < tst-wctype.input \
-    > ${common_objpfx}localedata/tst-wctype.out
-
-exit $?