Add. Module version info
This commit is contained in:
parent
3208536f83
commit
9d7fdac27c
11
.travis.yml
11
.travis.yml
@ -43,11 +43,12 @@ before_script:
|
|||||||
script:
|
script:
|
||||||
- cd test
|
- cd test
|
||||||
- lua -e "print(require 'cURL.utils'.find_ca_bundle())"
|
- lua -e "print(require 'cURL.utils'.find_ca_bundle())"
|
||||||
- lunit.sh test_easy.lua
|
- lunit.sh run.lua
|
||||||
- lunit.sh test_safe.lua
|
- lua test_pause02.c.lua
|
||||||
- lunit.sh test_form.lua
|
# - lunit.sh test_easy.lua
|
||||||
- lunit.sh test_pause02.c.lua
|
# - lunit.sh test_safe.lua
|
||||||
- lunit.sh test_curl.lua
|
# - lunit.sh test_form.lua
|
||||||
|
# - lunit.sh test_curl.lua
|
||||||
|
|
||||||
after_success:
|
after_success:
|
||||||
- coveralls -b .. -r .. --dump c.report.json
|
- coveralls -b .. -r .. --dump c.report.json
|
||||||
|
@ -54,11 +54,8 @@ before_test:
|
|||||||
test_script:
|
test_script:
|
||||||
- echo "Testing..."
|
- echo "Testing..."
|
||||||
- cd %APPVEYOR_BUILD_FOLDER%\test
|
- cd %APPVEYOR_BUILD_FOLDER%\test
|
||||||
- lua test_easy.lua
|
- lua run.lua
|
||||||
- lua test_safe.lua
|
|
||||||
- lua test_form.lua
|
|
||||||
- lua test_pause02.c.lua
|
- lua test_pause02.c.lua
|
||||||
- lua test_curl.lua
|
|
||||||
|
|
||||||
after_test:
|
after_test:
|
||||||
- cd %APPVEYOR_BUILD_FOLDER%
|
- cd %APPVEYOR_BUILD_FOLDER%
|
||||||
|
@ -8,6 +8,13 @@
|
|||||||
-- This file is part of Lua-cURL library.
|
-- 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)
|
local function clone(t, o)
|
||||||
o = o or {}
|
o = o or {}
|
||||||
for k,v in pairs(t) do o[k]=v end
|
for k,v in pairs(t) do o[k]=v end
|
||||||
@ -691,7 +698,7 @@ function cURL.multi(...) return Multi:new(...) end
|
|||||||
end
|
end
|
||||||
|
|
||||||
return function(curl)
|
return function(curl)
|
||||||
local cURL = {}
|
local cURL = clone(module_info)
|
||||||
|
|
||||||
Load_cURLv3(cURL, curl)
|
Load_cURLv3(cURL, curl)
|
||||||
|
|
||||||
|
@ -8,7 +8,7 @@ end
|
|||||||
|
|
||||||
lunit = require "lunit"
|
lunit = require "lunit"
|
||||||
|
|
||||||
local ok, curl = pcall(require, "lcurl")
|
local ok, curl = pcall(require, "cURL")
|
||||||
local version if ok then
|
local version if ok then
|
||||||
version = curl.version()
|
version = curl.version()
|
||||||
else
|
else
|
||||||
@ -16,6 +16,8 @@ else
|
|||||||
end
|
end
|
||||||
|
|
||||||
print("------------------------------------")
|
print("------------------------------------")
|
||||||
|
print("Module name: " .. curl._NAME);
|
||||||
|
print("Module version: " .. curl._VERSION);
|
||||||
print("Lua version: " .. (_G.jit and _G.jit.version or _G._VERSION))
|
print("Lua version: " .. (_G.jit and _G.jit.version or _G._VERSION))
|
||||||
print("cURL version: " .. version)
|
print("cURL version: " .. version)
|
||||||
print("------------------------------------")
|
print("------------------------------------")
|
||||||
|
@ -20,6 +20,15 @@ local fname = "./test.download"
|
|||||||
|
|
||||||
local ENABLE = true
|
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 _ENV = TEST_CASE'easy' if ENABLE then
|
||||||
|
|
||||||
local e1, e2
|
local e1, e2
|
||||||
|
@ -20,11 +20,11 @@ local upath = require "path".new('/')
|
|||||||
local url = "http://example.com"
|
local url = "http://example.com"
|
||||||
local fname = "./test.download"
|
local fname = "./test.download"
|
||||||
|
|
||||||
print("------------------------------------")
|
-- print("------------------------------------")
|
||||||
print("Lua version: " .. (_G.jit and _G.jit.version or _G._VERSION))
|
-- print("Lua version: " .. (_G.jit and _G.jit.version or _G._VERSION))
|
||||||
print("cURL version: " .. curl.version())
|
-- print("cURL version: " .. curl.version())
|
||||||
print("------------------------------------")
|
-- print("------------------------------------")
|
||||||
print("")
|
-- print("")
|
||||||
|
|
||||||
local function weak_ptr(val)
|
local function weak_ptr(val)
|
||||||
return setmetatable({value = val},{__mode = 'v'})
|
return setmetatable({value = val},{__mode = 'v'})
|
||||||
|
Loading…
x
Reference in New Issue
Block a user