Update.
authorUlrich Drepper <drepper@redhat.com>
Sun, 16 Jul 2000 07:30:42 +0000 (07:30 +0000)
committerUlrich Drepper <drepper@redhat.com>
Sun, 16 Jul 2000 07:30:42 +0000 (07:30 +0000)
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.

io/tst-getcwd.c
localedata/ChangeLog
localedata/Makefile
localedata/sort-test.sh
localedata/tst-fmon.sh
localedata/tst-rpmatch.sh
stdlib/Makefile

index 3dac2fb..4b5bc62 100644 (file)
@@ -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)
index 186160d..710da90 100644 (file)
@@ -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...
index cd6e39d..87216d2 100644 (file)
@@ -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
 
index 6c22524..c4a698b 100644 (file)
@@ -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
index 99c5cc6..b9df5a8 100755 (executable)
 # 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
index d3eb593..5900c94 100755 (executable)
@@ -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
index 9eededd..de6800a 100644 (file)
@@ -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