1 # on Debian
in lua
-posix
5 os
.execute("sleep " .. tonumber(sec
))
8 function getTests(testset
)
9 return (io
.popen("ls " .. testset
.. "/*.lua"):lines())
12 print 'Running tests against ../../notion/notion'
13 print 'Starting Xdummy...'
15 local xpid
= posix
.fork()
17 local result
,errstr
,errno
= posix
.exec("/bin/sh", "./Xdummy", ":7")
18 print ('Error replacing current process with Xdummy: ' .. errstr
);
24 print '(Hopefully) started Xdummy.'
26 local testsets
= { 'basic_test', 'xinerama', 'xrandr' }
29 for i
,testset
in ipairs(testsets
) do
31 posix
.setenv('HOME', testset
);
33 os
.execute("rm -r " .. testset
.. "/.notion/default-session--7")
35 print ('Starting notion in ./' .. testset
.. '...')
37 local notionpid
= posix
.fork()
38 if (notionpid
== 0) then
39 local result
,errstr
,errno
= posix
.exec("../../notion/notion", "-noerrorlog", "-display", ":7")
40 print ('Error replacing current process with notion: ' .. errstr
)
46 print 'Running tests...'
48 for test
in getTests(testset
) do
49 print ('Running test ' .. test
)
50 local testoutputpipe
= io
.popen("cat " .. test
.. " | DISPLAY=:7 notionflux")
51 local testoutput
= testoutputpipe
:read("*a")
52 print 'Evaluating result...'
53 if(testoutput
~= "\"ok\"\n") then
54 print('** ERROR ** ' .. testoutput
)
61 print 'Killing notion process...'
67 print 'Killing X process...'
73 print (errors
.. " errors.")