Catch older unit tests up to the latest standards

This commit is contained in:
Jason Perkins 2016-05-12 19:56:04 -04:00
parent 5373584834
commit e6bfd500b0
18 changed files with 30 additions and 44 deletions

View File

@ -16,6 +16,7 @@
local wks, prj local wks, prj
function suite.setup() function suite.setup()
os.chdir(_TESTS_DIR)
wks, prj = test.createWorkspace() wks, prj = test.createWorkspace()
end end

View File

@ -4,8 +4,7 @@
-- Copyright (c) 2010-2012 Jason Perkins and the Premake project -- Copyright (c) 2010-2012 Jason Perkins and the Premake project
-- --
T.make_escaping = { } local suite = test.declare("make_escaping")
local suite = T.make_escaping
local make = premake.make local make = premake.make

View File

@ -4,8 +4,7 @@
-- Copyright (c) 2012 Jason Perkins and the Premake project -- Copyright (c) 2012 Jason Perkins and the Premake project
-- --
T.make_tovar = { } local suite = test.declare("make_tovar")
local suite = T.make_tovar
local make = premake.make local make = premake.make

View File

@ -4,8 +4,7 @@
-- Copyright (c) 2012 Jason Perkins and the Premake project -- Copyright (c) 2012 Jason Perkins and the Premake project
-- --
T.make_config_maps = {} local suite = test.declare("make_config_maps")
local suite = T.make_config_maps
local make = premake.make local make = premake.make

View File

@ -4,8 +4,7 @@
-- Copyright (c) 2012 Jason Perkins and the Premake project -- Copyright (c) 2012 Jason Perkins and the Premake project
-- --
T.vstudio_cs2005_project_refs = {} local suite = test.declare("vstudio_cs2005_project_refs")
local suite = T.vstudio_cs2005_project_refs
local cs2005 = premake.vstudio.cs2005 local cs2005 = premake.vstudio.cs2005

View File

@ -4,8 +4,7 @@
-- Copyright (c) 2009-2012 Jason Perkins and the Premake project -- Copyright (c) 2009-2012 Jason Perkins and the Premake project
-- --
T.vstudio_sln2005_dependencies = { } local suite = test.declare("vstudio_sln2005_dependencies")
local suite = T.vstudio_sln2005_dependencies
local sln2005 = premake.vstudio.sln2005 local sln2005 = premake.vstudio.sln2005

View File

@ -24,7 +24,7 @@
local function prepare(lang) local function prepare(lang)
filter {} filter {}
uuid "C9135098-6047-8142-B10E-D27E7F73FCB3" uuid "C9135098-6047-8142-B10E-D27E7F73FCB3"
wks = test.getsolution(wks) wks = test.getWorkspace(wks)
sln2005.configurationPlatforms(wks) sln2005.configurationPlatforms(wks)
end end

View File

@ -4,8 +4,7 @@
-- Copyright (c) 2009-2012 Jason Perkins and the Premake project -- Copyright (c) 2009-2012 Jason Perkins and the Premake project
-- --
T.vstudio_vc200x_platforms = { } local suite = test.declare("vstudio_vc200x_platforms")
local suite = T.vstudio_vc200x_platforms
local vc200x = premake.vstudio.vc200x local vc200x = premake.vstudio.vc200x

View File

@ -4,8 +4,7 @@
-- Copyright (c) 2011-2012 Jason Perkins and the Premake project -- Copyright (c) 2011-2012 Jason Perkins and the Premake project
-- --
T.vstudio_vs200x_project_refs = { } local suite = test.declare("vstudio_vs200x_project_refs")
local suite = T.vstudio_vs200x_project_refs
local vc200x = premake.vstudio.vc200x local vc200x = premake.vstudio.vc200x

View File

@ -4,8 +4,7 @@
-- Copyright (c) 2011-2012 Jason Perkins and the Premake project -- Copyright (c) 2011-2012 Jason Perkins and the Premake project
-- --
T.vstudio_vs2010_project_refs = { } local suite = test.declare("vstudio_vs2010_project_refs")
local suite = T.vstudio_vs2010_project_refs
local vc2010 = premake.vstudio.vc2010 local vc2010 = premake.vstudio.vc2010

View File

@ -4,8 +4,7 @@
-- Copyright (c) 2012 Jason Perkins and the Premake project -- Copyright (c) 2012 Jason Perkins and the Premake project
-- --
T.api_list_kind = {} local suite = test.declare("api_list_kind")
local suite = T.api_list_kind
local api = premake.api local api = premake.api

View File

@ -4,8 +4,7 @@
-- Copyright (c) 2012 Jason Perkins and the Premake project -- Copyright (c) 2012 Jason Perkins and the Premake project
-- --
T.api_path_kind = {} local suite = test.declare("api_path_kind")
local suite = T.api_path_kind
local api = premake.api local api = premake.api

View File

