Skip to content

Commit d377115

Browse files
committed
test: resolving program name
1 parent af889e4 commit d377115

File tree

8 files changed

+15
-7
lines changed

8 files changed

+15
-7
lines changed

test/lua-Harness-tests/241-standalone.t.disabled

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ elseif ravi then
4141
banner = '^Ravi %d%.%d%.%d'
4242
end
4343

44-
local lua = get_lua_binary_name()
44+
local lua = _retrieve_progname()
4545
local luac = jit and lua or (lua .. 'c')
4646

4747
if not pcall(io.popen, lua .. [[ -e "a=1"]]) then

test/lua-Harness-tests/242-luac.t

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ if ravi then
3838
skip_all("ravi")
3939
end
4040

41-
local lua = get_lua_binary_name()
41+
local lua = _retrieve_progname()
4242
local luac = lua .. 'c'
4343

4444
if not pcall(io.popen, lua .. [[ -e "a=1"]]) then

test/lua-Harness-tests/301-basic.t

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ local has_warn = _VERSION >= 'Lua 5.4'
4848
local has_xpcall52 = _VERSION >= 'Lua 5.2' or jit
4949
local has_xpcall53 = _VERSION >= 'Lua 5.3' or jit
5050

51-
local lua = get_lua_binary_name()
51+
local lua = _retrieve_progname()
5252

5353
plan'no_plan'
5454

test/lua-Harness-tests/308-io.t

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ local has_read53 = _VERSION >= 'Lua 5.3' or luajit21
4040
local has_meta53 = _VERSION >= 'Lua 5.3'
4141
local has_meta54 = _VERSION >= 'Lua 5.4'
4242

43-
local lua = get_lua_binary_name()
43+
local lua = _retrieve_progname()
4444

4545
plan'no_plan'
4646

test/lua-Harness-tests/309-os.t

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ require'tap'
3434
local profile = require'profile'
3535
local luajit20 = jit and (jit.version_num < 20100 and not jit.version:match'^RaptorJIT')
3636
local has_execute51 = _VERSION == 'Lua 5.1' and (not profile.luajit_compat52 or ujit)
37-
local lua = get_lua_binary_name()
37+
local lua = _retrieve_progname()
3838

3939
plan'no_plan'
4040

test/lua-Harness-tests/320-stdin.t

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ Tests Lua Basic & IO Libraries with stdin
2626

2727
require'tap'
2828

29-
local lua = get_lua_binary_name()
29+
local lua = _retrieve_progname()
3030

3131
if not pcall(io.popen, lua .. [[ -e "a=1"]]) then
3232
skip_all "io.popen not supported"

test/lua-Harness-tests/411-luajit.t.disabled

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ if not jit or ujit then
3131
skip_all("only with LuaJIT")
3232
end
3333

34-
local lua = get_lua_binary_name()
34+
local lua = _retrieve_progname()
3535

3636
if not pcall(io.popen, lua .. [[ -e "a=1"]]) then
3737
skip_all("io.popen not supported")

test/lua-Harness-tests/tap.lua

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,14 @@
99
1010
]]
1111

12+
function _retrieve_progname ()
13+
local i = 0
14+
while arg[i] do
15+
i = i - 1
16+
end
17+
return arg[i + 1]
18+
end
19+
1220
if pcall(require, 'Test.More') then
1321
diag 'Test.More loaded'
1422
return

0 commit comments

Comments
 (0)