diff options
author | Karl Berry <karl@freefriends.org> | 2013-05-09 22:49:27 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2013-05-09 22:49:27 +0000 |
commit | ba7a533d2793a7bc818793ee21435064706085b0 (patch) | |
tree | ec2f111bc67eae49a2231531332ecc72bc0550c2 /Master/texmf-dist/source/luatex/lualibs/test-lualibs.lua | |
parent | 2fdcd946d3eb65fa262e4594f5d2d00f157b1407 (diff) |
lualibs (9may13)
git-svn-id: svn://tug.org/texlive/trunk@30350 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/source/luatex/lualibs/test-lualibs.lua')
-rw-r--r-- | Master/texmf-dist/source/luatex/lualibs/test-lualibs.lua | 81 |
1 files changed, 81 insertions, 0 deletions
diff --git a/Master/texmf-dist/source/luatex/lualibs/test-lualibs.lua b/Master/texmf-dist/source/luatex/lualibs/test-lualibs.lua new file mode 100644 index 00000000000..b74fde16f94 --- /dev/null +++ b/Master/texmf-dist/source/luatex/lualibs/test-lualibs.lua @@ -0,0 +1,81 @@ +#!/usr/bin/env texlua + +local luafiles = { + "lualibs-boolean.lua", "lualibs-compat.lua", + "lualibs-dir.lua", "lualibs-file.lua", + "lualibs-function.lua", "lualibs-io.lua", + "lualibs-lpeg.lua", "lualibs-lua.lua", + "lualibs-math.lua", "lualibs-md5.lua", + "lualibs-number.lua", "lualibs-os.lua", + "lualibs-package.lua", "lualibs-set.lua", + "lualibs-string.lua", "lualibs-table.lua", + "lualibs-trac-inf.lua", "lualibs-unicode.lua", + "lualibs-url.lua", "lualibs-util-deb.lua", + "lualibs-util-dim.lua", "lualibs-util-env.lua", + "lualibs-util-jsn.lua", "lualibs-util-lua.lua", + "lualibs-util-prs.lua", "lualibs-util-sta.lua", + "lualibs-util-sto.lua", "lualibs-util-str.lua", + "lualibs-util-tab.lua", "lualibs-util-fmt.lua", + "lualibs-util-tpl.lua", "lualibs.lua", + "lualibs-basic.lua", "lualibs-basic-merged.lua", + "lualibs-extended.lua", "lualibs-extended-merged.lua", +} + +local test_cmd = "texluac -p %s &> /dev/null" + +local check_wellformed = function (file) + io.write"testing " + io.write(file) + io.write" ... " + local exit_status = os.execute(string.format(test_cmd, file)) + if exit_status == 0 then + io.write"SUCCESS!\n" + return true + end + io.write"FAIL :-/\n" + return false +end + +local check_files check_files = function (lst, n) + if n == nil then + return check_files(lst, 1) + end + local this = lst[n] + if this then + if check_wellformed(this) then + return check_files(lst, n+1) + else + return false + end + end + return true +end + +config = { lualibs = { force_reload = true } } + +local load_all = function ( ) + + io.write"testing merged packages ... " + config.lualibs.prefer_merged = true + if not pcall(function () dofile"lualibs.lua"end) then + io.write"FAIL :-/\n" + end + io.write"SUCCESS\n" + + io.write"testing files ... " + config.lualibs.prefer_merged = false + if not pcall(function () dofile"lualibs.lua"end) then + io.write"FAIL :-/\n" + end + io.write"SUCCESS\n" + return true +end + +local main = function ( ) + local retval = 0 + retval = check_files(luafiles) and retval or 1 + retval = load_all() and retval or 1 + os.exit(retval) +end + +return main() |