Make file name configuration tests case-insensitive

This commit is contained in:
Jason Perkins 2012-07-16 15:06:23 -04:00
parent a05fafca93
commit 3c8eae761a
2 changed files with 17 additions and 4 deletions

View File

@ -97,7 +97,7 @@
platform = cfg.platform platform = cfg.platform
} }
filename = { filename } filename = { filename:lower() }
for _, block in ipairs(cfg.solution.blocks) do for _, block in ipairs(cfg.solution.blocks) do
if oven.filter(block, cfg.terms, filename) then if oven.filter(block, cfg.terms, filename) then

View File

@ -20,9 +20,9 @@
sln, prj = test.createsolution() sln, prj = test.createsolution()
end end
local function prepare() local function prepare(filename)
local cfg = project.getconfig(prj, "Debug") local cfg = project.getconfig(prj, "Debug")
fcfg = config.getfileconfig(cfg, path.join(os.getcwd(), "hello.c")) fcfg = config.getfileconfig(cfg, path.join(os.getcwd(), filename or "hello.c"))
end end
@ -115,5 +115,18 @@
prepare() prepare()
test.isnil(fcfg.buildoptions) test.isnil(fcfg.buildoptions)
end end
--
-- Check case-sensitivity of file name tests.
--
function suite.fileMatches_onCaseMismatch()
files "Hello.c"
configuration "**/HeLLo.c"
buildoptions "-Xc"
prepare("Hello.c")
test.isequal({ "-Xc" }, fcfg.buildoptions)
end