Fix action (#138)

* Fix unit-test correctly setting action.
This commit is contained in:
Tom van Dijck 2017-08-01 09:46:12 -07:00
parent 4fc5827496
commit 041d01bb21
12 changed files with 23 additions and 12 deletions

View File

@ -82,6 +82,9 @@
_TESTS_DIR = test.suite._TESTS_DIR
_SCRIPT_DIR = test.suite._SCRIPT_DIR
m.suiteName = test.suiteName
m.testName = test.testName
local ok, err = _.setupTest(test)
if ok then
@ -153,7 +156,7 @@
function _.removeTestingHooks(hooks)
_ACTION = hooks.action
p.action.set(hooks.action)
_OPTIONS = hooks.options
_TARGET_OS = hooks.targetOs

View File

@ -16,6 +16,7 @@
local wks
function suite.setup()
p.action.set("vs2005")
wks, prj = test.createWorkspace()
end

View File

@ -16,6 +16,7 @@
local wks, prj
function suite.setup()
p.action.set("vs2005")
p.escaper(p.vstudio.vs2005.esc)
wks, prj = test.createWorkspace()
end

View File

@ -16,6 +16,7 @@
local wks, prj
function suite.setup()
p.action.set("vs2005")
p.escaper(p.vstudio.vs2005.esc)
wks, prj = test.createWorkspace()
kind "Makefile"

View File

@ -16,7 +16,7 @@
local wks, prj
function suite.setup()
_ACTION = 'vs2008'
p.action.set("vs2008")
wks = test.createWorkspace()
uuid "AE61726D-187C-E440-BD07-2556188A6565"
end
@ -32,7 +32,7 @@
--
function suite.hasCorrectVersion_on2005()
_ACTION = 'vs2005'
p.action.set("vs2005")
prepare()
test.capture [[
<VisualStudioProject
@ -42,7 +42,7 @@
end
function suite.hasCorrectVersion_on2008()
_ACTION = 'vs2008'
p.action.set("vs2008")
prepare()
test.capture [[
<VisualStudioProject

View File

@ -16,6 +16,7 @@
local wks, prj, cfg
function suite.setup()
p.action.set("vs2010")
p.escaper(p.vstudio.vs2010.esc)
wks = test.createWorkspace()
end

View File

@ -12,7 +12,7 @@
local wks, prj
function suite.setup()
_ACTION = "vs2010"
p.action.set("vs2010")
wks, prj = test.createWorkspace()
end

View File

@ -200,7 +200,7 @@
--
function suite.windowsTargetPlatformVersionMissing_on2013Default()
_ACTION = "vs2013"
p.action.set("vs2013")
prepare()
test.capture [[
<PropertyGroup Label="Globals">
@ -213,7 +213,7 @@
end
function suite.windowsTargetPlatformVersionMissing_on2013()
_ACTION = "vs2013"
p.action.set("vs2013")
systemversion "10.0.10240.0"
prepare()
test.capture [[
@ -227,7 +227,7 @@
end
function suite.windowsTargetPlatformVersionMissing_on2015Default()
_ACTION = "vs2015"
p.action.set("vs2015")
prepare()
test.capture [[
<PropertyGroup Label="Globals">
@ -240,7 +240,7 @@
end
function suite.windowsTargetPlatformVersion_on2015()
_ACTION = "vs2015"
p.action.set("vs2015")
systemversion "10.0.10240.0"
prepare()
test.capture [[

View File

@ -17,6 +17,7 @@
local wks, prj
function suite.setup()
p.action.set("vs2010")
wks, prj = test.createWorkspace()
platforms "xbox360"
end

View File

@ -17,6 +17,7 @@
local wks, prj
function suite.setup()
p.action.set("vs2010")
wks, prj = test.createWorkspace()
end

View File

@ -16,6 +16,7 @@
local wks, prj
function suite.setup()
p.action.set("vs2010")
wks, prj = test.createWorkspace()
end

View File

@ -4,6 +4,7 @@
-- Copyright (c) 2011-2014 Jason Perkins and the Premake project
--
local p = premake
local suite = test.declare("project_getconfig")
--
@ -46,7 +47,7 @@
function suite.actionOverridesOS()
_TARGET_OS = "linux"
_ACTION = "vs2005"
p.action.set("vs2005")
project ("MyProject")
filter { "system:windows" }
defines { "correct" }
@ -62,7 +63,7 @@
function suite.usesCfgSystem()
_TARGET_OS = "linux"
_ACTION = "vs2005"
p.action.set("vs2005")
project ("MyProject")
system "macosx"
filter { "system:macosx" }
@ -77,7 +78,7 @@
--
function suite.appliesActionToFilters()
_ACTION = "vs2005"
p.action.set("vs2005")
project ("MyProject")
filter { "action:vs2005" }
defines { "correct" }