Compile programs with pallenec in the coder tests
Instead of directly calling the driver, let's have the tests call pallenec just like the programmer
would.
-local driver = require "pallene.driver"
local util = require "pallene.util"
local function compile(pallene_code)
setup(function()
assert(util.set_file_contents("__test__.pln", pallene_code))
- local ok, errors = driver.compile("pallenec-tests", "pln", "so", "__test__.pln")
- assert(ok, errors[1])
+ local ok, _, _, errmsg = util.outputs_of_execute("./pallenec __test__.pln")
+ if not ok then error(errmsg) end
end)
end
