Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- From b2bebe23fcb373104627c7d2698515b32dc9e5be Mon Sep 17 00:00:00 2001
- From: Francois Perrad <francois.perrad@gadz.org>
- Date: Tue, 8 May 2012 10:36:49 +0200
- Subject: [PATCH] skip tests when the luasql driver is missing
- ---
- tests/tdado.lua | 5 +++++
- tests/tdbobj.lua | 7 ++++++-
- 2 files changed, 11 insertions(+), 1 deletions(-)
- diff --git a/tests/tdado.lua b/tests/tdado.lua
- index 69163eb..ec32fa8 100755
- --- a/tests/tdado.lua
- +++ b/tests/tdado.lua
- @@ -6,6 +6,11 @@ local user = arg[2]
- local pass = arg[3]
- local driver = arg[4] or "postgres"
- +if not pcall(require, "luasql."..driver) then
- + print(" Skipped. No luasql." .. driver)
- + return
- +end
- +
- db = dado.connect (dbname, user, pass, driver)
- assert (type(db) == "table", "Nao consegui criar a conexao")
- assert (type(db.conn) == "userdata")
- diff --git a/tests/tdbobj.lua b/tests/tdbobj.lua
- index 4b5e3e5..f6e8d08 100755
- --- a/tests/tdbobj.lua
- +++ b/tests/tdbobj.lua
- @@ -5,7 +5,12 @@ local dado = require"dado"
- local dbname = arg[1] or "luasql-test"
- local user = arg[2]
- local pass = arg[3]
- -local driver = arg[4]
- +local driver = arg[4] or "postgres"
- +
- +if not pcall(require, "luasql."..driver) then
- + print(" Skipped. No luasql." .. driver)
- + return
- +end
- local db = assert (dado.connect (dbname, user, pass, driver))
- --
- 1.7.5.4
Add Comment
Please, Sign In to add comment