Add. Module version info

master
Alexey Melnichuk 2016-04-20 10:31:06 +03:00
parent 3208536f83
commit 9d7fdac27c
6 changed files with 34 additions and 18 deletions

View File

@ -43,11 +43,12 @@ before_script:
script:
- cd test
- lua -e "print(require 'cURL.utils'.find_ca_bundle())"
- lunit.sh test_easy.lua
- lunit.sh test_safe.lua
- lunit.sh test_form.lua
- lunit.sh test_pause02.c.lua
- lunit.sh test_curl.lua
- lunit.sh run.lua
- lua test_pause02.c.lua
# - lunit.sh test_easy.lua
# - lunit.sh test_safe.lua
# - lunit.sh test_form.lua
# - lunit.sh test_curl.lua
after_success:
- coveralls -b .. -r .. --dump c.report.json

View File

@ -54,11 +54,8 @@ before_test:
test_script:
- echo "Testing..."
- cd %APPVEYOR_BUILD_FOLDER%\test
- lua test_easy.lua
- lua test_safe.lua
- lua test_form.lua
- lua run.lua
- lua test_pause02.c.lua
- lua test_curl.lua
after_test:
- cd %APPVEYOR_BUILD_FOLDER%

View File

@ -8,6 +8,13 @@
-- This file is part of Lua-cURL library.
--
local module_info = {
_NAME = "Lua-cURL";
_VERSION = "0.3.3-dev";
_LICENSE = "MIT";
_COPYRIGHT = "Copyright (c) 2014 Alexey Melnichuk";
}
local function clone(t, o)
o = o or {}
for k,v in pairs(t) do o[k]=v end
@ -691,7 +698,7 @@ function cURL.multi(...) return Multi:new(...) end
end
return function(curl)
local cURL = {}
local cURL = clone(module_info)
Load_cURLv3(cURL, curl)

View File

@ -8,7 +8,7 @@ end
lunit = require "lunit"
local ok, curl = pcall(require, "lcurl")
local ok, curl = pcall(require, "cURL")
local version if ok then
version = curl.version()
else
@ -16,8 +16,10 @@ else
end
print("------------------------------------")
print("Lua version: " .. (_G.jit and _G.jit.version or _G._VERSION))
print("cURL version: " .. version)
print("Module name: " .. curl._NAME);
print("Module version: " .. curl._VERSION);
print("Lua version: " .. (_G.jit and _G.jit.version or _G._VERSION))
print("cURL version: " .. version)
print("------------------------------------")
print("")

View File

@ -20,6 +20,15 @@ local fname = "./test.download"
local ENABLE = true
local _ENV = TEST_CASE'version' if ENABLE then
function test()
assert_match("^%d+%.%d+%.%d+%-?", curl._VERSION)
assert_equal("Lua-cURL", curl._NAME )
end
end
local _ENV = TEST_CASE'easy' if ENABLE then
local e1, e2

View File

@ -20,11 +20,11 @@ local upath = require "path".new('/')
local url = "http://example.com"
local fname = "./test.download"
print("------------------------------------")
print("Lua version: " .. (_G.jit and _G.jit.version or _G._VERSION))
print("cURL version: " .. curl.version())
print("------------------------------------")
print("")
-- print("------------------------------------")
-- print("Lua version: " .. (_G.jit and _G.jit.version or _G._VERSION))
-- print("cURL version: " .. curl.version())
-- print("------------------------------------")
-- print("")
local function weak_ptr(val)
return setmetatable({value = val},{__mode = 'v'})