1
1
-- # on Debian in lua-posix
2
2
local basedir = " ../../"
3
- local posix = require " posix"
3
+
4
+ print (" [TESTING] Integration" )
5
+
6
+ local success , posix = pcall (require , " posix" )
7
+ if not success then
8
+ print (" [SKIP] posix module not found" )
9
+ os.exit (0 )
10
+ end
4
11
5
12
function sleep (sec )
6
13
os.execute (" sleep " .. tonumber (sec ))
22
29
23
30
sleep (1 )
24
31
25
- print ' (Hopefully) started Xorg dummy.'
26
-
27
32
local testsets = { ' basic_test' , ' xinerama' , ' xrandr' }
28
33
local errors = 0
29
34
30
35
for i ,testset in ipairs (testsets ) do
31
-
32
36
posix .setenv (' HOME' , testset );
33
37
34
- os.execute (" rm -r " .. testset .. " /.notion/default-session--7" )
38
+ os.execute (" rm -rf " .. testset .. " /.notion/default-session--7" )
35
39
36
40
print (' Starting notion in ./' .. testset .. ' ...' )
37
41
@@ -44,18 +48,15 @@ for i,testset in ipairs(testsets) do
44
48
45
49
sleep (2 )
46
50
47
- print ' Running tests...'
48
-
49
51
for test in getTests (testset ) do
50
- print (' Running test ' .. test )
52
+ print (' [TEST] ' .. test )
51
53
local testoutputpipe = io.popen (" cat " .. test .. " | DISPLAY=:7 " .. basedir .. " mod_notionflux/notionflux/notionflux" )
52
54
local testoutput = testoutputpipe :read (" *a" )
53
- print ' Evaluating result...'
54
55
if (testoutput ~= " \" ok\"\n " ) then
55
- print (' ** ERROR ** ' .. testoutput )
56
+ print (' [ ERROR] ' .. testoutput )
56
57
errors = errors + 1
57
58
else
58
- print ' ** OK ** '
59
+ print ' [OK] '
59
60
end
60
61
end
61
62
@@ -69,7 +70,8 @@ print 'Killing X process...'
69
70
posix .kill (xpid )
70
71
71
72
if errors == 0 then
72
- print ' OK! '
73
+ print ' [OK] '
73
74
else
74
- print (errors .. " errors ." )
75
+ print (' [ERROR] ' .. errors .. " tests failed ." )
75
76
end
77
+ os.exit (errors )
0 commit comments