-
Notifications
You must be signed in to change notification settings - Fork 0
/
modules_test.lua
379 lines (326 loc) · 10.8 KB
/
modules_test.lua
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
print("This is file for modules testing")
print("It should work on any system")
print("----------------")
local nmodule = 0
package.path = package.path .. ";./?.lua;./?/init.lua"
local ffi = require'ffi'
-- amqp testing
nmodule = nmodule + 1
print(tostring(nmodule) .. ". This is amqp testing:")
print(require("amqp") and "ok" or "failed")
print("----------------")
-- bundle testing
nmodule = nmodule + 1
print(tostring(nmodule) .. ". This is bundle testing:")
print(require("bundle") and "ok" or "failed")
-- TODO: here need to fix bug with loading libraries in luapower.lua
-- require("bundle_test")
print("----------------")
-- coro testing
nmodule = nmodule + 1
print(tostring(nmodule) .. ". This is coro testing:")
print(require("coro") and "ok" or "failed")
require("coro_test")
print("----------------")
-- crc32 testing
nmodule = nmodule + 1
print(tostring(nmodule) .. ". This is crc32 testing:")
print(require("crc32") and "ok" or "failed")
print("----------------")
-- cjson testing
nmodule = nmodule + 1
print(tostring(nmodule) .. ". This is cjson testing:")
print(require("cjson") and "ok" or "failed")
print("----------------")
-- dynasm testing
nmodule = nmodule + 1
print(tostring(nmodule) .. ". This is dynasm testing:")
print(require("dynasm") and "ok" or "failed")
print("----------------")
-- events testing
nmodule = nmodule + 1
print(tostring(nmodule) .. ". This is events testing:")
print(require("events") and "ok" or "failed")
print("----------------")
-- expat testing
nmodule = nmodule + 1
print(tostring(nmodule) .. ". This is expat testing:")
print(require("expat") and "ok" or "failed")
require("expat_test")
print("----------------")
-- ffi_reflect testing
nmodule = nmodule + 1
print(tostring(nmodule) .. ". This is ffi_reflect testing:")
print(require("ffi_reflect") and "ok" or "failed")
-- TODO: here need to fix bug in line 105
-- require("ffi_reflect_test")
print("----------------")
-- fribidi testing
nmodule = nmodule + 1
print(tostring(nmodule) .. ". This is fribidi testing:")
print(require("fribidi") and "ok" or "failed")
require("fribidi_test")
print("----------------")
-- fs testing
nmodule = nmodule + 1
print(tostring(nmodule) .. ". This is fs testing:")
print(require("fs") and "ok" or "failed")
require("fs_test")
print("----------------")
-- genx testing
nmodule = nmodule + 1
print(tostring(nmodule) .. ". This is genx testing:")
print(require("genx") and "ok" or "failed")
require("genx_demo")
print("----------------")
-- glue testing
nmodule = nmodule + 1
print(tostring(nmodule) .. ". This is glue testing:")
print(require("glue") and "ok" or "failed")
require("glue_test")
print("----------------")
-- heap testing
nmodule = nmodule + 1
print(tostring(nmodule) .. ". This is heap testing:")
print(require("heap") and "ok" or "failed")
-- TODO: here need to fix bug with explicit importing pp module in line 100
-- require("heap_test")
print("----------------")
-- inspect testing
nmodule = nmodule + 1
print(tostring(nmodule) .. ". This is inspect testing:")
print(require("inspect") and "ok" or "failed")
print("----------------")
-- jsonschema testing
nmodule = nmodule + 1
print(tostring(nmodule) .. ". This is jsonschema testing:")
print(require("jsonschema") and "ok" or "failed")
print("----------------")
-- lanes testing
nmodule = nmodule + 1
print(tostring(nmodule) .. ". This is lanes testing:")
print(require("lanes") and "ok" or "failed")
print("----------------")
-- lfs testing
nmodule = nmodule + 1
print(tostring(nmodule) .. ". This is lfs testing:")
print(require("lfs") and "ok" or "failed")
-- TODO: here need to fix bug "unprotected error in call to Lua API (setmode: closed file)"
-- require("lfs_test")
print("----------------")
-- libb64 testing
nmodule = nmodule + 1
print(tostring(nmodule) .. ". This is libb64 testing:")
print(require("libb64") and "ok" or "failed")
require("libb64_test")
print("----------------")
-- libcurl testing
nmodule = nmodule + 1
print(tostring(nmodule) .. ". This is libcurl testing:")
print(require("libcurl") and "ok" or "failed")
require("libcurl_test")
print("----------------")
-- lightningmdb testing
nmodule = nmodule + 1
print(tostring(nmodule) .. ". This is lightningmdb testing:")
print(require("lightningmdb") and "ok" or "failed")
require("lightningmdb_test")
require("lightingmdb_mdbtest")
print("----------------")
-- linkedlist testing
nmodule = nmodule + 1
print(tostring(nmodule) .. ". This is linkedlist testing:")
print(require("linkedlist") and "ok" or "failed")
require("linkedlist_test")
print("----------------")
-- lrucache testing
nmodule = nmodule + 1
print(tostring(nmodule) .. ". This is lrucache testing:")
print(require("lrucache") and "ok" or "failed")
print("----------------")
-- lua-openssl testing
nmodule = nmodule + 1
print(tostring(nmodule) .. ". This is lua-openssl testing:")
print(require("openssl") and "ok" or "failed")
print(require("openssl").digest and "digest - ok" or "failed")
print(require("openssl").cipher and "cipher - ok" or "failed")
print(require("openssl").bio and "bio - ok" or "failed")
print(require("openssl").cms and "cms - ok" or "failed")
print(require("openssl").x509 and "x509 - ok" or "failed")
print(require("openssl").engine and "engine - ok" or "failed")
print(require("crypto") and "crypto - ok" or "failed")
print(require("ssl") and "ssl - ok" or "failed")
print(require("https") and "https - ok" or "failed")
print("----------------")
-- lsqlite3 testing
nmodule = nmodule + 1
print(tostring(nmodule) .. ". This is lsqlite3 testing:")
print(require("lsqlite3") and "ok" or "failed")
print("----------------")
-- luastate testing
nmodule = nmodule + 1
print(tostring(nmodule) .. ". This is luastate testing:")
print(require("luastate") and "ok" or "failed")
require("luastate_test")
print("----------------")
-- md5 testing
nmodule = nmodule + 1
print(tostring(nmodule) .. ". This is md5 testing:")
print(require("md5") and "ok" or "failed")
require("md5_test")
print("----------------")
-- minizip testing
nmodule = nmodule + 1
print(tostring(nmodule) .. ". This is minizip testing:")
print(require("minizip") and "ok" or "failed")
require("minizip_test")
print("----------------")
-- mustache testing
nmodule = nmodule + 1
print(tostring(nmodule) .. ". This is mustache testing:")
print(require("mustache") and "ok" or "failed")
require("mustache_test")
print("----------------")
-- path testing
nmodule = nmodule + 1
print(tostring(nmodule) .. ". This is path testing:")
print(require("path") and "ok" or "failed")
require("path_test")
print("----------------")
-- pp testing
nmodule = nmodule + 1
print(tostring(nmodule) .. ". This is pp testing:")
print(require("pp") and "ok" or "failed")
-- TODO: here need to fix bug with format converting in line 8 (to 9223372036854775808ULL)
-- require("pp_test")
print("----------------")
-- prettycjson testing
nmodule = nmodule + 1
print(tostring(nmodule) .. ". This is prettycjson testing:")
print(require("prettycjson") and "ok" or "failed")
print("----------------")
-- pthread testing
nmodule = nmodule + 1
print(tostring(nmodule) .. ". This is pthread testing:")
print(require("pthread") and "ok" or "failed")
require("pthread_test")
print("----------------")
-- protobuf testing
nmodule = nmodule + 1
print(tostring(nmodule) .. ". This is protobuf testing:")
print(require("protoc") and "ok" or "failed")
require("protoc_test")
print("----------------")
-- ringbuffer testing
nmodule = nmodule + 1
print(tostring(nmodule) .. ". This is ringbuffer testing:")
print(require("ringbuffer") and "ok" or "failed")
require("ringbuffer_demo")
print("----------------")
-- reader testing
nmodule = nmodule + 1
print(tostring(nmodule) .. ". This is reader testing:")
print(require("reader") and "ok" or "failed")
require("reader_test")
print("----------------")
-- rex_pcre2 testing
nmodule = nmodule + 1
print(tostring(nmodule) .. ". This is rex_pcre2 testing:")
print(require("rex_pcre2") and "ok" or "failed")
require("rex_run_test")
print("----------------")
-- sha2 testing
nmodule = nmodule + 1
print(tostring(nmodule) .. ". This is sha2 testing:")
print(require("sha2") and "ok" or "failed")
require("sha2_test")
print("----------------")
-- socket testing
nmodule = nmodule + 1
print(tostring(nmodule) .. ". This is socket testing:")
print(require("socket") and "ok" or "failed")
print("----------------")
-- socketloop testing
nmodule = nmodule + 1
print(tostring(nmodule) .. ". This is socketloop testing:")
print(require("socketloop") and "ok" or "failed")
-- TODO: here need to fix bug with loading libraries through bundle in lanes module
-- require("socketloop_test")
print("----------------")
-- struct testing
nmodule = nmodule + 1
print(tostring(nmodule) .. ". This is struct testing:")
print(require("struct") and "ok" or "failed")
-- TODO: here need to fix bug in line 170
-- require("struct_test")
print("----------------")
-- thread testing
nmodule = nmodule + 1
print(tostring(nmodule) .. ". This is thread testing:")
print(require("thread") and "ok" or "failed")
require("thread_test")
print("----------------")
-- time testing
nmodule = nmodule + 1
print(tostring(nmodule) .. ". This is time testing:")
print(require("time") and "ok" or "failed")
print("----------------")
-- tuple testing
nmodule = nmodule + 1
print(tostring(nmodule) .. ". This is tuple testing:")
print(require("tuple") and "ok" or "failed")
require("tuple_test")
print("----------------")
-- unit testing
nmodule = nmodule + 1
print(tostring(nmodule) .. ". This is unit testing:")
print(require("unit") and "ok" or "failed")
print("----------------")
-- unixperms testing
nmodule = nmodule + 1
print(tostring(nmodule) .. ". This is unixperms testing:")
print(require("unixperms") and "ok" or "failed")
print("----------------")
-- uri testing
nmodule = nmodule + 1
print(tostring(nmodule) .. ". This is uri testing:")
print(require("uri") and "ok" or "failed")
require("uri_test")
print("----------------")
-- utf8 testing
nmodule = nmodule + 1
print(tostring(nmodule) .. ". This is utf8 testing:")
print(require("utf8") and "ok" or "failed")
require("utf8_test")
print("----------------")
-- waffi testing
if ffi.os == "Windows" then
nmodule = nmodule + 1
print(tostring(nmodule) .. ". This is waffi testing:")
require("waffi_test")
print("----------------")
end
-- winapi testing
if ffi.os == "Windows" then
nmodule = nmodule + 1
print(tostring(nmodule) .. ". This is winapi testing:")
print(require("winapi") and "ok" or "failed")
require("winapi_test")
print("----------------")
end
-- xxhash testing
nmodule = nmodule + 1
print(tostring(nmodule) .. ". This is xxhash testing:")
print(require("xxhash") and "ok" or "failed")
print("----------------")
-- yaci testing
nmodule = nmodule + 1
print(tostring(nmodule) .. ". This is yaci testing:")
print(require("yaci") and "ok" or "failed")
print("----------------")
-- zlib testing
nmodule = nmodule + 1
print(tostring(nmodule) .. ". This is zlib testing:")
print(require("zlib") and "ok" or "failed")
require("zlib_test")
print("----------------")