2009-04-28 00:19:44 +00:00
|
|
|
--
|
|
|
|
-- tests/tests_stress.lua
|
|
|
|
-- Stress test for Premake.
|
2013-01-03 16:11:31 +00:00
|
|
|
-- Copyright (c) 2009, 2013 Jason Perkins and the Premake project
|
2009-04-28 00:19:44 +00:00
|
|
|
--
|
|
|
|
|
2013-01-04 16:32:52 +00:00
|
|
|
local numprojects = 10
|
2013-01-03 16:11:31 +00:00
|
|
|
local numfiles = 100
|
|
|
|
local numbuildcfgs = 4
|
|
|
|
local numplatforms = 6
|
|
|
|
|
2009-04-28 00:19:44 +00:00
|
|
|
|
|
|
|
dofile("pepperfish_profiler.lua")
|
|
|
|
profiler = newProfiler()
|
2013-01-03 16:11:31 +00:00
|
|
|
profiler:start()
|
2009-04-28 00:19:44 +00:00
|
|
|
|
|
|
|
|
2015-08-28 20:16:14 +00:00
|
|
|
workspace "MyWorkspace"
|
2009-04-28 00:19:44 +00:00
|
|
|
location "build"
|
2013-01-03 16:11:31 +00:00
|
|
|
|
|
|
|
for i = 1, numbuildcfgs do
|
|
|
|
configurations ( "BuildCfg" .. i )
|
|
|
|
end
|
|
|
|
|
|
|
|
for i = 1, numplatforms do
|
|
|
|
platforms ( "Platform" .. i )
|
|
|
|
end
|
|
|
|
|
2009-04-28 00:19:44 +00:00
|
|
|
|
|
|
|
for pi = 1, numprojects do
|
2013-01-03 16:11:31 +00:00
|
|
|
|
2009-04-28 00:19:44 +00:00
|
|
|
project ("Project" .. pi)
|
|
|
|
location "build"
|
|
|
|
kind "ConsoleApp"
|
|
|
|
language "C++"
|
2013-01-03 16:11:31 +00:00
|
|
|
|
2009-04-28 00:19:44 +00:00
|
|
|
for fi = 1, numfiles do
|
|
|
|
files { "file" .. fi .. ".cpp" }
|
|
|
|
end
|
2013-01-03 16:11:31 +00:00
|
|
|
|
2009-04-28 00:19:44 +00:00
|
|
|
end
|
2013-01-03 16:11:31 +00:00
|
|
|
|
|
|
|
|
|
|
|
newaction
|
|
|
|
{
|
|
|
|
trigger = "stress",
|
|
|
|
description = "Run a stress test",
|
|
|
|
execute = function()
|
|
|
|
_ACTION = "vs2008"
|
|
|
|
premake.action.call(_ACTION)
|
|
|
|
|
|
|
|
profiler:stop()
|
|
|
|
|
|
|
|
local outfile = io.open("build/profile.txt", "w+" )
|
|
|
|
profiler:report(outfile)
|
|
|
|
outfile:close()
|
|
|
|
end
|
|
|
|
}
|