2008-10-31 18:38:05 +00:00
|
|
|
--
|
|
|
|
-- tests/premake4.lua
|
|
|
|
-- Automated test suite for Premake 4.x
|
2011-02-10 17:24:51 +00:00
|
|
|
-- Copyright (c) 2008-2011 Jason Perkins and the Premake project
|
2008-10-31 18:38:05 +00:00
|
|
|
--
|
|
|
|
|
|
|
|
dofile("testfx.lua")
|
2009-09-15 21:08:40 +00:00
|
|
|
|
|
|
|
--
|
|
|
|
-- Some helper functions
|
|
|
|
--
|
|
|
|
|
|
|
|
test.createsolution = function()
|
|
|
|
local sln = solution "MySolution"
|
|
|
|
configurations { "Debug", "Release" }
|
2011-11-08 21:43:49 +00:00
|
|
|
|
2009-09-15 21:08:40 +00:00
|
|
|
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
|
2011-11-08 21:43:49 +00:00
|
|
|
|
2009-09-15 21:08:40 +00:00
|
|
|
local prj = project ("MyProject" .. n)
|
|
|
|
language "C++"
|
|
|
|
kind "ConsoleApp"
|
|
|
|
return prj
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
--
|
|
|
|
-- The test suites
|
|
|
|
--
|
|
|
|
|
2008-10-31 18:38:05 +00:00
|
|
|
dofile("test_dofile.lua")
|
|
|
|
dofile("test_string.lua")
|
|
|
|
dofile("test_premake.lua")
|
2009-04-09 20:02:49 +00:00
|
|
|
dofile("test_platforms.lua")
|
2008-12-05 21:18:47 +00:00
|
|
|
dofile("test_targets.lua")
|
2008-12-18 17:53:57 +00:00
|
|
|
dofile("test_keywords.lua")
|
2009-04-23 18:26:31 +00:00
|
|
|
dofile("test_gmake_cpp.lua")
|
2009-07-13 19:10:27 +00:00
|
|
|
dofile("test_gmake_cs.lua")
|
2010-02-17 22:11:25 +00:00
|
|
|
dofile("base/test_api.lua")
|
2009-07-16 14:29:08 +00:00
|
|
|
dofile("base/test_action.lua")
|
2010-09-05 20:10:28 +00:00
|
|
|
dofile("base/test_config.lua")
|
2011-04-27 22:43:15 +00:00
|
|
|
dofile("base/test_location.lua")
|
2010-01-13 23:29:21 +00:00
|
|
|
dofile("base/test_os.lua")
|
2009-09-29 19:27:33 +00:00
|
|
|
dofile("base/test_path.lua")
|
2010-02-17 22:11:25 +00:00
|
|
|
dofile("base/test_table.lua")
|
2009-08-18 19:09:17 +00:00
|
|
|
dofile("base/test_tree.lua")
|
2011-02-10 17:24:51 +00:00
|
|
|
dofile("tools/test_gcc.lua")
|
2011-03-17 04:17:36 +00:00
|
|
|
dofile("base/test_config_bug.lua")
|
2011-03-23 21:05:19 +00:00
|
|
|
|
2011-06-09 19:15:39 +00:00
|
|
|
-- Project API tests
|
|
|
|
dofile("test_project.lua")
|
2011-06-30 20:44:40 +00:00
|
|
|
dofile("project/test_eachfile.lua")
|
2011-06-09 19:15:39 +00:00
|
|
|
dofile("project/test_vpaths.lua")
|
2011-11-08 21:43:49 +00:00
|
|
|
|
2011-06-02 19:26:15 +00:00
|
|
|
-- Baking tests
|
|
|
|
dofile("base/test_baking.lua")
|
|
|
|
dofile("baking/test_merging.lua")
|
2011-11-08 21:43:49 +00:00
|
|
|
|
2010-02-26 22:10:57 +00:00
|
|
|
-- Clean tests
|
2009-07-14 14:28:26 +00:00
|
|
|
dofile("actions/test_clean.lua")
|
2011-11-08 21:43:49 +00:00
|
|
|
|
2010-02-26 22:10:57 +00:00
|
|
|
-- Visual Studio tests
|
|
|
|
dofile("test_vs2002_sln.lua")
|
|
|
|
dofile("test_vs2003_sln.lua")
|
|
|
|
dofile("actions/vstudio/test_vs200x_vcproj.lua")
|
2010-10-13 14:20:26 +00:00
|
|
|
dofile("actions/vstudio/test_vs200x_vcproj_linker.lua")
|
2010-06-10 15:42:45 +00:00
|
|
|
dofile("actions/vstudio/test_vs2010_vcxproj.lua")
|
2010-09-05 20:10:28 +00:00
|
|
|
dofile("actions/vstudio/test_vs2010_flags.lua")
|
2010-06-16 17:21:29 +00:00
|
|
|
dofile("actions/vstudio/test_vs2010_project_kinds.lua")
|
2011-02-16 20:16:07 +00:00
|
|
|
|
|
|
|
-- Visual Studio 2002-2003 C# projects
|
2011-02-08 16:08:16 +00:00
|
|
|
dofile("actions/vstudio/cs2002/files.lua")
|
2011-02-16 20:16:07 +00:00
|
|
|
|
|
|
|
-- Visual Studio 2005-2010 C# projects
|
2011-02-09 16:22:02 +00:00
|
|
|
dofile("actions/vstudio/cs2005/files.lua")
|
2011-02-16 20:16:07 +00:00
|
|
|
dofile("actions/vstudio/cs2005/projectelement.lua")
|
|
|
|
dofile("actions/vstudio/cs2005/projectsettings.lua")
|
|
|
|
dofile("actions/vstudio/cs2005/propertygroup.lua")
|
|
|
|
|
|
|
|
-- Visual Studio 2005-2010 solutions
|
|
|
|
dofile("actions/vstudio/sln2005/dependencies.lua")
|
|
|
|
dofile("actions/vstudio/sln2005/header.lua")
|
|
|
|
dofile("actions/vstudio/sln2005/layout.lua")
|
|
|
|
dofile("actions/vstudio/sln2005/platforms.lua")
|
|
|
|
dofile("actions/vstudio/sln2005/projectplatforms.lua")
|
|
|
|
dofile("actions/vstudio/sln2005/projects.lua")
|
|
|
|
|
2011-04-25 19:55:17 +00:00
|
|
|
-- Visual Studio 2002-2008 C/C++ projects
|
|
|
|
dofile("actions/vstudio/vc200x/debugdir.lua")
|
|
|
|
dofile("actions/vstudio/vc200x/header.lua")
|
2011-02-08 16:08:16 +00:00
|
|
|
dofile("actions/vstudio/vc200x/files.lua")
|
2011-08-09 20:11:35 +00:00
|
|
|
dofile("actions/vstudio/vc200x/test_filters.lua")
|
2011-11-08 21:43:49 +00:00
|
|
|
|
2011-04-25 19:55:17 +00:00
|
|
|
-- Visual Studio 2010 C/C++ projects
|
2011-07-01 19:05:16 +00:00
|
|
|
dofile("actions/vstudio/vc2010/test_debugdir.lua")
|
|
|
|
dofile("actions/vstudio/vc2010/test_header.lua")
|
|
|
|
dofile("actions/vstudio/vc2010/test_files.lua")
|
|
|
|
dofile("actions/vstudio/vc2010/test_filters.lua")
|
2011-11-13 20:07:31 +00:00
|
|
|
dofile("actions/vstudio/vc2010/test_link_settings.lua")
|
2011-11-08 21:43:49 +00:00
|
|
|
dofile("actions/vstudio/vc2010/test_links.lua")
|
2011-07-12 20:55:27 +00:00
|
|
|
dofile("actions/vstudio/vc2010/test_pch.lua")
|
2008-10-31 18:38:05 +00:00
|
|
|
|
2010-10-04 10:43:19 +00:00
|
|
|
-- Makefile tests
|
|
|
|
dofile("actions/make/test_make_escaping.lua")
|
2010-10-19 11:14:46 +00:00
|
|
|
dofile("actions/make/test_make_pch.lua")
|
2011-03-26 00:21:44 +00:00
|
|
|
dofile("actions/make/test_make_linking.lua")
|
2011-09-15 20:45:48 +00:00
|
|
|
-- dofile("actions/make/test_makesettings.lua")
|
|
|
|
dofile("actions/make/test_wiidev.lua")
|
|
|
|
|
2011-05-12 20:00:07 +00:00
|
|
|
-- Xcode3 tests
|
2009-11-03 21:35:24 +00:00
|
|
|
dofile("actions/xcode/test_xcode_common.lua")
|
|
|
|
dofile("actions/xcode/test_xcode_project.lua")
|
2009-11-25 19:40:23 +00:00
|
|
|
dofile("actions/xcode/test_xcode_dependencies.lua")
|
2009-12-22 16:07:55 +00:00
|
|
|
|
2011-05-12 20:00:07 +00:00
|
|
|
-- Xcode4 tests
|
2011-10-20 20:36:24 +00:00
|
|
|
dofile("actions/xcode/test_xcode4_project.lua")
|
2011-03-11 16:43:19 +00:00
|
|
|
dofile("actions/xcode/test_xcode4_workspace.lua")
|
2011-11-08 21:43:49 +00:00
|
|
|
|
2011-05-12 20:00:07 +00:00
|
|
|
-- CodeLite tests
|
|
|
|
dofile("actions/codelite/codelite_files.lua")
|
2011-11-08 21:43:49 +00:00
|
|
|
|
2011-05-12 20:14:43 +00:00
|
|
|
-- CodeBlocks tests
|
|
|
|
dofile("actions/codeblocks/codeblocks_files.lua")
|
2011-08-19 12:58:12 +00:00
|
|
|
dofile("actions/codeblocks/test_filters.lua")
|
2011-08-23 20:48:16 +00:00
|
|
|
dofile("actions/codeblocks/environment_variables.lua")
|
2008-10-31 18:38:05 +00:00
|
|
|
|
|
|
|
--
|
|
|
|
-- Register a test action
|
|
|
|
--
|
|
|
|
|
2009-08-11 00:11:48 +00:00
|
|
|
newaction {
|
|
|
|
trigger = "test",
|
2008-10-31 18:38:05 +00:00
|
|
|
description = "Run the automated test suite",
|
2011-11-08 21:43:49 +00:00
|
|
|
|
2008-10-31 18:38:05 +00:00
|
|
|
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
|
|
|
|
}
|