Fixed a couple of unit tests that were failing on Windows

This commit is contained in:
Jason Perkins 2012-06-28 15:48:05 -04:00
parent dfc37def22
commit 6df59080eb
4 changed files with 26 additions and 3 deletions

View File

@ -35,7 +35,6 @@
test.capture [[
all: $(TARGETDIR) $(OBJDIR) prebuild prelink $(TARGET)
@:
]]
end
@ -54,6 +53,5 @@ all: $(TARGETDIR) $(OBJDIR) prebuild prelink $(TARGET) $(dir $(TARGETDIR))PkgInf
$(dir $(TARGETDIR))PkgInfo:
$(dir $(TARGETDIR))Info.plist:
]]
end

View File

@ -20,7 +20,7 @@
_ACTION = "test"
sln, prj = test.createsolution()
kind "StaticLib"
system "windows"
system "Windows"
end
local function prepare()
@ -96,3 +96,19 @@
test.isequal("MyTargetImports", i.basename)
end
--
-- Test library name formatting.
--
function suite.nameFormatting_onWindows()
system "Windows"
i = prepare()
test.isequal("MyProject.lib", i.name)
end
function suite.nameFormatting_onLinux()
system "Linux"
i = prepare()
test.isequal("libMyProject.a", i.name)
end

View File

@ -201,9 +201,12 @@
function suite.links_onStaticSiblingLibrary()
links { "MyProject2" }
test.createproject(sln)
system "Linux"
kind "StaticLib"
targetdir "lib"
prepare()
test.isequal({ "lib/libMyProject2.a" }, gcc.getlinks(cfg))
end
@ -215,9 +218,12 @@
function suite.links_onStaticSharedLibrary()
links { "MyProject2" }
test.createproject(sln)
system "Linux"
kind "SharedLib"
targetdir "lib"
prepare()
test.isequal({ "-lMyProject2" }, gcc.getlinks(cfg))
end

View File

@ -86,10 +86,13 @@
function suite.links_onStaticSiblingLibrary()
links { "MyProject2" }
test.createproject(sln)
system "Linux"
kind "StaticLib"
location "MyProject2"
targetdir "lib"
prepare()
test.isequal({ "lib/libMyProject2.a" }, snc.getlinks(cfg))
end