diff options
author | Jason Perkins <starkos@industriousone.com> | 2011-05-13 00:00:07 +0400 |
---|---|---|
committer | Jason Perkins <starkos@industriousone.com> | 2011-05-13 00:00:07 +0400 |
commit | dafe3ba6ec5cbd7dc803317e9c99c2ec645b586f (patch) | |
tree | 7183075dea4098710d19d38ea33819eb835e914d /tests | |
parent | ddd032645e450eb1bcd39c3aac3080082b2171f2 (diff) |
Ported CodeLite to trees
Diffstat (limited to 'tests')
-rwxr-xr-x | tests/actions/codelite/codelite_files.lua | 64 | ||||
-rw-r--r-- | tests/premake4.lua | 6 | ||||
-rw-r--r-- | tests/testfx.lua | 3 |
3 files changed, 71 insertions, 2 deletions
diff --git a/tests/actions/codelite/codelite_files.lua b/tests/actions/codelite/codelite_files.lua new file mode 100755 index 0000000..f1cdd22 --- /dev/null +++ b/tests/actions/codelite/codelite_files.lua @@ -0,0 +1,64 @@ +-- +-- tests/actions/codelite/codelite_files.lua +-- Validate generation of files block in CodeLite C/C++ projects. +-- Copyright (c) 2011 Jason Perkins and the Premake project +-- + + T.codelite_files = { } + local suite = T.codelite_files + local codelite = premake.codelite + + +-- +-- Setup +-- + + local sln, prj + + function suite.setup() + sln = test.createsolution() + end + + local function prepare() + io.indent = " " + premake.buildconfigs() + prj = premake.solution.getproject(sln, 1) + codelite.files(prj) + end + + +-- +-- Test grouping and nesting +-- + + function suite.SimpleSourceFile() + files { "hello.c" } + prepare() + test.capture [[ + <File Name="hello.c"/> + ]] + end + + + function suite.SingleFolderLevel() + files { "src/hello.c" } + prepare() + test.capture [[ + <VirtualDirectory Name="src"> + <File Name="src/hello.c"/> + </VirtualDirectory> + ]] + end + + + function suite.MultipleFolderLevels() + files { "src/greetings/hello.c" } + prepare() + test.capture [[ + <VirtualDirectory Name="src"> + <VirtualDirectory Name="greetings"> + <File Name="src/greetings/hello.c"/> + </VirtualDirectory> + </VirtualDirectory> + ]] + end diff --git a/tests/premake4.lua b/tests/premake4.lua index ae9c249..880e89e 100644 --- a/tests/premake4.lua +++ b/tests/premake4.lua @@ -103,12 +103,16 @@ dofile("actions/make/test_make_pch.lua") dofile("actions/make/test_make_linking.lua") - -- Xcode tests + -- Xcode3 tests dofile("actions/xcode/test_xcode_common.lua") dofile("actions/xcode/test_xcode_project.lua") dofile("actions/xcode/test_xcode_dependencies.lua") + -- Xcode4 tests dofile("actions/xcode/test_xcode4_workspace.lua") + + -- CodeLite tests + dofile("actions/codelite/codelite_files.lua") -- -- Register a test action diff --git a/tests/testfx.lua b/tests/testfx.lua index f235cd0..d3cd44a 100644 --- a/tests/testfx.lua +++ b/tests/testfx.lua @@ -190,11 +190,12 @@ _ARGS = { } _OPTIONS = { } premake.solution.list = { } + io.indent = nil -- reset captured I/O values test.value_openedfilename = nil test.value_openedfilemode = nil - test.value_closedfile = false + test.value_closedfile = false if suite.setup then return pcall(suite.setup) |