@ -4,8 +4,7 @@
-- Copyright (c) 2012 Jason Perkins and the Premake project -- Copyright (c) 2012 Jason Perkins and the Premake project
-- --
T.api_register = {} local suite = test.declare("api_register")
local suite = T.api_register
local api = premake.api local api = premake.api

View File

@ -4,8 +4,7 @@
-- Copyright (c) 2012 Jason Perkins and the Premake project -- Copyright (c) 2012 Jason Perkins and the Premake project
-- --
T.api_string_kind = {} local suite = test.declare("api_string_kind")
local suite = T.api_string_kind
local api = premake.api local api = premake.api

View File

@ -5,8 +5,7 @@
-- --
T.premake_override = {} local suite = test.declare("base_override")
local suite = T.premake_override
-- --

View File

@ -4,8 +4,7 @@
-- Copyright (c) 2009-2012 Jason Perkins and the Premake project -- Copyright (c) 2009-2012 Jason Perkins and the Premake project
-- --
T.tree = { } local suite = test.declare("base_tree")
local suite = T.tree
local tree = premake.tree local tree = premake.tree

View File

@ -31,7 +31,7 @@
test.openedfile(path.join(os.getcwd(), "MyLocation/MyProject.prj")) test.openedfile(path.join(os.getcwd(), "MyLocation/MyProject.prj"))
end end
function T.premake.generate_ClosesFile() function suite.generate_ClosesFile()
p.generate(prj, ".prj", function () end) p.generate(prj, ".prj", function () end)
test.closedfile(true) test.closedfile(true)
end end

View File

@ -4,35 +4,34 @@
-- Copyright (c) 2008 Jason Perkins and the Premake project -- Copyright (c) 2008 Jason Perkins and the Premake project
-- --
local suite = test.declare("string")
T.string = { }
-- --
-- string.endswith() tests -- string.endswith() tests
-- --
function T.string.endswith_ReturnsTrue_OnMatch() function suite.endswith_ReturnsTrue_OnMatch()
test.istrue(string.endswith("Abcdef", "def")) test.istrue(string.endswith("Abcdef", "def"))
end end
function T.string.endswith_ReturnsFalse_OnMismatch() function suite.endswith_ReturnsFalse_OnMismatch()
test.isfalse(string.endswith("Abcedf", "efg")) test.isfalse(string.endswith("Abcedf", "efg"))
end end
function T.string.endswith_ReturnsFalse_OnLongerNeedle() function suite.endswith_ReturnsFalse_OnLongerNeedle()
test.isfalse(string.endswith("Abc", "Abcdef")) test.isfalse(string.endswith("Abc", "Abcdef"))
end end
function T.string.endswith_ReturnsFalse_OnNilHaystack() function suite.endswith_ReturnsFalse_OnNilHaystack()
test.isfalse(string.endswith(nil, "ghi")) test.isfalse(string.endswith(nil, "ghi"))
end end
function T.string.endswith_ReturnsFalse_OnNilNeedle() function suite.endswith_ReturnsFalse_OnNilNeedle()
test.isfalse(string.endswith("Abc", nil)) test.isfalse(string.endswith("Abc", nil))
end end
function T.string.endswith_ReturnsTrue_OnExactMatch() function suite.endswith_ReturnsTrue_OnExactMatch()
test.istrue(string.endswith("/", "/")) test.istrue(string.endswith("/", "/"))
end end
@ -42,7 +41,7 @@
-- string.explode() tests -- string.explode() tests
-- --
function T.string.explode_ReturnsParts_OnValidCall() function suite.explode_ReturnsParts_OnValidCall()
test.isequal({"aaa","bbb","ccc"}, string.explode("aaa/bbb/ccc", "/", true)) test.isequal({"aaa","bbb","ccc"}, string.explode("aaa/bbb/ccc", "/", true))
end end
@ -52,22 +51,22 @@
-- string.startswith() tests -- string.startswith() tests
-- --
function T.string.startswith_OnMatch() function suite.startswith_OnMatch()
test.istrue(string.startswith("Abcdef", "Abc")) test.istrue(string.startswith("Abcdef", "Abc"))
end end
function T.string.startswith_OnMismatch() function suite.startswith_OnMismatch()
test.isfalse(string.startswith("Abcdef", "ghi")) test.isfalse(string.startswith("Abcdef", "ghi"))
end end
function T.string.startswith_OnLongerNeedle() function suite.startswith_OnLongerNeedle()
test.isfalse(string.startswith("Abc", "Abcdef")) test.isfalse(string.startswith("Abc", "Abcdef"))
end end
function T.string.startswith_OnEmptyHaystack() function suite.startswith_OnEmptyHaystack()
test.isfalse(string.startswith("", "Abc")) test.isfalse(string.startswith("", "Abc"))
end end
function T.string.startswith_OnEmptyNeedle() function suite.startswith_OnEmptyNeedle()
test.istrue(string.startswith("Abcdef", "")) test.istrue(string.startswith("Abcdef", ""))
end end