From a7fa9b914229009c7e5f3e3da0df18a13d884940 Mon Sep 17 00:00:00 2001 From: Jason Perkins Date: Wed, 16 Dec 2015 19:50:37 -0500 Subject: [PATCH] Adds the missing resource file test on PR #365 --- src/actions/vstudio/vs2010_vcxproj.lua | 2 +- .../vstudio/vc2010/test_target_machine.lua | 42 +++++++++---------- 2 files changed, 22 insertions(+), 22 deletions(-) diff --git a/src/actions/vstudio/vs2010_vcxproj.lua b/src/actions/vstudio/vs2010_vcxproj.lua index f639f998..463efef9 100644 --- a/src/actions/vstudio/vs2010_vcxproj.lua +++ b/src/actions/vstudio/vs2010_vcxproj.lua @@ -1774,7 +1774,7 @@ x86 = "MachineX86", x86_64 = "MachineX64", } - if cfg.kind == p.STATICLIB then + if cfg.kind == p.STATICLIB and config.hasFile(cfg, path.isresourcefile) then local value = targetmachine[cfg.architecture] if value ~= nil then m.element("TargetMachine", nil, '%s', value) diff --git a/tests/actions/vstudio/vc2010/test_target_machine.lua b/tests/actions/vstudio/vc2010/test_target_machine.lua index 641061c1..8402772b 100644 --- a/tests/actions/vstudio/vc2010/test_target_machine.lua +++ b/tests/actions/vstudio/vc2010/test_target_machine.lua @@ -33,6 +33,7 @@ function suite.emitsOnStaticLibWithX86() kind "StaticLib" architecture "x86" + files { "hello.rc" } prepare() test.capture [[ MachineX86 @@ -42,6 +43,7 @@ function suite.emitsOnStaticLibWithX86_64() kind "StaticLib" architecture "x86_64" + files { "hello.rc" } prepare() test.capture [[ MachineX64 @@ -54,34 +56,32 @@ -- Other combinations should NOT emit anything -- - function suite.isIgnoredOnConsoleAppNoArch() - kind "ConsoleApp" - prepare() - test.isemptycapture() - end - - function suite.isIgnoredOnConsoleAppWithX86() - kind "ConsoleApp" - architecture "x86" - prepare() - test.isemptycapture() - end - function suite.isIgnoredOnStaticLibNoArch() kind "StaticLib" + files { "hello.rc" } prepare() test.isemptycapture() end - function suite.isIgnoredOnSharedLibNoArch() - kind "SharedLib" - prepare() - test.isemptycapture() - end - - function suite.isIgnoredOnSharedLibWithX86() - kind "SharedLib" + function suite.isIgnoredOnStaticLibNoResource() + kind "StaticLib" architecture "x86" prepare() test.isemptycapture() end + + function suite.isIgnoredOnConsoleApp() + kind "ConsoleApp" + architecture "x86" + files { "hello.rc" } + prepare() + test.isemptycapture() + end + + function suite.isIgnoredOnSharedLib() + kind "SharedLib" + architecture "x86" + files { "hello.rc" } + prepare() + test.isemptycapture() + end