also test executable files

This commit is contained in:
Daniel Poelzleithner 2022-11-11 19:00:26 +01:00
parent f4c15496dc
commit 818fd4115f
2 changed files with 10 additions and 1 deletions

View File

@ -62,6 +62,8 @@ local function writefiles
writefile( srcdir .. 'xbx/a', 'xbxa' )
posix.mkdir( srcdir .. 'xcx' )
writefile( srcdir .. 'xcx/x', 'xcxx' )
writefile( srcdir .. 'xda', 'xda', '700' )
writefile( srcdir .. 'xdb', 'xdb', '755' )
end
-- test all files
@ -72,6 +74,8 @@ local function testfiles
testfile( trgdir .. 'yaa', false )
testfile( trgdir .. 'xbx/a', false )
testfile( trgdir .. 'xcx/x', true )
testfile( trgdir .. 'xda', true )
testfile( trgdir .. 'xdb', true )
end

View File

@ -104,7 +104,8 @@ end
function writefile
(
filename,
text
text,
mode
)
local f = io.open( filename, 'w' )
@ -118,6 +119,10 @@ function writefile
f:write( '\n' )
f:close( )
if mode ~= nil then
posix.chmod(filename, mode)
end
return true
end