This repository has been archived on 2022-12-23. You can view files and clone it, but cannot push or open issues or pull requests.
fuck-premake-old2/tests/premake4.lua

165 lines
4.6 KiB
Lua
Raw Normal View History

--
-- tests/premake4.lua
-- Automated test suite for Premake 4.x
-- Copyright (c) 2008-2011 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
--
-- Base API tests
dofile("test_dofile.lua")
dofile("test_string.lua")
dofile("test_premake.lua")
dofile("test_platforms.lua")
dofile("test_targets.lua")
dofile("test_keywords.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_config.lua")
dofile("base/test_include.lua")
dofile("base/test_location.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")
dofile("tools/test_gcc.lua")
dofile("base/test_config_bug.lua")
2011-03-23 21:05:19 +00:00
-- Project API tests
dofile("test_project.lua")
dofile("project/test_baking.lua")
dofile("project/test_eachconfig.lua")
dofile("project/test_eachfile.lua")
dofile("project/test_vpaths.lua")
-- Baking tests
dofile("base/test_baking.lua")
dofile("baking/test_merging.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("actions/vstudio/test_vs200x_vcproj.lua")
dofile("actions/vstudio/test_vs200x_vcproj_linker.lua")
2010-06-10 15:42:45 +00:00
dofile("actions/vstudio/test_vs2010_vcxproj.lua")
dofile("actions/vstudio/test_vs2010_flags.lua")
dofile("actions/vstudio/test_vs2010_project_kinds.lua")
-- Visual Studio 2002-2003 C# projects
dofile("actions/vstudio/cs2002/files.lua")
-- Visual Studio 2005-2010 C# projects
2011-02-09 16:22:02 +00:00
dofile("actions/vstudio/cs2005/files.lua")
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")
dofile("actions/vstudio/sln2005/test_solution_platforms.lua")
-- Visual Studio 2002-2008 C/C++ projects
dofile("actions/vstudio/vc200x/test_compiler_block.lua")
dofile("actions/vstudio/vc200x/debugdir.lua")
dofile("actions/vstudio/vc200x/header.lua")
dofile("actions/vstudio/vc200x/test_files.lua")
dofile("actions/vstudio/vc200x/test_filters.lua")
dofile("actions/vstudio/vc200x/test_linker_block.lua")
dofile("actions/vstudio/vc200x/test_mfc.lua")
-- Visual Studio 2010 C/C++ projects
dofile("actions/vstudio/vc2010/test_compile_settings.lua")
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")
dofile("actions/vstudio/vc2010/test_link_settings.lua")
dofile("actions/vstudio/vc2010/test_links.lua")
dofile("actions/vstudio/vc2010/test_mfc.lua")
dofile("actions/vstudio/vc2010/test_pch.lua")
-- Makefile tests
dofile("actions/make/test_make_escaping.lua")
2010-10-19 11:14:46 +00:00
dofile("actions/make/test_make_pch.lua")
dofile("actions/make/test_make_linking.lua")
-- dofile("actions/make/test_makesettings.lua")
dofile("actions/make/test_wiidev.lua")
2011-05-12 20:00:07 +00:00
-- Xcode3 tests
dofile("actions/xcode/test_file_references.lua")
dofile("actions/xcode/test_xcode_common.lua")
dofile("actions/xcode/test_xcode_project.lua")
dofile("actions/xcode/test_xcode_dependencies.lua")
2011-05-12 20:00:07 +00:00
-- Xcode4 tests
dofile("actions/xcode/test_xcode4_project.lua")
2011-03-11 16:43:19 +00:00
dofile("actions/xcode/test_xcode4_workspace.lua")
2011-05-12 20:00:07 +00:00
-- CodeLite tests
dofile("actions/codelite/codelite_files.lua")
-- CodeBlocks tests
dofile("actions/codeblocks/codeblocks_files.lua")
dofile("actions/codeblocks/test_filters.lua")
dofile("actions/codeblocks/environment_variables.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
}