-- -- tests/actions/vstudio/vc2010/test_output_props.lua -- Validate generation of the output property groups. -- Copyright (c) 2011-2013 Jason Perkins and the Premake project -- local suite = test.declare("vstudio_vs2010_output_props") local vc2010 = premake.vstudio.vc2010 -- -- Setup -- local sln function suite.setup() _ACTION = "vs2010" sln, prj = test.createsolution() end local function prepare() local cfg = test.getconfig(prj, "Debug") vc2010.outputProperties(cfg) end -- -- Check the structure with the default project values. -- function suite.structureIsCorrect_onDefaultValues() prepare() test.capture [[ true .\ obj\Debug\ MyProject .exe ]] end -- -- This entire block gets skipped for Makefile projects. -- function suite.omitsBlock_onMakefile() kind "Makefile" prepare() test.isemptycapture() end function suite.omitsBlock_onNone() kind "Makefile" prepare() test.isemptycapture() end -- -- Xbox360 adds an extra element to the block. -- function suite.structureIsCorrect_onXbox360() system "Xbox360" prepare() test.capture [[ true .\ $(OutDir)MyProject.exe obj\Debug\ MyProject .exe $(OutDir)$(TargetName).xex ]] end function suite.staticLibStructureIsCorrect_onXbox360() system "Xbox360" kind "StaticLib" prepare() test.capture [[ .\ $(OutDir)MyProject.lib obj\Debug\ MyProject .lib $(OutDir)$(TargetName).xex ]] end -- -- Static libraries should omit the link incremental element entirely. -- function suite.omitLinkIncremental_onStaticLib() kind "StaticLib" prepare() test.capture [[ .\ ]] end -- -- Optimized builds should not link incrementally. -- function suite.noIncrementalLink_onOptimizedBuild() optimize "On" prepare() test.capture [[ false ]] end -- -- The target directory is applied, if specified. -- function suite.outDir_onTargetDir() targetdir "../bin" prepare() test.capture [[ true ..\bin\ ]] end -- -- The objeccts directory is applied, if specified. -- function suite.intDir_onTargetDir() objdir "../tmp" prepare() test.capture [[ true .\ ..\tmp\Debug\ ]] end -- -- The target name is applied, if specified. -- function suite.targetName_onTargetName() targetname "MyTarget" prepare() test.capture [[ true .\ obj\Debug\ MyTarget ]] end -- -- If the NoImportLib flag is set, add the IgnoreImportLibrary element. -- function suite.ignoreImportLib_onNoImportLib() kind "SharedLib" flags "NoImportLib" prepare() test.capture [[ true true ]] end function suite.omitIgnoreImportLib_onNonSharedLib() kind "ConsoleApp" flags "NoImportLib" prepare() test.capture [[ true .\ ]] end -- -- If the NoManifest flag is set, add the GenerateManifest element. -- function suite.generateManifest_onNoManifest() flags "NoManifest" prepare() test.capture [[ true .\ obj\Debug\ MyProject .exe false ]] end --- -- The should be split if there is no extension. --- function suite.splitTargetExt_onNoTargetExtension() targetextension "" prepare() test.capture [[ true .\ obj\Debug\ MyProject ]] end -- -- Check the handling of extra cleaning extensions. -- function suite.extensionsToDeleteOnClean() cleanExtensions { ".temp1", ".temp2" } prepare() test.capture [[ true .\ obj\Debug\ MyProject .exe *.temp1;*.temp2;$(ExtensionsToDeleteOnClean) ]] end