Commit 8001fc01 authored by Renato Figueiro Maia's avatar Renato Figueiro Maia
Browse files

[OPENBUS-2184] Adaptação do código para ser compatível também com Lua 5.2

- Ajuste no script de execução dos testes para utilizar o LUA_PATH com a versão 5.2 de Lua.
- Ajuste nos testes do LoginDB para se adequar a nova API de 'os.execute' de Lua 5.2.

git-svn-id: https://subversion.tecgraf.puc-rio.br/engdist/openbus/core/branches/02_00_00@148118 ae0415b3-e90b-0410-900d-d0be9363c56b
parent 0d0f4d0e
......@@ -184,10 +184,10 @@ do
assertEx("unable to load file 'test%.db/Logins/corrupted%.lua'",
LoginDB, {database=assert(database.open("test.db"))})
assert(os.execute("chmod 000 test.db/Logins") == 0)
assert(os.execute("chmod 000 test.db/Logins"))
assertEx("cannot open test%.db/Logins/: Permission denied",
LoginDB, {database=assert(database.open("test.db"))})
assert(os.execute("chmod 755 test.db/Logins") == 0)
assert(os.execute("chmod 755 test.db/Logins"))
assert(os.remove("test.db/Logins/corrupted.lua"))
end
......@@ -199,13 +199,13 @@ do
local user = assert(logins:newLogin("user", key))
local obs = assert(user:newObserver(logins.orb:newproxy("obs", nil, "IObserver")))
assert(os.execute("chmod 000 test.db/Logins") == 0)
assert(os.execute("chmod 000 test.db/Logins"))
obs:watchLogin(user)
assertIterator({[obs] = true}, user:iObservers())
assertIterator({[user.id] = true}, obs:iWatchedLoginIds())
assert(os.execute("chmod 000 test.db/LoginObservers") == 0)
assert(os.execute("chmod 000 test.db/LoginObservers"))
assertEx("unable to .- file 'test%.db/LoginObservers/[%x-]+%.lua' %(.-: Permission denied%)",
obs.forgetLogin, obs, user)
......@@ -224,12 +224,12 @@ do
assertIterator({[user.id] = user}, logins:iLogins())
assertIterator({[obs] = true}, user:iObservers())
assert(os.execute("chmod 755 test.db/LoginObservers") == 0)
assert(os.execute("chmod 755 test.db/LoginObservers"))
obs:forgetLogin(user)
for _ in user:iWatchers() do error("failure") end
for _ in obs:iWatchedLoginIds() do error("failure") end
assert(os.execute("chmod 755 test.db/Logins") == 0)
assert(os.execute("chmod 755 test.db/Logins"))
user:remove()
assert(logins:getLogin(user.id) == nil)
assert(logins:getObserver(obs.id) == nil)
......
......@@ -9,7 +9,7 @@ elif [ "$1" != "RELEASE" ]; then
exit 1
fi
LATT_LUA=${LATT_LUA:=$OPENBUS_HOME/lib/lua/5.1}
LATT_LUA=${LATT_LUA:=$OPENBUS_HOME/lib/lua/5.2}
LATT_PRELUDE="package.path=package.path..';$LATT_LUA/?.lua'"
TEST_PRELUDE='package.path=package.path..";"..(os.getenv("OPENBUS_CORE_LUA") or "../lua").."/?.lua"'
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment