Permalink
Browse files

Improve on driver-specific file loading.

  • Loading branch information...
tomasguisasola committed Mar 30, 2012
1 parent b82b644 commit 3f4d7c191c2c8627197893f7d3a6b745390fcfe8
Showing with 3 additions and 2 deletions.
  1. +3 −2 tests/test.lua
View
@@ -620,7 +620,7 @@ password = arg[4] or nil
-- Loading driver specific functions
if arg[0] then
- local path = string.gsub (arg[0], "^([^/]*%/).*$", "%1")
+ local path = string.gsub (arg[0], "^(.*%/)[^/]*$", "%1")
if path == "test.lua" then
path = ""
end
@@ -630,6 +630,7 @@ if arg[0] then
print ("LuaSQL test: couldn't find driver-specific test file ("..
file..").\nProceeding with general test")
else
+ print ("Loading driver-specific test file ("..file..").")
f ()
end
end
@@ -651,7 +652,7 @@ tests = {
}
if string.find(_VERSION, " 5.0") then
- luasql = assert(loadlib("./postgres.so", "luaopen_luasql_postgres"))()
+ luasql = assert(loadlib("./"..driver..".so", "luaopen_luasql_"..driver))()
else
luasql = require ("luasql."..driver)
end

0 comments on commit 3f4d7c1

Please sign in to comment.