Skip to content

Commit 03b4b9b

Browse files
committed
Merge pull request #68 from moteus/master
Add. Module version info
2 parents 3208536 + 29f28ff commit 03b4b9b

File tree

7 files changed

+35
-18
lines changed

7 files changed

+35
-18
lines changed

.appveyor/install.bat

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,7 @@ set PATH=%LR_ROOT%;%LR_SYSTREE%\bin;%PATH%
142142

143143
:: Lua will use just the system rocks
144144
set LUA_PATH=%LR_ROOT%\lua\?.lua;%LR_ROOT%\lua\?\init.lua
145+
set LUA_PATH=%LUA_PATH%;.\?.lua;
145146
set LUA_PATH=%LUA_PATH%;%LR_SYSTREE%\share\lua\%LUA_SHORTV%\?.lua
146147
set LUA_PATH=%LUA_PATH%;%LR_SYSTREE%\share\lua\%LUA_SHORTV%\?\init.lua
147148
set LUA_CPATH=%LR_SYSTREE%\lib\lua\%LUA_SHORTV%\?.dll

.travis.yml

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -43,11 +43,12 @@ before_script:
4343
script:
4444
- cd test
4545
- lua -e "print(require 'cURL.utils'.find_ca_bundle())"
46-
- lunit.sh test_easy.lua
47-
- lunit.sh test_safe.lua
48-
- lunit.sh test_form.lua
49-
- lunit.sh test_pause02.c.lua
50-
- lunit.sh test_curl.lua
46+
- lunit.sh run.lua
47+
- lua test_pause02.c.lua
48+
# - lunit.sh test_easy.lua
49+
# - lunit.sh test_safe.lua
50+
# - lunit.sh test_form.lua
51+
# - lunit.sh test_curl.lua
5152

5253
after_success:
5354
- coveralls -b .. -r .. --dump c.report.json

appveyor.yml

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -54,11 +54,8 @@ before_test:
5454
test_script:
5555
- echo "Testing..."
5656
- cd %APPVEYOR_BUILD_FOLDER%\test
57-
- lua test_easy.lua
58-
- lua test_safe.lua
59-
- lua test_form.lua
57+
- lua run.lua
6058
- lua test_pause02.c.lua
61-
- lua test_curl.lua
6259

6360
after_test:
6461
- cd %APPVEYOR_BUILD_FOLDER%

src/lua/cURL/impl/cURL.lua

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,13 @@
88
-- This file is part of Lua-cURL library.
99
--
1010

11+
local module_info = {
12+
_NAME = "Lua-cURL";
13+
_VERSION = "0.3.3-dev";
14+
_LICENSE = "MIT";
15+
_COPYRIGHT = "Copyright (c) 2014 Alexey Melnichuk";
16+
}
17+
1118
local function clone(t, o)
1219
o = o or {}
1320
for k,v in pairs(t) do o[k]=v end
@@ -691,7 +698,7 @@ function cURL.multi(...) return Multi:new(...) end
691698
end
692699

693700
return function(curl)
694-
local cURL = {}
701+
local cURL = clone(module_info)
695702

696703
Load_cURLv3(cURL, curl)
697704

test/run.lua

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,16 +8,18 @@ end
88

99
lunit = require "lunit"
1010

11-
local ok, curl = pcall(require, "lcurl")
11+
local ok, curl = pcall(require, "cURL")
1212
local version if ok then
1313
version = curl.version()
1414
else
1515
version = "<UNKNOWN>"
1616
end
1717

1818
print("------------------------------------")
19-
print("Lua version: " .. (_G.jit and _G.jit.version or _G._VERSION))
20-
print("cURL version: " .. version)
19+
print("Module name: " .. curl._NAME);
20+
print("Module version: " .. curl._VERSION);
21+
print("Lua version: " .. (_G.jit and _G.jit.version or _G._VERSION))
22+
print("cURL version: " .. version)
2123
print("------------------------------------")
2224
print("")
2325

test/test_curl.lua

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,15 @@ local fname = "./test.download"
2020

2121
local ENABLE = true
2222

23+
local _ENV = TEST_CASE'version' if ENABLE then
24+
25+
function test()
26+
assert_match("^%d+%.%d+%.%d+%-?", curl._VERSION)
27+
assert_equal("Lua-cURL", curl._NAME )
28+
end
29+
30+
end
31+
2332
local _ENV = TEST_CASE'easy' if ENABLE then
2433

2534
local e1, e2

test/test_easy.lua

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,11 @@ local upath = require "path".new('/')
2020
local url = "http://example.com"
2121
local fname = "./test.download"
2222

23-
print("------------------------------------")
24-
print("Lua version: " .. (_G.jit and _G.jit.version or _G._VERSION))
25-
print("cURL version: " .. curl.version())
26-
print("------------------------------------")
27-
print("")
23+
-- print("------------------------------------")
24+
-- print("Lua version: " .. (_G.jit and _G.jit.version or _G._VERSION))
25+
-- print("cURL version: " .. curl.version())
26+
-- print("------------------------------------")
27+
-- print("")
2828

2929
local function weak_ptr(val)
3030
return setmetatable({value = val},{__mode = 'v'})

0 commit comments

Comments
 (0)