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.
This commit is contained in:
Ulrich Drepper 2000-07-16 07:30:42 +00:00
parent e0ea35a3f7
commit ca41028b16
7 changed files with 61 additions and 48 deletions

View 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)

View 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...

View 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

View 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

View File

@ -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

View File

@ -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

View 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