if not package.path:find("spec/%?%.lua;") then print("including spec") package.path = "./spec/?.lua;" .. package.path end _G.assert = assert local common = require("common") --[[Create the headless client init file]] local f = io.open("spec/headless/deviceinit.lua","w") f:write([=[ return { ["Anti Alias"] = 16, ["Bits Per Pixel"] = 16, ["Device Type"] = "BEST", ["Display Adapter"] = 0, ["Double Buffer"] = true, ["Multithreaded"] = false, ["Driver Type"] = "NULL", ["Fullscreen"] = false, ["Stencil Buffer"] = true, ["Stereo Buffer"] = false, ["VSync"] = true, ["Window Width"] = 640, ["Window Height"] = 480, } ]=]) f:close() describe("Brok[en]gine",function() it("should run #smoke",function() common.writegame() common.assert_game_runs() end) it("should provide a lua environment #smoke",function() common.writegame("print(\"Hello from lua!\")") d = common.rungame() assert.truthy(d:find("\nHello from lua!\n")) end) for k,v in pairs({ buttons = "newbutton", checkboxes = "newcheckbox", colorselectors = "newcolorselector", editboxes = "neweditbox", openfiledialogs = "newfileopendialog", images = "newiguiimage", labels = "newlabel", spinboxes = "newspinbox", treeviews = "newtreeview", windows = "newwindow", }) do it("should provide functions to make gui " .. k,function() common.writegame("assert(gui." .. v .. ")") common.assert_game_runs() end) end it("should provide functions to get the width and height of the screen",function() common.writegame("assert(scrw)") common.assert_game_runs() common.writegame("assert(scrh)") common.assert_game_runs() end) end)