premake/tests/test_dofile.lua
Jason Perkins 52515963b4 Make test framework module aware
- Move test action into main project script
- Look for and load test suites from manifest files
- Make individual tests play nicer with third-party modifications
2014-09-17 19:19:47 -04:00

34 lines
636 B
Lua

--
-- tests/test_dofile.lua
-- Automated test suite for the extended dofile() functions.
-- Copyright (c) 2008, 2014 Jason Perkins and the Premake project
--
local suite = test.declare("do_file")
local os_getenv
function suite.setup()
os_getenv = os.getenv
end
function suite.teardown()
os.getenv = os_getenv
end
function suite.searchesPath()
os.getenv = function() return _TESTS_DIR .. "/folder" end
result = dofile("ok.lua")
test.isequal("ok", result)
end
function suite.searchesScriptsOption()
_OPTIONS["scripts"] = _TESTS_DIR .. "/folder"
result = dofile("ok.lua")
test.isequal("ok", result)
end