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

github.com/windirstat/premake-4.x-stable.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorJason Perkins <starkos@industriousone.com>2011-05-13 00:14:43 +0400
committerJason Perkins <starkos@industriousone.com>2011-05-13 00:14:43 +0400
commit21b38a71196abb96de0ee9de2705e3afd0a9b7da (patch)
treeec126dac824e09a5832c8cc0621b53eddfd917c5 /tests
parentdafe3ba6ec5cbd7dc803317e9c99c2ec645b586f (diff)
Prepped CodeBlocks for new file configs
Diffstat (limited to 'tests')
-rwxr-xr-xtests/actions/codeblocks/codeblocks_files.lua101
-rw-r--r--tests/premake4.lua3
2 files changed, 104 insertions, 0 deletions
diff --git a/tests/actions/codeblocks/codeblocks_files.lua b/tests/actions/codeblocks/codeblocks_files.lua
new file mode 100755
index 0000000..b1bda82
--- /dev/null
+++ b/tests/actions/codeblocks/codeblocks_files.lua
@@ -0,0 +1,101 @@
+--
+-- tests/actions/codeblocks/codeblocks_files.lua
+-- Validate generation of files block in CodeLite C/C++ projects.
+-- Copyright (c) 2011 Jason Perkins and the Premake project
+--
+
+ T.codeblocks_files = { }
+ local suite = T.codeblocks_files
+ local codeblocks = premake.codeblocks
+
+
+--
+-- Setup
+--
+
+ local sln, prj
+
+ function suite.setup()
+ sln = test.createsolution()
+ end
+
+ local function prepare()
+ premake.buildconfigs()
+ prj = premake.solution.getproject(sln, 1)
+ codeblocks.files(prj)
+ end
+
+
+--
+-- Test grouping and nesting
+--
+
+ function suite.SimpleSourceFile()
+ files { "hello.cpp" }
+ prepare()
+ test.capture [[
+ <Unit filename="hello.cpp">
+ </Unit>
+ ]]
+ end
+
+
+ function suite.SingleFolderLevel()
+ files { "src/hello.cpp" }
+ prepare()
+ test.capture [[
+ <Unit filename="src/hello.cpp">
+ </Unit>
+ ]]
+ end
+
+
+ function suite.MultipleFolderLevels()
+ files { "src/greetings/hello.cpp" }
+ prepare()
+ test.capture [[
+ <Unit filename="src/greetings/hello.cpp">
+ </Unit>
+ ]]
+ end
+
+
+--
+-- Test source file type handling
+--
+
+ function suite.CFileInCppProject()
+ files { "hello.c" }
+ prepare()
+ test.capture [[
+ <Unit filename="hello.c">
+ <Option compilerVar="CC" />
+ </Unit>
+ ]]
+ end
+
+
+ function suite.WindowsResourceFile()
+ files { "hello.rc" }
+ prepare()
+ test.capture [[
+ <Unit filename="hello.rc">
+ <Option compilerVar="WINDRES" />
+ </Unit>
+ ]]
+ end
+
+
+ function suite.PchFile()
+ files { "hello.h" }
+ pchheader "hello.h"
+ prepare()
+ test.capture [[
+ <Unit filename="hello.h">
+ <Option compilerVar="CPP" />
+ <Option compile="1" />
+ <Option weight="0" />
+ <Add option="-x c++-header" />
+ </Unit>
+ ]]
+ end
diff --git a/tests/premake4.lua b/tests/premake4.lua
index 880e89e..a4512be 100644
--- a/tests/premake4.lua
+++ b/tests/premake4.lua
@@ -113,6 +113,9 @@
-- CodeLite tests
dofile("actions/codelite/codelite_files.lua")
+
+ -- CodeBlocks tests
+ dofile("actions/codeblocks/codeblocks_files.lua")
--
-- Register a test action