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

View File

@ -20,7 +20,7 @@
_ACTION = "test" _ACTION = "test"
sln, prj = test.createsolution() sln, prj = test.createsolution()
kind "StaticLib" kind "StaticLib"
system "windows" system "Windows"
end end
local function prepare() local function prepare()
@ -96,3 +96,19 @@
test.isequal("MyTargetImports", i.basename) test.isequal("MyTargetImports", i.basename)
end 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() function suite.links_onStaticSiblingLibrary()
links { "MyProject2" } links { "MyProject2" }
test.createproject(sln) test.createproject(sln)
system "Linux"
kind "StaticLib" kind "StaticLib"
targetdir "lib" targetdir "lib"
prepare() prepare()
test.isequal({ "lib/libMyProject2.a" }, gcc.getlinks(cfg)) test.isequal({ "lib/libMyProject2.a" }, gcc.getlinks(cfg))
end end
@ -215,9 +218,12 @@
function suite.links_onStaticSharedLibrary() function suite.links_onStaticSharedLibrary()
links { "MyProject2" } links { "MyProject2" }
test.createproject(sln) test.createproject(sln)
system "Linux"
kind "SharedLib" kind "SharedLib"
targetdir "lib" targetdir "lib"
prepare() prepare()
test.isequal({ "-lMyProject2" }, gcc.getlinks(cfg)) test.isequal({ "-lMyProject2" }, gcc.getlinks(cfg))
end end

View File

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