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
This commit is contained in:
ZyX
2017-01-03 08:46:44 +03:00
parent efe1476d42
commit 410d18ef5c
5 changed files with 80 additions and 56 deletions

View File

@@ -219,12 +219,10 @@ local function standalone(...) -- luacheck: ignore
Preprocess.add_to_include_path('./../../build/include')
Preprocess.add_to_include_path('./../../.deps/usr/include')
local input = Preprocess.preprocess_stream(arg[1])
local raw = input:read('*all')
input:close()
local raw = Preprocess.preprocess(arg[1])
if raw == nil then
print("ERROR: Preprocess.preprocess_stream():read() returned empty")
print("ERROR: Preprocess.preprocess() returned empty")
end
local formatted