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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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