diff options
author | Jason Perkins <starkos@industriousone.com> | 2011-05-13 00:14:43 +0400 |
---|---|---|
committer | Jason Perkins <starkos@industriousone.com> | 2011-05-13 00:14:43 +0400 |
commit | 21b38a71196abb96de0ee9de2705e3afd0a9b7da (patch) | |
tree | ec126dac824e09a5832c8cc0621b53eddfd917c5 /tests | |
parent | dafe3ba6ec5cbd7dc803317e9c99c2ec645b586f (diff) |
Prepped CodeBlocks for new file configs
Diffstat (limited to 'tests')
-rwxr-xr-x | tests/actions/codeblocks/codeblocks_files.lua | 101 | ||||
-rw-r--r-- | tests/premake4.lua | 3 |
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 |