mirror of https://github.com/octoleo/lsyncd.git
fix cron test
This commit is contained in:
parent
96a6276440
commit
f4c15496dc
|
@ -10,7 +10,7 @@ lsyncd
|
||||||
AdditionalInfo.txt
|
AdditionalInfo.txt
|
||||||
config.h
|
config.h
|
||||||
Makefile
|
Makefile
|
||||||
build/
|
build*/
|
||||||
CMakeCache.txt
|
CMakeCache.txt
|
||||||
CMakeFiles/
|
CMakeFiles/
|
||||||
cmake_install.cmake
|
cmake_install.cmake
|
||||||
|
|
|
@ -64,31 +64,6 @@ local function writefiles
|
||||||
writefile( srcdir .. 'xcx/x', 'xcxx' )
|
writefile( srcdir .. 'xcx/x', 'xcxx' )
|
||||||
end
|
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
|
-- test all files
|
||||||
local function testfiles
|
local function testfiles
|
||||||
( )
|
( )
|
||||||
|
@ -148,7 +123,7 @@ writefiles( )
|
||||||
|
|
||||||
cwriteln( 'waiting for Lsyncd to transmit changes' )
|
cwriteln( 'waiting for Lsyncd to transmit changes' )
|
||||||
|
|
||||||
posix.sleep( 5 )
|
posix.sleep( 20 )
|
||||||
|
|
||||||
testfiles( )
|
testfiles( )
|
||||||
|
|
||||||
|
|
|
@ -674,3 +674,27 @@ function isTableEqual(o1, o2, ignore_mt)
|
||||||
return true
|
return true
|
||||||
end
|
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
|
Loading…
Reference in New Issue