Skip to content

Commit 733d1e5

Browse files
committed
Check if posix module exists, otherwise, skip integration
1 parent d4e68bb commit 733d1e5

File tree

2 files changed

+15
-14
lines changed

2 files changed

+15
-14
lines changed

test/Makefile

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
.PHONY: test
22

33
test:
4-
# For now integration tests don't work (lua-posix problems), skipping them
54
$(MAKE) -C integration test

test/integration/runtests.lua

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,13 @@
11
--# on Debian in lua-posix
22
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
411

512
function sleep(sec)
613
os.execute("sleep " .. tonumber(sec))
@@ -22,16 +29,13 @@ end
2229

2330
sleep(1)
2431

25-
print '(Hopefully) started Xorg dummy.'
26-
2732
local testsets = { 'basic_test', 'xinerama', 'xrandr' }
2833
local errors = 0
2934

3035
for i,testset in ipairs(testsets) do
31-
3236
posix.setenv('HOME', testset);
3337

34-
os.execute("rm -r " .. testset .. "/.notion/default-session--7")
38+
os.execute("rm -rf " .. testset .. "/.notion/default-session--7")
3539

3640
print('Starting notion in ./' .. testset .. '...')
3741

@@ -44,18 +48,15 @@ for i,testset in ipairs(testsets) do
4448

4549
sleep(2)
4650

47-
print 'Running tests...'
48-
4951
for test in getTests(testset) do
50-
print('Running test ' .. test)
52+
print('[TEST] ' .. test)
5153
local testoutputpipe = io.popen("cat " .. test .. " | DISPLAY=:7 " .. basedir .. "mod_notionflux/notionflux/notionflux")
5254
local testoutput = testoutputpipe:read("*a")
53-
print 'Evaluating result...'
5455
if(testoutput ~= "\"ok\"\n") then
55-
print('** ERROR ** ' .. testoutput)
56+
print('[ERROR] ' .. testoutput)
5657
errors = errors + 1
5758
else
58-
print '** OK **'
59+
print '[OK]'
5960
end
6061
end
6162

@@ -69,7 +70,8 @@ print 'Killing X process...'
6970
posix.kill(xpid)
7071

7172
if errors == 0 then
72-
print 'OK!'
73+
print '[OK]'
7374
else
74-
print(errors .. " errors.")
75+
print('[ERROR] ' .. errors .. " tests failed.")
7576
end
77+
os.exit(errors)

0 commit comments

Comments
 (0)