premake/tests/premake4.lua

97 lines
2.0 KiB
Lua
Raw Normal View History

--
-- tests/premake4.lua
-- Automated test suite for Premake 4.x
-- Copyright (c) 2008-2010 Jason Perkins and the Premake project
--
dofile("testfx.lua")
--
-- Some helper functions
--
test.createsolution = function()
local sln = solution "MySolution"
configurations { "Debug", "Release" }
local prj = project "MyProject"
language "C++"
kind "ConsoleApp"
return sln, prj
end
test.createproject = function(sln)
local n = #sln.projects + 1
if n == 1 then n = "" end
local prj = project ("MyProject" .. n)
language "C++"
kind "ConsoleApp"
return prj
end
--
-- The test suites
--
dofile("test_dofile.lua")
dofile("test_string.lua")
dofile("test_premake.lua")
dofile("test_project.lua")
dofile("test_configs.lua")
dofile("test_platforms.lua")
dofile("test_targets.lua")
dofile("test_keywords.lua")
dofile("test_gcc.lua")
dofile("test_gmake_cpp.lua")
dofile("test_gmake_cs.lua")
dofile("base/test_api.lua")
2009-07-16 14:29:08 +00:00
dofile("base/test_action.lua")
dofile("base/test_os.lua")
dofile("base/test_path.lua")
dofile("base/test_table.lua")
2009-08-18 19:09:17 +00:00
dofile("base/test_tree.lua")
-- Clean tests
2009-07-14 14:28:26 +00:00
dofile("actions/test_clean.lua")
-- Visual Studio tests
dofile("test_vs2002_sln.lua")
dofile("test_vs2003_sln.lua")
dofile("test_vs2005_sln.lua")
dofile("test_vs2008_sln.lua")
2010-06-10 15:42:45 +00:00
dofile("test_vs2010_sln.lua")
2010-03-04 21:01:45 +00:00
dofile("actions/vstudio/test_vs2005_csproj.lua")
dofile("actions/vstudio/test_vs200x_vcproj.lua")
2010-06-10 15:42:45 +00:00
dofile("actions/vstudio/test_vs2010_vcxproj.lua")
2010-06-11 21:07:07 +00:00
dofile("actions/vstudio/test_vs2010_flags.lua")
-- Xcode tests
dofile("actions/xcode/test_xcode_common.lua")
dofile("actions/xcode/test_xcode_project.lua")
dofile("actions/xcode/test_xcode_dependencies.lua")
--
-- Register a test action
--
newaction {
trigger = "test",
description = "Run the automated test suite",
execute = function ()
passed, failed = test.runall()
msg = string.format("%d tests passed, %d failed", passed, failed)
if (failed > 0) then
error(msg, 0)
else
print(msg)
end
end
}