aboutsummaryrefslogtreecommitdiff
path: root/test/unit/helpers.lua
diff options
context:
space:
mode:
authorZyX <kp-pav@yandex.ru>2017-01-03 08:46:44 +0300
committerZyX <kp-pav@yandex.ru>2017-01-03 22:54:54 +0300
commit410d18ef5c24a325f4d63c9b01991015199194c2 (patch)
treea6e2acad16f222e35c2c0be979d0396cc1a17813 /test/unit/helpers.lua
parentefe1476d4293170496f0e933a4d3c955f0559b03 (diff)
downloadrneovim-410d18ef5c24a325f4d63c9b01991015199194c2.tar.gz
rneovim-410d18ef5c24a325f4d63c9b01991015199194c2.tar.bz2
rneovim-410d18ef5c24a325f4d63c9b01991015199194c2.zip
unittest: Allow multiple indirect includes
Works by saving all preprocessor defines and reusing them on each run. This also saves NVIM_HEADER_H defines. Saving other defines is needed for defines like `Map(foo, bar)` which are sometimes used to declare types or functions. Saving types or function declarations is not needed because they are recorded as luajit state. Fixes #5857
Diffstat (limited to 'test/unit/helpers.lua')
-rw-r--r--test/unit/helpers.lua6
1 files changed, 2 insertions, 4 deletions
diff --git a/test/unit/helpers.lua b/test/unit/helpers.lua
index 3564f76442..c9885f73d0 100644
--- a/test/unit/helpers.lua
+++ b/test/unit/helpers.lua
@@ -68,14 +68,12 @@ local function cimport(...)
local body = nil
for _ = 1, 10 do
- local stream = Preprocess.preprocess_stream(unpack(paths))
- body = stream:read("*a")
- stream:close()
+ body = Preprocess.preprocess(unpack(paths))
if body ~= nil then break end
end
if body == nil then
- print("ERROR: helpers.lua: Preprocess.preprocess_stream():read() returned empty")
+ print("ERROR: helpers.lua: Preprocess.preprocess() returned empty")
end
-- format it (so that the lines are "unique" statements), also filter out