1-- 2-- tests/actions/vstudio/vc200x/test_filters.lua 3-- Validate generation of filter blocks in Visual Studio 200x C/C++ projects. 4-- Copyright (c) 2011 Jason Perkins and the Premake project 5-- 6 7T.vs200x_filters = { } 8local suite = T.vs200x_filters 9local vc200x = premake.vstudio.vc200x 10 11 12-- 13-- Setup/teardown 14-- 15 16 local sln, prj 17 local os_uuid 18 19 function suite.setup() 20 os_uuid = os.uuid 21 os.uuid = function() return "00112233-4455-6677-8888-99AABBCCDDEE" end 22 23 _ACTION = "vs2008" 24 sln, prj = test.createsolution() 25 end 26 27 function suite.teardown() 28 os.uuid = os_uuid 29 end 30 31 local function prepare() 32 premake.bake.buildconfigs() 33 sln.vstudio_configs = premake.vstudio.buildconfigs(sln) 34 prj = premake.solution.getproject(sln,1) 35 end 36 37 38-- 39-- File/filter assignment tests 40-- 41 42 function suite.Filter_UsesVirtualForm_OnVpath() 43 files { "src/hello.cpp" } 44 vpaths { ["Source Files"] = "**.cpp" } 45 prepare() 46 vc200x.Files(prj) 47 test.capture [[ 48 <Filter 49 Name="Source Files" 50 Filter="" 51 > 52 <File 53 RelativePath="src\hello.cpp" 54 > 55 </File> 56 </Filter> 57 ]] 58 end 59