Skip to content

Commit

Permalink
e(u)ptexdir/wcfname.test: add new tests (#136)
Browse files Browse the repository at this point in the history
  • Loading branch information
t-tk committed Jan 15, 2023
1 parent 5105c80 commit bd963a7
Show file tree
Hide file tree
Showing 7 changed files with 185 additions and 9 deletions.
10 changes: 5 additions & 5 deletions source/texk/web2c/Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -4487,7 +4487,7 @@ eptex_ch_srcs = \

# e-pTeX Tests
#
eptex_tests = eptexdir/eptriptest.test eptexdir/pdfprimitive.test eptexdir/epver.test
eptex_tests = eptexdir/eptriptest.test eptexdir/pdfprimitive.test eptexdir/epver.test eptexdir/wcfname.test
uptex_cppflags = $(PTEXENC_INCLUDES) $(AM_CPPFLAGS) $(ZLIB_INCLUDES)
uptex_ldadd = libukanji.a $(pproglib) $(PTEXENC_LIBS) $(LDADD) $(ZLIB_LIBS)
uptex_dependencies = libukanji.a $(pproglib) $(PTEXENC_DEPEND) $(ZLIB_DEPEND) $(default_dependencies)
Expand Down Expand Up @@ -4545,7 +4545,7 @@ uptftopl_LDADD = $(uptex_ldadd)
uptftopl_DEPENDENCIES = $(uptex_dependencies)

# upTeX Tests
uptex_tests = uptexdir/uptriptest.test uptexdir/ptriptest.test uptexdir/upver.test uptexdir/upkcat.test
uptex_tests = uptexdir/uptriptest.test uptexdir/ptriptest.test uptexdir/upver.test uptexdir/upkcat.test uptexdir/wcfname.test
# uppPLtoTF/upTFtoPL
upweb_tests = uptexdir/upbibtex.test uptexdir/updvitype.test \
uptexdir/uppltotf.test uptexdir/uptftopl.test \
Expand Down Expand Up @@ -4603,7 +4603,7 @@ euptex_ch_srcs = \

# e-upTeX Tests
#
euptex_tests = euptexdir/euptriptest.test euptexdir/eptriptest.test euptexdir/pdfprimitive.test euptexdir/eupver.test
euptex_tests = euptexdir/euptriptest.test euptexdir/eptriptest.test euptexdir/pdfprimitive.test euptexdir/eupver.test euptexdir/wcfname.test

# At the moment, these are the only man pages handled in the
# conglomerated web2c/Makefile[.am]. (All the others are in man/.)
Expand Down Expand Up @@ -22082,7 +22082,7 @@ eptex.ch: tie$(EXEEXT) eptex.web $(eptex_ch_srcs)
$(tie_c) eptex.web $(eptex_ch_srcs)
eptexdir/eptriptest.log: eptex$(EXEEXT) dvitype$(EXEEXT) pltotf$(EXEEXT) tftopl$(EXEEXT)
eptexdir/pdfprimitive.log: eptex$(EXEEXT)
eptexdir/epver.log: eptex$(EXEEXT)
eptexdir/epver.log eptexdir/wcfname.log: eptex$(EXEEXT)
eptrip.diffs: eptex$(EXEEXT) dvitype$(EXEEXT) pltotf$(EXEEXT) tftopl$(EXEEXT)
$(triptrap_diffs) $@
.PHONY: eptrip-clean
Expand Down Expand Up @@ -22193,7 +22193,7 @@ euptex.ch: tie$(EXEEXT) euptex.web $(euptex_ch_srcs)
$(tie_c) euptex.web $(euptex_ch_srcs)
euptexdir/euptriptest.log: euptex$(EXEEXT) dvitype$(EXEEXT) pltotf$(EXEEXT) tftopl$(EXEEXT)
euptexdir/pdfprimitive.log: euptex$(EXEEXT)
euptexdir/eupver.log: euptex$(EXEEXT)
euptexdir/eupver.log euptexdir/wcfname.log: euptex$(EXEEXT)
euptrip.diffs: euptex$(EXEEXT) dvitype$(EXEEXT) pltotf$(EXEEXT) tftopl$(EXEEXT)
$(triptrap_diffs) $@
.PHONY: euptrip-clean
Expand Down
7 changes: 7 additions & 0 deletions source/texk/web2c/eptexdir/ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
2023-01-15 TANAKA Takuji <[email protected]>

* wcfname.test, am/eptex.am:
Add tests for file names with JIS X 0208 characters
in `eptex --kanji-internal={euc,sjis}`.
https://github.com/texjporg/tex-jp-build/issues/136

2022-12-22 Hironori Kitagawa <[email protected]>

* eptex.defines:
Expand Down
4 changes: 2 additions & 2 deletions source/texk/web2c/eptexdir/am/eptex.am
Original file line number Diff line number Diff line change
Expand Up @@ -89,10 +89,10 @@ EXTRA_DIST += \

# e-pTeX Tests
#
eptex_tests = eptexdir/eptriptest.test eptexdir/pdfprimitive.test eptexdir/epver.test
eptex_tests = eptexdir/eptriptest.test eptexdir/pdfprimitive.test eptexdir/epver.test eptexdir/wcfname.test
eptexdir/eptriptest.log: eptex$(EXEEXT) dvitype$(EXEEXT) pltotf$(EXEEXT) tftopl$(EXEEXT)
eptexdir/pdfprimitive.log: eptex$(EXEEXT)
eptexdir/epver.log: eptex$(EXEEXT)
eptexdir/epver.log eptexdir/wcfname.log: eptex$(EXEEXT)

EXTRA_DIST += $(eptex_tests)

Expand Down
68 changes: 68 additions & 0 deletions source/texk/web2c/eptexdir/wcfname.test
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
#! /bin/sh -vx
#
# Copyright 2022-2023 Japanese TeX Development Community <[email protected]>
# You may freely use, modify and/or distribute this file.

test -d eptests || mkdir -p eptests
rm -f eptests/fn*.log eptests/fn*.txt eptests/fn*.tex fn*.tex

rc=0

TEXMFCNF=$srcdir/../kpathsea
TEXINPUTS=eptests:.
export TEXMFCNF TEXINPUTS

for loc in C.UTF-8 C.utf8 en_US.UTF-8 en_US.utf8 ja_JP.UTF-8 ja_JP.utf8; do
locale -a | grep $loc
ret=$?
if [ $ret = 0 ]; then
LC_ALL=$loc; LANGUAGE=$loc; export LC_ALL LANGUAGE
break
fi
done
if [ $ret = 1 ]; then
# linux musl fails to run `locale -a` but seems to have C.UTF-8
loc=C.UTF-8
LC_ALL=$loc; LANGUAGE=$loc; export LC_ALL LANGUAGE
fi

perl $srcdir/tests/fn-generate.perl || exit 128
mv fn*.tex eptests/

# pTeX internal encoding
fenc="utf8"
for ienc in euc sjis; do
for doc in fn-$fenc fnさざ波-$fenc; do

echo '>>> Document:'$doc ' File Encoding:'$fenc ' Internal Encoding:'$ienc
./eptex -ini -interaction nonstopmode -jobname=$doc-$ienc -kanji=$fenc --kanji-internal=$ienc --shell-escape $doc.tex >eptests/$doc-$ienc-term.log || rc=1
mv $doc-$ienc.txt $doc-$ienc.log fn*-tmp.tex eptests/
diff eptests/$doc-$ienc.txt $srcdir/tests/fn-$fenc.txt || rc=2

done
done


# pTeX, regacy encoding
for fenc in sjis euc; do
for doc in fnさざ波-$fenc; do

ienc=$fenc
if [ "$COMSPEC" != "" ]; then
echo "*** We guess OS is Windows."
if [ $fenc != euc ]; then ienc="sjis"; fi
else
echo "*** We guess OS is not Windows."
if [ $fenc != sjis ]; then ienc="euc"; fi
fi

echo '>>> Document:'$doc ' File Encoding:'$fenc ' Internal Encoding:'$ienc
./eptex -ini -interaction nonstopmode -jobname=$doc-$ienc -kanji=$fenc --kanji-internal=$ienc --shell-escape $doc.tex >eptests/$doc-$fenc-term.log || rc=3
mv $doc-$ienc.txt $doc-$ienc.log fn*-tmp.tex eptests/
diff eptests/$doc-$ienc.txt $srcdir/tests/fn-$fenc.txt || rc=4

done
done


exit $rc
7 changes: 7 additions & 0 deletions source/texk/web2c/euptexdir/ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
2023-01-15 TANAKA Takuji <[email protected]>

* wcfname.test, am/euptex.am:
Add tests for file names with JIS X 0208 & UTF-8 characters
in `euptex --kanji-internal={euc,sjis,uptex}`.
https://github.com/texjporg/tex-jp-build/issues/136

2022-12-22 Hironori Kitagawa <[email protected]>

* euptex.defines:
Expand Down
4 changes: 2 additions & 2 deletions source/texk/web2c/euptexdir/am/euptex.am
Original file line number Diff line number Diff line change
Expand Up @@ -90,10 +90,10 @@ EXTRA_DIST += \

# e-upTeX Tests
#
euptex_tests = euptexdir/euptriptest.test euptexdir/eptriptest.test euptexdir/pdfprimitive.test euptexdir/eupver.test
euptex_tests = euptexdir/euptriptest.test euptexdir/eptriptest.test euptexdir/pdfprimitive.test euptexdir/eupver.test euptexdir/wcfname.test
euptexdir/euptriptest.log: euptex$(EXEEXT) dvitype$(EXEEXT) pltotf$(EXEEXT) tftopl$(EXEEXT)
euptexdir/pdfprimitive.log: euptex$(EXEEXT)
euptexdir/eupver.log: euptex$(EXEEXT)
euptexdir/eupver.log euptexdir/wcfname.log: euptex$(EXEEXT)

EXTRA_DIST += $(euptex_tests)

Expand Down
94 changes: 94 additions & 0 deletions source/texk/web2c/euptexdir/wcfname.test
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
#! /bin/sh -vx
#
# Copyright 2022-2023 Japanese TeX Development Community <[email protected]>
# You may freely use, modify and/or distribute this file.

test -d euptests || mkdir -p euptests
rm -f euptests/fn*.log euptests/fn*.txt euptests/fn*.tex fn*.tex

rc=0

TEXMFCNF=$srcdir/../kpathsea
TEXINPUTS=euptests:.
export TEXMFCNF TEXINPUTS

for loc in C.UTF-8 C.utf8 en_US.UTF-8 en_US.utf8 ja_JP.UTF-8 ja_JP.utf8; do
locale -a | grep $loc
ret=$?
if [ $ret = 0 ]; then
LC_ALL=$loc; LANGUAGE=$loc; export LC_ALL LANGUAGE
break
fi
done
if [ $ret = 1 ]; then
# linux musl fails to run `locale -a` but seems to have C.UTF-8
loc=C.UTF-8
LC_ALL=$loc; LANGUAGE=$loc; export LC_ALL LANGUAGE
fi

perl $srcdir/tests/fn-generate.perl || exit 128
mv fn*.tex euptests/

# upTeX internal encoding
fenc="utf8"
for ienc in euc sjis uptex; do
for doc in fn-$fenc fnさざ波-$fenc fn£¥µÆÇñß-$fenc; do

if [ $ienc != uptex -a $doc = fn£¥µÆÇñß-$fenc ]; then
continue
fi

if [ "$COMSPEC" != "" ]; then
echo "*** We guess OS is Windows."
if [ $ienc = uptex ]; then
command_line_encoding=utf8
export command_line_encoding
else
command_line_encoding=none
export command_line_encoding
fi
fi

echo '>>> Document:'$doc ' File Encoding:'$fenc ' Internal Encoding:'$ienc
./euptex -ini -interaction nonstopmode -jobname=$doc-$ienc -kanji=$fenc --kanji-internal=$ienc --shell-escape $doc.tex >euptests/$doc-$ienc-term.log || rc=1
mv $doc-$ienc.txt $doc-$ienc.log fn*-tmp.tex euptests/
diff euptests/$doc-$ienc.txt $srcdir/tests/fn-$fenc.txt || rc=2

done
done


# pTeX compatible mode, regacy encoding
for fenc in sjis euc; do
for doc in fnさざ波-$fenc; do

ienc=$fenc
if [ "$COMSPEC" != "" ]; then
echo "*** We guess OS is Windows."
if [ $fenc != euc ]; then ienc="sjis"; fi
if [ $ienc = uptex ]; then
command_line_encoding=utf8
export command_line_encoding
else
command_line_encoding=none
export command_line_encoding
fi
else
echo "*** We guess OS is not Windows."
if [ $fenc != sjis ]; then ienc="euc"; fi
fi
if [ $ienc != uptex ]; then
guess_input_kanji_encoding=1
export guess_input_kanji_encoding
fi

echo '>>> Document:'$doc ' File Encoding:'$fenc ' Internal Encoding:'$ienc
./euptex -ini -interaction nonstopmode -jobname=$doc-$ienc -kanji=$fenc --kanji-internal=$ienc --shell-escape $doc.tex >euptests/$doc-$fenc-term.log || rc=3
mv $doc-$ienc.txt $doc-$ienc.log fn*-tmp.tex euptests/
diff euptests/$doc-$ienc.txt $srcdir/tests/fn-$fenc.txt || rc=4

done
done


exit $rc

0 comments on commit bd963a7

Please sign in to comment.