diff options
-rw-r--r-- | io/tst-getcwd.c | 8 | ||||
-rw-r--r-- | localedata/ChangeLog | 7 | ||||
-rw-r--r-- | localedata/Makefile | 52 | ||||
-rw-r--r-- | localedata/sort-test.sh | 14 | ||||
-rwxr-xr-x | localedata/tst-fmon.sh | 14 | ||||
-rwxr-xr-x | localedata/tst-rpmatch.sh | 10 | ||||
-rw-r--r-- | stdlib/Makefile | 4 |
7 files changed, 61 insertions, 48 deletions
diff --git a/io/tst-getcwd.c b/io/tst-getcwd.c index 3dac2fbe6b..4b5bc62c7c 100644 --- a/io/tst-getcwd.c +++ b/io/tst-getcwd.c @@ -120,12 +120,20 @@ getcwd (NULL, sbs) = \"%s\", getcwd (thepath, sizeof thepath) = \"%s\"\n", free (bufs[2]); } + memset (thepath, '\xfe', sizeof (thepath)); if (getcwd (thepath, len) != NULL) { puts ("getcwd (thepath, len) didn't failed"); return 1; } + for (i = len; i < sizeof thepath; ++i) + if (thepath[i] != '\xfe') + { + puts ("thepath[i] != '\xfe'"); + return 1; + } + /* Now test handling of correctly sized buffers. */ bufs[0] = getcwd (NULL, len + 1); if (bufs[0] == NULL) diff --git a/localedata/ChangeLog b/localedata/ChangeLog index 186160dfaa..710da90b55 100644 --- a/localedata/ChangeLog +++ b/localedata/ChangeLog @@ -1,3 +1,10 @@ +2000-07-16 Ulrich Drepper <drepper@redhat.com> + + * Makefile: Rewrite rules for tests to run them only when necessary. + * sort-test.sh: Produce output for failed tests. + * tst-fmon.sh: Likewise. + * tst-rpmatch.sh: Likewise. + 2000-07-14 Ulrich Drepper <drepper@redhat.com> * tst-ctype-de_DE.in: Renamed to... diff --git a/localedata/Makefile b/localedata/Makefile index cd6e39da9b..87216d296f 100644 --- a/localedata/Makefile +++ b/localedata/Makefile @@ -134,31 +134,37 @@ $(addprefix $(objpfx),$(CTYPE_FILES)): %: \ $(addsuffix .out,$(addprefix $(objpfx),$(locale_test_suite))): %: \ $(addprefix $(objpfx),$(CTYPE_FILES)) -.PHONY: do-collate-test do-tst-fmon do-tst-locale do-tst-rpmatch do-tst-trans \ - do-tst-mbswcs do-tst-ctype -tests: do-collate-test do-tst-fmon do-tst-locale do-tst-rpmatch do-tst-trans \ - do-tst-mbswcs do-tst-ctype -do-collate-test: sort-test.sh $(objpfx)collate-test $(objpfx)xfrm-test \ - $(test-input-data) $(addprefix $(objpfx),$(CTYPE_FILES)) - $(SHELL) -e $< $(common-objpfx) '$(run-program-prefix)' $(test-input) -do-tst-fmon: tst-fmon.sh $(objpfx)tst-fmon tst-fmon.data do-collate-test \ - $(addprefix $(objpfx),$(CTYPE_FILES)) - $(SHELL) -e $< $(common-objpfx) '$(run-program-prefix)' tst-fmon.data -do-tst-locale: tst-locale.sh $(common-objpfx)locale/localedef $(ld-test-srcs) \ - $(addprefix $(objpfx),$(CTYPE_FILES)) - $(SHELL) -e $< $(common-objpfx) '$(built-program-cmd)' -do-tst-rpmatch: tst-rpmatch.sh $(objpfx)tst-rpmatch do-tst-fmon \ - $(addprefix $(objpfx),$(CTYPE_FILES)) - $(SHELL) -e $< $(common-objpfx) '$(built-program-cmd)' -do-tst-trans: tst-trans.sh $(objpfx)tst-trans \ - $(addprefix $(objpfx),$(CTYPE_FILES)) +tests: $(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)sort-test.out: sort-test.sh $(objpfx)collate-test $(objpfx)xfrm-test \ + $(test-input-data) $(addprefix $(objpfx),$(CTYPE_FILES)) + $(SHELL) -e $< $(common-objpfx) '$(run-program-prefix)' $(test-input) \ + > $@ +$(objpfx)tst-fmon.out: tst-fmon.sh $(objpfx)tst-fmon tst-fmon.data \ + $(objpfx)sort-test.out \ + $(addprefix $(objpfx),$(CTYPE_FILES)) + $(SHELL) -e $< $(common-objpfx) '$(run-program-prefix)' tst-fmon.data \ + > $@ +$(objpfx)tst-locale.out: tst-locale.sh $(common-objpfx)locale/localedef \ + $(ld-test-srcs) $(addprefix $(objpfx),$(CTYPE_FILES)) + $(SHELL) -e $< $(common-objpfx) '$(built-program-cmd)' > $@ +$(objpfx)tst-rpmatch.out: tst-rpmatch.sh $(objpfx)tst-rpmatch \ + $(objpfx)tst-fmon.out \ + $(addprefix $(objpfx),$(CTYPE_FILES)) + $(SHELL) -e $< $(common-objpfx) '$(built-program-cmd)' > $@ +$(objpfx)tst-trans.out: tst-trans.sh $(objpfx)tst-trans \ + $(addprefix $(objpfx),$(CTYPE_FILES)) $(SHELL) -e $< $(common-objpfx) '$(run-program-prefix)' -do-tst-mbswcs: tst-mbswcs.sh $(objpfx)tst-mbswcs1 $(objpfx)tst-mbswcs2 \ - $(objpfx)tst-mbswcs3 $(objpfx)tst-mbswcs4 $(objpfx)tst-mbswcs5 \ - $(addprefix $(objpfx),$(CTYPE_FILES)) +$(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) -e $< $(common-objpfx) '$(run-program-prefix)' -do-tst-ctype: tst-ctype.sh $(objpfx)tst-ctype do-collate-test \ - $(addprefix $(objpfx),$(CTYPE_FILES)) +$(objpfx)tst-ctype.out: tst-ctype.sh $(objpfx)tst-ctype \ + $(objpfx)sort-test.out \ + $(addprefix $(objpfx),$(CTYPE_FILES)) $(SHELL) -e $< $(common-objpfx) '$(built-program-cmd)' endif diff --git a/localedata/sort-test.sh b/localedata/sort-test.sh index 6c22524612..c4a698b5b2 100644 --- a/localedata/sort-test.sh +++ b/localedata/sort-test.sh @@ -10,18 +10,24 @@ here=`pwd` # Run collation tests. status=0 for l in $lang; do + here=0 cns=`echo $l | sed 's/\(.*\)[.][^.]*/\1/'` LOCPATH=${common_objpfx}localedata GCONV_PATH=${common_objpfx}/iconvdata \ LC_ALL=$l ${run_program_prefix} \ ${common_objpfx}localedata/collate-test $id < $cns.in \ - > ${common_objpfx}localedata/$cns.out || status=1 - cmp -s $cns.in ${common_objpfx}localedata/$cns.out || status=1 + > ${common_objpfx}localedata/$cns.out || here=1 + cmp -s $cns.in ${common_objpfx}localedata/$cns.out || here=1 LOCPATH=${common_objpfx}localedata GCONV_PATH=${common_objpfx}/iconvdata \ LC_ALL=$l ${run_program_prefix} \ ${common_objpfx}localedata/xfrm-test $id < $cns.in \ - > ${common_objpfx}localedata/$cns.xout || status=1 - cmp -s $cns.in ${common_objpfx}localedata/$cns.xout || status=1 + > ${common_objpfx}localedata/$cns.xout || here=1 + cmp -s $cns.in ${common_objpfx}localedata/$cns.xout || here=1 + if test $here -eq 0; then + echo "$l OK" + else + status=1 + fi done exit $status diff --git a/localedata/tst-fmon.sh b/localedata/tst-fmon.sh index 99c5cc6801..b9df5a80e8 100755 --- a/localedata/tst-fmon.sh +++ b/localedata/tst-fmon.sh @@ -19,11 +19,6 @@ # not, write to the Free Software Foundation, Inc., # 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -DEBUG=0 -case $1 in --d) DEBUG=1; shift ;; -esac - common_objpfx=$1 run_program_prefix=$2 datafile=$3 @@ -51,16 +46,11 @@ while IFS=" " read locale format value expect; do ${run_program_prefix} ${common_objpfx}localedata/tst-fmon \ "$locale" "$format" "$value" "$expect" if [ $? -eq 0 ]; then - if [ $DEBUG -eq 1 ]; then - echo "Locale: \"${locale}\" Format: \"${format}\"" \ - "Value: \"${value}\" Expect: \"${expect}\" passed" - fi + echo "Locale: \"${locale}\" Format: \"${format}\"" \ + "Value: \"${value}\" Expect: \"${expect}\" passed" else echo "Locale: \"${locale}\" Format: \"${format}\"" \ "Value: \"${value}\" Expect: \"${expect}\" failed" - if [ $DEBUG -eq 0 ]; then - exit 1 - fi fi fi done < $datafile diff --git a/localedata/tst-rpmatch.sh b/localedata/tst-rpmatch.sh index d3eb593c71..5900c94544 100755 --- a/localedata/tst-rpmatch.sh +++ b/localedata/tst-rpmatch.sh @@ -28,12 +28,12 @@ while IFS=\& read locale string result dummy; do LOCPATH=${common_objpfx}localedata \ GCONV_PATH=${common_objpfx}/iconvdata \ ${tst_rpmatch} $locale $string $result \ - || exit 1 + || { echo "$locale $string $result FAILED"; exit 1; } fi done <<EOF #& These are the tests for rpmatch in glibc. Each line contains one test, #& comments start with #& in the first column. The fields are separated -#& by paragraph signs and contain: the locale, the string, the expected +#& by ampersand signs and contain: the locale, the string, the expected #& return value of rpmatch(3). If the test fails, test-rpmatch prints #& all these informations C&Yes&1 @@ -57,9 +57,3 @@ de_DE.ISO-8859-1&Nein&0 de_DE.ISO-8859-1&Fehler&-1 de_DE.ISO-8859-1&jein&1 EOF - -rc=$? -if [ $rc -eq 1 ]; then - echo "Errors" -fi -exit $rc diff --git a/stdlib/Makefile b/stdlib/Makefile index 9eededd095..de6800ae8d 100644 --- a/stdlib/Makefile +++ b/stdlib/Makefile @@ -130,7 +130,9 @@ endif test-canon-ARGS = --test-dir=${common-objpfx}stdlib # Run a test on the header files we use. -tests: $(objpfx)isomac +tests: $(objpfx)isomac.out + +$(objpfx)isomac.out: $(objpfx)isomac $(dir $<)$(notdir $<) '$(CC)' '-I../include -I.. $(+sysdep-includes)' > $<.out $(objpfx)isomac: isomac.c |