fix broken unit tests on Travis CI

1. It turns out that `device_id` is not defined in unit test environment
which makes the `assert(self.kosync_device_id)` fail and somehow makes `luajit` segmentation fault.
2. In the device spec, stubbing `io.open` will make subsquent `require`
all return boolean value and segmentation fault `luajit`.

This patch is a minimum viable change that makes CI work on both my
local box and Travis.
This commit is contained in:
chrox
2016-08-11 17:12:55 +08:00
parent 7857f6964b
commit 7ea12c0198
6 changed files with 17 additions and 9 deletions

View File

@@ -96,11 +96,6 @@ local lfs = require("libs/libkoreader-lfs")
local UIManager = require("ui/uimanager")
local Device = require("device")
local Font = require("ui/font")
local random = require("random")
if not G_reader_settings:readSetting("device_id") then
G_reader_settings:saveSetting("device_id", random.uuid())
end
-- read some global reader setting here:
-- font