fix cron test

This commit is contained in:
Daniel Poelzleithner 2022-11-11 18:26:57 +01:00
parent 96a6276440
commit f4c15496dc
3 changed files with 26 additions and 27 deletions

2
.gitignore vendored
View File

@ -10,7 +10,7 @@ lsyncd
AdditionalInfo.txt
config.h
Makefile
build/
build*/
CMakeCache.txt
CMakeFiles/
cmake_install.cmake

View File

@ -64,31 +64,6 @@ local function writefiles
writefile( srcdir .. 'xcx/x', 'xcxx' )
end
--
-- Tests if the filename exists
-- fails if this is different to expect.
--
local function testfile
(
filename,
expect
)
local stat, err = posix.stat( filename )
if stat and not expect
then
cwriteln( 'failure: ', filename, ' should be filtered')
os.exit( 1 )
end
if not stat and expect
then
cwriteln( 'failure: ', filename, ' should not be filtered' )
os.exit( 1 )
end
end
-- test all files
local function testfiles
( )
@ -148,7 +123,7 @@ writefiles( )
cwriteln( 'waiting for Lsyncd to transmit changes' )
posix.sleep( 5 )
posix.sleep( 20 )
testfiles( )

View File

@ -674,3 +674,27 @@ function isTableEqual(o1, o2, ignore_mt)
return true
end
--
-- Tests if the filename exists
-- fails if this is different to expect.
--
function testfile
(
filename,
expect
)
local stat, err = posix.stat( filename )
if stat and not expect
then
cwriteln( 'failure: ', filename, ' should be filtered')
os.exit( 1 )
end
if not stat and expect
then
cwriteln( 'failure: ', filename, ' should not be filtered' )
os.exit( 1 )
end
end