Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/windirstat/premake-4.x.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJason Perkins <starkos@industriousone.com>2011-02-10 20:24:51 +0300
committerJason Perkins <starkos@industriousone.com>2011-02-10 20:24:51 +0300
commita69bcbfb58125432e08f5ca014adfbc25ab76d0c (patch)
treef64537fd006d8d4b61f1fbc9f855b6c3de7246e5 /tests/tools
parentb3dfe26ec69d7412a27c7600bc414d7c2d936cff (diff)
Added support for Haiku OS (Yuriy O'Donnell)
Diffstat (limited to 'tests/tools')
-rw-r--r--tests/tools/test_gcc.lua86
1 files changed, 86 insertions, 0 deletions
diff --git a/tests/tools/test_gcc.lua b/tests/tools/test_gcc.lua
new file mode 100644
index 0000000..c7fed84
--- /dev/null
+++ b/tests/tools/test_gcc.lua
@@ -0,0 +1,86 @@
+--
+-- tests/test_gcc.lua
+-- Automated test suite for the GCC toolset interface.
+-- Copyright (c) 2009-2011 Jason Perkins and the Premake project
+--
+
+ T.gcc = { }
+ local suite = T.gcc
+
+ local cfg
+ function suite.setup()
+ cfg = { }
+ cfg.basedir = "."
+ cfg.location = "."
+ cfg.language = "C++"
+ cfg.project = { name = "MyProject" }
+ cfg.flags = { }
+ cfg.objectsdir = "obj"
+ cfg.platform = "Native"
+ cfg.links = { }
+ cfg.libdirs = { }
+ cfg.linktarget = { fullpath="libMyProject.a" }
+ end
+
+
+--
+-- CPPFLAGS tests
+--
+
+ function suite.cppflags_OnWindows()
+ cfg.system = "windows"
+ local r = premake.gcc.getcppflags(cfg)
+ test.isequal("-MMD -MP", table.concat(r, " "))
+ end
+
+ function suite.cppflags_OnHaiku()
+ cfg.system = "haiku"
+ local r = premake.gcc.getcppflags(cfg)
+ test.isequal("-MMD", table.concat(r, " "))
+ end
+
+
+
+--
+-- CFLAGS tests
+--
+
+ function suite.cflags_SharedLib_Windows()
+ cfg.kind = "SharedLib"
+ cfg.system = "windows"
+ local r = premake.gcc.getcflags(cfg)
+ test.isequal('', table.concat(r,"|"))
+ end
+
+
+ function suite.cflags_OnFpFast()
+ cfg.flags = { "FloatFast" }
+ local r = premake.gcc.getcflags(cfg)
+ test.isequal('-ffast-math', table.concat(r,"|"))
+ end
+
+
+ function suite.cflags_OnFpStrict()
+ cfg.flags = { "FloatStrict" }
+ local r = premake.gcc.getcflags(cfg)
+ test.isequal('-ffloat-store', table.concat(r,"|"))
+ end
+
+
+--
+-- LDFLAGS tests
+--
+
+ function suite.ldflags_SharedLib_Windows()
+ cfg.kind = "SharedLib"
+ cfg.system = "windows"
+ local r = premake.gcc.getldflags(cfg)
+ test.isequal('-s|-shared|-Wl,--out-implib="libMyProject.a"', table.concat(r,"|"))
+ end
+
+
+ function suite.linkflags_OnFrameworks()
+ cfg.links = { "Cocoa.framework" }
+ local r = premake.gcc.getlinkflags(cfg)
+ test.isequal('-framework Cocoa', table.concat(r,"|"))
+ end