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:
authorliamDevine <none@none>2011-08-22 03:52:49 +0400
committerliamDevine <none@none>2011-08-22 03:52:49 +0400
commitae4578da90afe8ab26f48b5f1c588774a49b3a47 (patch)
treee5c268bb66f471cc597af2730844f179b81b84d5 /tests
parent4963e4d3a67a4cee49b192076962a856e6473801 (diff)
The function premake.action.set (which I only see used in xcode3 tests) has a secret,
it not only sets the action yet can also set the global _OS. Currently when the function is used in a test suite it should really be reset in a teardown. To make this transparent I have added the caching of the _OS value set in C code in testfx and it is reset in 'test_setup' with the other environment resets. I had a quick look at the commits and can not see how or when this first caused a problem yet findlib was failing on windows as previous premake.action.set('xcode3') had been made and therefore the library it was looking for was 'm'. io.eol is another potential setting which leaves a dirty environment for tests.
Diffstat (limited to 'tests')
-rw-r--r--tests/actions/xcode/test_xcode_dependencies.lua2
-rw-r--r--tests/actions/xcode/test_xcode_project.lua2
-rw-r--r--tests/testfx.lua3
3 files changed, 4 insertions, 3 deletions
diff --git a/tests/actions/xcode/test_xcode_dependencies.lua b/tests/actions/xcode/test_xcode_dependencies.lua
index e748b2b..6012981 100644
--- a/tests/actions/xcode/test_xcode_dependencies.lua
+++ b/tests/actions/xcode/test_xcode_dependencies.lua
@@ -14,7 +14,7 @@
-- Setup/Teardown
---------------------------------------------------------------------------
- local sln, prj, prj2, tr
+ local sln, prj, prj2, tr, _OS_original
function suite.setup()
premake.action.set("xcode3")
xcode.used_ids = { } -- reset the list of generated IDs
diff --git a/tests/actions/xcode/test_xcode_project.lua b/tests/actions/xcode/test_xcode_project.lua
index 4ab50ba..3585d01 100644
--- a/tests/actions/xcode/test_xcode_project.lua
+++ b/tests/actions/xcode/test_xcode_project.lua
@@ -14,7 +14,7 @@
-- Setup/Teardown
---------------------------------------------------------------------------
- local sln, tr
+ local sln, tr, _OS_original
function suite.setup()
premake.action.set("xcode3")
io.eol = "\n"
diff --git a/tests/testfx.lua b/tests/testfx.lua
index 1182a13..3c412a7 100644
--- a/tests/testfx.lua
+++ b/tests/testfx.lua
@@ -191,12 +191,13 @@
--
-- Test execution function
--
-
+ local _OS_host = _OS
local function test_setup(suite, fn)
-- clear out some important globals
_ACTION = "test"
_ARGS = { }
_OPTIONS = { }
+ _OS = _OS_host
premake.solution.list = { }
io.indent = nil