From 041d01bb21f1cb6c8ee3906cb67fd4ab2fd6d5c1 Mon Sep 17 00:00:00 2001 From: Tom van Dijck Date: Tue, 1 Aug 2017 09:46:12 -0700 Subject: [PATCH] Fix action (#138) * Fix unit-test correctly setting action. --- modules/self-test/test_runner.lua | 5 ++++- modules/vstudio/tests/cs2005/test_icon.lua | 1 + modules/vstudio/tests/vc200x/test_build_steps.lua | 1 + modules/vstudio/tests/vc200x/test_nmake_settings.lua | 1 + modules/vstudio/tests/vc200x/test_project.lua | 6 +++--- modules/vstudio/tests/vc2010/test_build_events.lua | 1 + modules/vstudio/tests/vc2010/test_character_set.lua | 2 +- modules/vstudio/tests/vc2010/test_globals.lua | 8 ++++---- modules/vstudio/tests/vc2010/test_imagexex_settings.lua | 1 + modules/vstudio/tests/vc2010/test_item_def_group.lua | 1 + modules/vstudio/tests/vc2010/test_target_machine.lua | 1 + tests/project/test_getconfig.lua | 7 ++++--- 12 files changed, 23 insertions(+), 12 deletions(-) diff --git a/modules/self-test/test_runner.lua b/modules/self-test/test_runner.lua index 152a973f..974b4341 100644 --- a/modules/self-test/test_runner.lua +++ b/modules/self-test/test_runner.lua @@ -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 diff --git a/modules/vstudio/tests/cs2005/test_icon.lua b/modules/vstudio/tests/cs2005/test_icon.lua index b41f30fd..012ffa23 100644 --- a/modules/vstudio/tests/cs2005/test_icon.lua +++ b/modules/vstudio/tests/cs2005/test_icon.lua @@ -16,6 +16,7 @@ local wks function suite.setup() + p.action.set("vs2005") wks, prj = test.createWorkspace() end diff --git a/modules/vstudio/tests/vc200x/test_build_steps.lua b/modules/vstudio/tests/vc200x/test_build_steps.lua index 69ee1ac2..c7fc7aaf 100644 --- a/modules/vstudio/tests/vc200x/test_build_steps.lua +++ b/modules/vstudio/tests/vc200x/test_build_steps.lua @@ -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 diff --git a/modules/vstudio/tests/vc200x/test_nmake_settings.lua b/modules/vstudio/tests/vc200x/test_nmake_settings.lua index 3cead83a..5274d070 100644 --- a/modules/vstudio/tests/vc200x/test_nmake_settings.lua +++ b/modules/vstudio/tests/vc200x/test_nmake_settings.lua @@ -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" diff --git a/modules/vstudio/tests/vc200x/test_project.lua b/modules/vstudio/tests/vc200x/test_project.lua index dd1ec28e..d0d312b3 100644 --- a/modules/vstudio/tests/vc200x/test_project.lua +++ b/modules/vstudio/tests/vc200x/test_project.lua @@ -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 [[ @@ -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 [[ @@ -240,7 +240,7 @@ end function suite.windowsTargetPlatformVersion_on2015() - _ACTION = "vs2015" + p.action.set("vs2015") systemversion "10.0.10240.0" prepare() test.capture [[ diff --git a/modules/vstudio/tests/vc2010/test_imagexex_settings.lua b/modules/vstudio/tests/vc2010/test_imagexex_settings.lua index a2303939..313ba432 100644 --- a/modules/vstudio/tests/vc2010/test_imagexex_settings.lua +++ b/modules/vstudio/tests/vc2010/test_imagexex_settings.lua @@ -17,6 +17,7 @@ local wks, prj function suite.setup() + p.action.set("vs2010") wks, prj = test.createWorkspace() platforms "xbox360" end diff --git a/modules/vstudio/tests/vc2010/test_item_def_group.lua b/modules/vstudio/tests/vc2010/test_item_def_group.lua index 59718623..e6909b34 100644 --- a/modules/vstudio/tests/vc2010/test_item_def_group.lua +++ b/modules/vstudio/tests/vc2010/test_item_def_group.lua @@ -17,6 +17,7 @@ local wks, prj function suite.setup() + p.action.set("vs2010") wks, prj = test.createWorkspace() end diff --git a/modules/vstudio/tests/vc2010/test_target_machine.lua b/modules/vstudio/tests/vc2010/test_target_machine.lua index 73968bc3..25b73ff5 100644 --- a/modules/vstudio/tests/vc2010/test_target_machine.lua +++ b/modules/vstudio/tests/vc2010/test_target_machine.lua @@ -16,6 +16,7 @@ local wks, prj function suite.setup() + p.action.set("vs2010") wks, prj = test.createWorkspace() end diff --git a/tests/project/test_getconfig.lua b/tests/project/test_getconfig.lua index 78b4f447..732b7df7 100755 --- a/tests/project/test_getconfig.lua +++ b/tests/project/test_getconfig.lua @@ -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" }