summaryrefslogtreecommitdiff
path: root/Build/source/texk
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2023-10-04 16:55:03 +0000
committerKarl Berry <karl@freefriends.org>2023-10-04 16:55:03 +0000
commit1c0500231f4a1d492c48676b4239ba89191cc5ae (patch)
tree9142919968c5b5c05c1da17df193ec267b8d9813 /Build/source/texk
parentc190cb5fecec8dbe19f55444b4204111f1d10adb (diff)
new luatex test, luaoutputdir.test
git-svn-id: svn://tug.org/texlive/trunk@68450 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build/source/texk')
-rw-r--r--Build/source/texk/web2c/Makefile.in8
-rw-r--r--Build/source/texk/web2c/luatexdir/ChangeLog6
-rw-r--r--Build/source/texk/web2c/luatexdir/am/luatex.am7
-rwxr-xr-xBuild/source/texk/web2c/luatexdir/luaoutputdir.test35
4 files changed, 52 insertions, 4 deletions
diff --git a/Build/source/texk/web2c/Makefile.in b/Build/source/texk/web2c/Makefile.in
index a417f4de475..6a93f4430cb 100644
--- a/Build/source/texk/web2c/Makefile.in
+++ b/Build/source/texk/web2c/Makefile.in
@@ -5337,7 +5337,10 @@ call_luajithbtex_LDADD =
# LuaTeX/LuaJITTeX Tests
#
-luatex_tests = luatexdir/luatex.test luatexdir/luaimage.test
+luatex_tests = luatexdir/luatex.test luatexdir/luaimage.test \
+ luatexdir/luaoutputdir.test
+
+#
luahbtex_tests = luatexdir/luatex.test luatexdir/luaimage.test
luajittex_tests = luatexdir/luajittex.test luatexdir/luajitimage.test
luajithbtex_tests = luatexdir/luajittex.test luatexdir/luajitimage.test
@@ -22324,7 +22327,8 @@ $(luajithbtex_OBJECTS): libluajittex.a
@MINGW32_FALSE@@WIN32_TRUE@uninstall-luajithbtex-links:
@MINGW32_FALSE@@WIN32_TRUE@ rm -f $(DESTDIR)$(bindir)/texluajit$(EXEEXT)
@MINGW32_FALSE@@WIN32_TRUE@ rm -f $(DESTDIR)$(bindir)/texluajitc$(EXEEXT)
-luatexdir/luatex.log luatexdir/luaimage.log: luatex$(EXEEXT)
+luatexdir/luatex.log luatexdir/luaimage.log luatexdir/luaoutputdir.log: \
+ luatex$(EXEEXT)
luatexdir/luahbtex.log luatexdir/luahbimage.log: luahbtex$(EXEEXT)
luatexdir/luajittex.log luatexdir/luajitimage.log: luajittex$(EXEEXT)
luatexdir/luajithbtex.log luatexdir/luajithbimage.log: luajithbtex$(EXEEXT)
diff --git a/Build/source/texk/web2c/luatexdir/ChangeLog b/Build/source/texk/web2c/luatexdir/ChangeLog
index f182f16e4c5..3fef4a3a73a 100644
--- a/Build/source/texk/web2c/luatexdir/ChangeLog
+++ b/Build/source/texk/web2c/luatexdir/ChangeLog
@@ -1,3 +1,9 @@
+2023-10-04 Karl Berry <karl@freefriends.org>
+
+ * luaoutputdir.test: new test for Lua-level reading from a given
+ --output-directory.
+ * am/luatex.am (luatex_tests): add it, plus .log dependency.
+
2023-04-29 Luigi Scarso <luigi.scarso@gmail.com>
* LuaTeX 1.17.0
diff --git a/Build/source/texk/web2c/luatexdir/am/luatex.am b/Build/source/texk/web2c/luatexdir/am/luatex.am
index 93333ba587f..32feab1105b 100644
--- a/Build/source/texk/web2c/luatexdir/am/luatex.am
+++ b/Build/source/texk/web2c/luatexdir/am/luatex.am
@@ -232,8 +232,11 @@ endif WIN32
# LuaTeX/LuaJITTeX Tests
#
-luatex_tests = luatexdir/luatex.test luatexdir/luaimage.test
-luatexdir/luatex.log luatexdir/luaimage.log: luatex$(EXEEXT)
+luatex_tests = luatexdir/luatex.test luatexdir/luaimage.test \
+ luatexdir/luaoutputdir.test
+luatexdir/luatex.log luatexdir/luaimage.log luatexdir/luaoutputdir.log: \
+ luatex$(EXEEXT)
+#
luahbtex_tests = luatexdir/luatex.test luatexdir/luaimage.test
luatexdir/luahbtex.log luatexdir/luahbimage.log: luahbtex$(EXEEXT)
diff --git a/Build/source/texk/web2c/luatexdir/luaoutputdir.test b/Build/source/texk/web2c/luatexdir/luaoutputdir.test
new file mode 100755
index 00000000000..c9b3b3e0729
--- /dev/null
+++ b/Build/source/texk/web2c/luatexdir/luaoutputdir.test
@@ -0,0 +1,35 @@
+#! /bin/sh -vx
+# luaoutputdir.test - check that Lua-level kpse.* reads from -output-directory.
+# Public domain. Originally written by Karl Berry, 2023.
+# https://github.com/latex3/latex3/issues/1070
+
+BinDir=${BinDir:-.} # ordinarily run from the web2c builddir
+ExeExt=${ExeExt:-}
+_luatex=$BinDir/luatex$ExeExt
+
+# in case we're invoked standalone instead of from make.
+test -z "$srcdir" && srcdir=`cd \`dirname $0\`/.. && pwd` # web2c/
+TEXMFCNF=$srcdir/../kpathsea; export TEXMFCNF
+
+outdir=tests/outdirlua
+outfile=outfileLUA.tex
+rm -rf $outdir # don't let previous runs interfere
+mkdir $outdir || exit 1
+
+$_luatex -ini -output-directory=$outdir '\immediate\openout1='$outfile'\end' \
+|| exit 3
+
+ls -l $outdir/$outfile || exit 7
+
+# Then we should be able to read it back in TeX.
+$_luatex -ini -output-directory=$outdir '\input '$outfile' \end' || exit 9
+
+# And we should also be able to read it back in Lua.
+$_luatex -ini -output-directory=$outdir \
+'\catcode123=1 \catcode125=2
+ \directlua{local file=kpse.find_file("'$outfile'");
+ if (file == nil) then os.exit(1); end}
+ \end
+' || exit 11
+
+exit 0