Skip to contentSkip to conversation

luarocks: add generation of test

PATCH New Francois Perrad 3 participants 14 messages Feb 19, 2019 – Mar 28, 2019

lore
Share & tools
lore
#0 lore raw

PATCH 1/11 luarocks: add generation of test

---
 package/luarocks/buildroot.lua | 60 ++++++++++++++++++++++++++++++++++
 1 file changed, 60 insertions(+)
package/luarocks/buildroot.lua +60 -0
index 4be5fbd7c..61e44a867 100644
@@ -49,6 +49,27 @@ local function wrap (txt, max)
    return lines
 end
 
+local function has_c_files (rockspec)
+   for _, mod in pairs(rockspec.build.modules or {}) do
+      if type(mod) == 'string' then
+         if mod:match'%.c$' then
+            return true
+         end
+      elseif type(mod) == 'table' then
+         local sources = mod.sources
+         if type(sources) == 'string' and sources:match'%.c$' then
+            return true
+         end
+         for _, src in ipairs(sources or mod) do
+            if src:match'%.c$' then
+               return true
+            end
+         end
+      end
+   end
+   return false
+end
+
 local function get_external_dependencies (rockspec)
    local t = {}
    for k in pairs(rockspec.external_dependencies or {}) do
@@ -228,6 +249,42 @@ local function generate_hash (rockspec, lcname, rock_file, licenses, digest)
    f:close()
 end
 
+local function generate_test (rockspec, lcname)
+   local ucname = brname(lcname)
+   local modname = rockspec.package:gsub('%-', '')
+   local classname = modname:gsub('%.', '')
+   classname = classname:sub(1, 1):upper() .. classname:sub(2)
+   local fname = 'support/testing/tests/package/test_' .. ucname:lower() .. '.py'
+   local f = assert(io.open(fname, 'w'))
+   util.printout('write ' .. fname)
+   f:write('from tests.package.test_lua import TestLuaBase\n')
+   f:write('\n')
+   f:write('\n')
+   f:write('class TestLua' .. classname .. '(TestLuaBase):\n')
+   f:write('    config = TestLuaBase.config + \\\n')
+   f:write('        """\n')
+   f:write('        BR2_PACKAGE_LUA=y\n')
+   f:write('        BR2_PACKAGE_' .. ucname .. '=y\n')
+   f:write('        """\n')
+   f:write('\n')
+   f:write('    def test_run(self):\n')
+   f:write('        self.login()\n')
+   f:write('        self.module_test("' .. modname .. '")\n')
+   f:write('\n')
+   f:write('\n')
+   f:write('class TestLuajit' .. classname .. '(TestLuaBase):\n')
+   f:write('    config = TestLuaBase.config + \\\n')
+   f:write('        """\n')
+   f:write('        BR2_PACKAGE_LUAJIT=y\n')
+   f:write('        BR2_PACKAGE_' .. ucname .. '=y\n')
+   f:write('        """\n')
+   f:write('\n')
+   f:write('    def test_run(self):\n')
+   f:write('        self.login()\n')
+   f:write('        self.module_test("' .. modname .. '")\n')
+   f:close()
+end
+
 --- Driver function for the "buildroot" command.
 -- @param rockname string: the name of a rock to be fetched and unpacked.
 -- @param brname string: the name used by Buildroot (optional)
@@ -319,6 +376,9 @@ function buildroot.command(flags, rockname, fsname)
    generate_config(rockspec, fsname:lower())
    generate_mk(rockspec, fsname:lower(), licenses)
    generate_hash(rockspec, fsname:lower(), rock_file, licenses, digest)
+   if has_c_files(rockspec) then
+      generate_test(rockspec, fsname:lower())
+   end
 
    return true
 end
Signature · 1 line
2.17.1
#1 lore raw

PATCH 2/11 support/testing: add lpeg test

---
 .gitlab-ci.yml                             |  2 ++
 support/testing/tests/package/test_lpeg.py | 25 ++++++++++++++++++++++
 2 files changed, 27 insertions(+)
 create mode 100644 support/testing/tests/package/test_lpeg.py
.gitlab-ci.yml +2 -0
index 2f0ebaa25..1730f3906 100644
@@ -326,6 +326,8 @@ tests.package.test_docker_compose.TestDockerCompose: { extends: .runtime_test }
 tests.package.test_dropbear.TestDropbear: { extends: .runtime_test }
 tests.package.test_ipython.TestIPythonPy2: { extends: .runtime_test }
 tests.package.test_ipython.TestIPythonPy3: { extends: .runtime_test }
+tests.package.test_lpeg.TestLuaLPeg: { extends: .runtime_test }
+tests.package.test_lpeg.TestLuajitLPeg: { extends: .runtime_test }
 tests.package.test_lua.TestLua: { extends: .runtime_test }
 tests.package.test_lua.TestLuajit: { extends: .runtime_test }
 tests.package.test_perl.TestPerl: { extends: .runtime_test }
support/testing/tests/package/test_lpeg.py new file +25 -0
new file mode 100644
index 000000000..e57415735
@@ -0,0 +1,25 @@
+from tests.package.test_lua import TestLuaBase
+
+
+class TestLuaLPeg(TestLuaBase):
+    config = TestLuaBase.config + \
+        """
+        BR2_PACKAGE_LUA=y
+        BR2_PACKAGE_LPEG=y
+        """
+
+    def test_run(self):
+        self.login()
+        self.module_test("lpeg", script="print(require[[lpeg]].version())")
+
+
+class TestLuajitLPeg(TestLuaBase):
+    config = TestLuaBase.config + \
+        """
+        BR2_PACKAGE_LUAJIT=y
+        BR2_PACKAGE_LPEG=y
+        """
+
+    def test_run(self):
+        self.login()
+        self.module_test("lpeg", script="print(require[[lpeg]].version())")
Signature · 1 line
2.17.1
#2 lore raw

PATCH 3/11 support/testing: add lsqlite3 test

In reply to Francois Perrad
---
 .gitlab-ci.yml                                |  2 ++
 .../testing/tests/package/test_lsqlite3.py    | 25 +++++++++++++++++++
 2 files changed, 27 insertions(+)
 create mode 100644 support/testing/tests/package/test_lsqlite3.py
.gitlab-ci.yml +2 -0
index 1730f3906..b67b3cde1 100644
@@ -328,6 +328,8 @@ tests.package.test_ipython.TestIPythonPy2: { extends: .runtime_test }
 tests.package.test_ipython.TestIPythonPy3: { extends: .runtime_test }
 tests.package.test_lpeg.TestLuaLPeg: { extends: .runtime_test }
 tests.package.test_lpeg.TestLuajitLPeg: { extends: .runtime_test }
+tests.package.test_lsqlite3.TestLuaLsqlite3: { extends: .runtime_test }
+tests.package.test_lsqlite3.TestLuajitLsqlite3: { extends: .runtime_test }
 tests.package.test_lua.TestLua: { extends: .runtime_test }
 tests.package.test_lua.TestLuajit: { extends: .runtime_test }
 tests.package.test_perl.TestPerl: { extends: .runtime_test }
support/testing/tests/package/test_lsqlite3.py new file +25 -0
new file mode 100644
index 000000000..d87477464
@@ -0,0 +1,25 @@
+from tests.package.test_lua import TestLuaBase
+
+
+class TestLuaLsqlite3(TestLuaBase):
+    config = TestLuaBase.config + \
+        """
+        BR2_PACKAGE_LUA=y
+        BR2_PACKAGE_LSQLITE3=y
+        """
+
+    def test_run(self):
+        self.login()
+        self.module_test("lsqlite3")
+
+
+class TestLuajitLsqlite3(TestLuaBase):
+    config = TestLuaBase.config + \
+        """
+        BR2_PACKAGE_LUAJIT=y
+        BR2_PACKAGE_LSQLITE3=y
+        """
+
+    def test_run(self):
+        self.login()
+        self.module_test("lsqlite3")
Signature · 1 line
2.17.1
#3 lore raw

PATCH 4/11 support/testing: add lua-curl test

In reply to Francois Perrad
---
 .gitlab-ci.yml                                |  2 ++
 .../testing/tests/package/test_lua_curl.py    | 25 +++++++++++++++++++
 2 files changed, 27 insertions(+)
 create mode 100644 support/testing/tests/package/test_lua_curl.py
.gitlab-ci.yml +2 -0
index b67b3cde1..e4e9dcb23 100644
@@ -332,6 +332,8 @@ tests.package.test_lsqlite3.TestLuaLsqlite3: { extends: .runtime_test }
 tests.package.test_lsqlite3.TestLuajitLsqlite3: { extends: .runtime_test }
 tests.package.test_lua.TestLua: { extends: .runtime_test }
 tests.package.test_lua.TestLuajit: { extends: .runtime_test }
+tests.package.test_lua_curl.TestLuaLuacURL: { extends: .runtime_test }
+tests.package.test_lua_curl.TestLuajitLuacURL: { extends: .runtime_test }
 tests.package.test_perl.TestPerl: { extends: .runtime_test }
 tests.package.test_perl_class_load.TestPerlClassLoad: { extends: .runtime_test }
 tests.package.test_perl_dbd_mysql.TestPerlDBDmysql: { extends: .runtime_test }
support/testing/tests/package/test_lua_curl.py new file +25 -0
new file mode 100644
index 000000000..5ee79313f
@@ -0,0 +1,25 @@
+from tests.package.test_lua import TestLuaBase
+
+
+class TestLuaLuacURL(TestLuaBase):
+    config = TestLuaBase.config + \
+        """
+        BR2_PACKAGE_LUA=y
+        BR2_PACKAGE_LUA_CURL=y
+        """
+
+    def test_run(self):
+        self.login()
+        self.module_test("cURL")
+
+
+class TestLuajitLuacURL(TestLuaBase):
+    config = TestLuaBase.config + \
+        """
+        BR2_PACKAGE_LUAJIT=y
+        BR2_PACKAGE_LUA_CURL=y
+        """
+
+    def test_run(self):
+        self.login()
+        self.module_test("cURL")
Signature · 1 line
2.17.1
#4 lore raw

PATCH 5/11 support/testing: add lua-utf8 test

In reply to Francois Perrad
---
 .gitlab-ci.yml                                |  2 ++
 .../testing/tests/package/test_lua_utf8.py    | 25 +++++++++++++++++++
 2 files changed, 27 insertions(+)
 create mode 100644 support/testing/tests/package/test_lua_utf8.py
.gitlab-ci.yml +2 -0
index e4e9dcb23..ad7186a98 100644
@@ -334,6 +334,8 @@ tests.package.test_lua.TestLua: { extends: .runtime_test }
 tests.package.test_lua.TestLuajit: { extends: .runtime_test }
 tests.package.test_lua_curl.TestLuaLuacURL: { extends: .runtime_test }
 tests.package.test_lua_curl.TestLuajitLuacURL: { extends: .runtime_test }
+tests.package.test_lua_utf8.TestLuaUtf8: { extends: .runtime_test }
+tests.package.test_lua_utf8.TestLuajitUtf8: { extends: .runtime_test }
 tests.package.test_perl.TestPerl: { extends: .runtime_test }
 tests.package.test_perl_class_load.TestPerlClassLoad: { extends: .runtime_test }
 tests.package.test_perl_dbd_mysql.TestPerlDBDmysql: { extends: .runtime_test }
support/testing/tests/package/test_lua_utf8.py new file +25 -0
new file mode 100644
index 000000000..3eab19dd4
@@ -0,0 +1,25 @@
+from tests.package.test_lua import TestLuaBase
+
+
+class TestLuaUtf8(TestLuaBase):
+    config = TestLuaBase.config + \
+        """
+        BR2_PACKAGE_LUA=y
+        BR2_PACKAGE_LUA_UTF8=y
+        """
+
+    def test_run(self):
+        self.login()
+        self.module_test("utf8")
+
+
+class TestLuajitUtf8(TestLuaBase):
+    config = TestLuaBase.config + \
+        """
+        BR2_PACKAGE_LUAJIT=y
+        BR2_PACKAGE_LUA_UTF8=y
+        """
+
+    def test_run(self):
+        self.login()
+        self.module_test("utf8")
Signature · 1 line
2.17.1
#5 lore raw

PATCH 6/11 support/testing: add luaexpat test

In reply to Francois Perrad
---
 .gitlab-ci.yml                                |  2 ++
 .../testing/tests/package/test_luaexpat.py    | 25 +++++++++++++++++++
 2 files changed, 27 insertions(+)
 create mode 100644 support/testing/tests/package/test_luaexpat.py
.gitlab-ci.yml +2 -0
index ad7186a98..f96f7f130 100644
@@ -336,6 +336,8 @@ tests.package.test_lua_curl.TestLuaLuacURL: { extends: .runtime_test }
 tests.package.test_lua_curl.TestLuajitLuacURL: { extends: .runtime_test }
 tests.package.test_lua_utf8.TestLuaUtf8: { extends: .runtime_test }
 tests.package.test_lua_utf8.TestLuajitUtf8: { extends: .runtime_test }
+tests.package.test_luaexpat.TestLuaLuaExpat: { extends: .runtime_test }
+tests.package.test_luaexpat.TestLuajitLuaExpat: { extends: .runtime_test }
 tests.package.test_perl.TestPerl: { extends: .runtime_test }
 tests.package.test_perl_class_load.TestPerlClassLoad: { extends: .runtime_test }
 tests.package.test_perl_dbd_mysql.TestPerlDBDmysql: { extends: .runtime_test }
support/testing/tests/package/test_luaexpat.py new file +25 -0
new file mode 100644
index 000000000..c71c3fadb
@@ -0,0 +1,25 @@
+from tests.package.test_lua import TestLuaBase
+
+
+class TestLuaLuaExpat(TestLuaBase):
+    config = TestLuaBase.config + \
+        """
+        BR2_PACKAGE_LUA=y
+        BR2_PACKAGE_LUAEXPAT=y
+        """
+
+    def test_run(self):
+        self.login()
+        self.module_test("lxp")
+
+
+class TestLuajitLuaExpat(TestLuaBase):
+    config = TestLuaBase.config + \
+        """
+        BR2_PACKAGE_LUAJIT=y
+        BR2_PACKAGE_LUAEXPAT=y
+        """
+
+    def test_run(self):
+        self.login()
+        self.module_test("lxp")
Signature · 1 line
2.17.1
#6 lore raw

PATCH 7/11 support/testing: add luafilesystem test

In reply to Francois Perrad
---
 .gitlab-ci.yml                                |  2 ++
 .../tests/package/test_luafilesystem.py       | 25 +++++++++++++++++++
 2 files changed, 27 insertions(+)
 create mode 100644 support/testing/tests/package/test_luafilesystem.py
.gitlab-ci.yml +2 -0
index f96f7f130..a73d6b7d0 100644
@@ -338,6 +338,8 @@ tests.package.test_lua_utf8.TestLuaUtf8: { extends: .runtime_test }
 tests.package.test_lua_utf8.TestLuajitUtf8: { extends: .runtime_test }
 tests.package.test_luaexpat.TestLuaLuaExpat: { extends: .runtime_test }
 tests.package.test_luaexpat.TestLuajitLuaExpat: { extends: .runtime_test }
+tests.package.test_luafilesystem.TestLuaLuaFileSystem: { extends: .runtime_test }
+tests.package.test_luafilesystem.TestLuajitLuaFileSystem: { extends: .runtime_test }
 tests.package.test_perl.TestPerl: { extends: .runtime_test }
 tests.package.test_perl_class_load.TestPerlClassLoad: { extends: .runtime_test }
 tests.package.test_perl_dbd_mysql.TestPerlDBDmysql: { extends: .runtime_test }
support/testing/tests/package/test_luafilesystem.py new file +25 -0
new file mode 100644
index 000000000..a84c1f300
@@ -0,0 +1,25 @@
+from tests.package.test_lua import TestLuaBase
+
+
+class TestLuaLuaFileSystem(TestLuaBase):
+    config = TestLuaBase.config + \
+        """
+        BR2_PACKAGE_LUA=y
+        BR2_PACKAGE_LUAFILESYSTEM=y
+        """
+
+    def test_run(self):
+        self.login()
+        self.module_test("lfs")
+
+
+class TestLuajitLuaFileSystem(TestLuaBase):
+    config = TestLuaBase.config + \
+        """
+        BR2_PACKAGE_LUAJIT=y
+        BR2_PACKAGE_LUAFILESYSTEM=y
+        """
+
+    def test_run(self):
+        self.login()
+        self.module_test("lfs")
Signature · 1 line
2.17.1
#7 lore raw

PATCH 8/11 support/testing: add luaossl test

In reply to Francois Perrad
---
 .gitlab-ci.yml                                |  2 ++
 support/testing/tests/package/test_luaossl.py | 25 +++++++++++++++++++
 2 files changed, 27 insertions(+)
 create mode 100644 support/testing/tests/package/test_luaossl.py
.gitlab-ci.yml +2 -0
index a73d6b7d0..92a54bd1f 100644
@@ -340,6 +340,8 @@ tests.package.test_luaexpat.TestLuaLuaExpat: { extends: .runtime_test }
 tests.package.test_luaexpat.TestLuajitLuaExpat: { extends: .runtime_test }
 tests.package.test_luafilesystem.TestLuaLuaFileSystem: { extends: .runtime_test }
 tests.package.test_luafilesystem.TestLuajitLuaFileSystem: { extends: .runtime_test }
+tests.package.test_luaossl.TestLuaLuaossl: { extends: .runtime_test }
+tests.package.test_luaosll.TestLuajitLuaossl: { extends: .runtime_test }
 tests.package.test_perl.TestPerl: { extends: .runtime_test }
 tests.package.test_perl_class_load.TestPerlClassLoad: { extends: .runtime_test }
 tests.package.test_perl_dbd_mysql.TestPerlDBDmysql: { extends: .runtime_test }
support/testing/tests/package/test_luaossl.py new file +25 -0
new file mode 100644
index 000000000..f6914e054
@@ -0,0 +1,25 @@
+from tests.package.test_lua import TestLuaBase
+
+
+class TestLuaLuaossl(TestLuaBase):
+    config = TestLuaBase.config + \
+        """
+        BR2_PACKAGE_LUA=y
+        BR2_PACKAGE_LUAOSSL=y
+        """
+
+    def test_run(self):
+        self.login()
+        self.module_test("openssl")
+
+
+class TestLuajitLuaossl(TestLuaBase):
+    config = TestLuaBase.config + \
+        """
+        BR2_PACKAGE_LUAJIT=y
+        BR2_PACKAGE_LUAOSSL=y
+        """
+
+    def test_run(self):
+        self.login()
+        self.module_test("openssl")
Signature · 1 line
2.17.1
#8 lore raw

PATCH 9/11 support/testing: add luasec test

In reply to Francois Perrad
---
 .gitlab-ci.yml                               |  2 ++
 support/testing/tests/package/test_luasec.py | 25 ++++++++++++++++++++
 2 files changed, 27 insertions(+)
 create mode 100644 support/testing/tests/package/test_luasec.py
.gitlab-ci.yml +2 -0
index 92a54bd1f..12ac3a43e 100644
@@ -342,6 +342,8 @@ tests.package.test_luafilesystem.TestLuaLuaFileSystem: { extends: .runtime_test
 tests.package.test_luafilesystem.TestLuajitLuaFileSystem: { extends: .runtime_test }
 tests.package.test_luaossl.TestLuaLuaossl: { extends: .runtime_test }
 tests.package.test_luaosll.TestLuajitLuaossl: { extends: .runtime_test }
+tests.package.test_luasec.TestLuaLuaSec: { extends: .runtime_test }
+tests.package.test_luasec.TestLuajitLuaSec: { extends: .runtime_test }
 tests.package.test_perl.TestPerl: { extends: .runtime_test }
 tests.package.test_perl_class_load.TestPerlClassLoad: { extends: .runtime_test }
 tests.package.test_perl_dbd_mysql.TestPerlDBDmysql: { extends: .runtime_test }
support/testing/tests/package/test_luasec.py new file +25 -0
new file mode 100644
index 000000000..f87326362
@@ -0,0 +1,25 @@
+from tests.package.test_lua import TestLuaBase
+
+
+class TestLuaLuaSec(TestLuaBase):
+    config = TestLuaBase.config + \
+        """
+        BR2_PACKAGE_LUA=y
+        BR2_PACKAGE_LUASEC=y
+        """
+
+    def test_run(self):
+        self.login()
+        self.module_test("ssl")
+
+
+class TestLuajitLuaSec(TestLuaBase):
+    config = TestLuaBase.config + \
+        """
+        BR2_PACKAGE_LUAJIT=y
+        BR2_PACKAGE_LUASEC=y
+        """
+
+    def test_run(self):
+        self.login()
+        self.module_test("ssl")
Signature · 1 line
2.17.1
#9 lore raw

PATCH 10/11 support/testing: add luasocket test

In reply to Francois Perrad
---
 .gitlab-ci.yml                                |  2 ++
 .../testing/tests/package/test_luasocket.py   | 25 +++++++++++++++++++
 2 files changed, 27 insertions(+)
 create mode 100644 support/testing/tests/package/test_luasocket.py
.gitlab-ci.yml +2 -0
index 12ac3a43e..65f9d5a1f 100644
@@ -344,6 +344,8 @@ tests.package.test_luaossl.TestLuaLuaossl: { extends: .runtime_test }
 tests.package.test_luaosll.TestLuajitLuaossl: { extends: .runtime_test }
 tests.package.test_luasec.TestLuaLuaSec: { extends: .runtime_test }
 tests.package.test_luasec.TestLuajitLuaSec: { extends: .runtime_test }
+tests.package.test_luasocket.TestLuaLuaSocket: { extends: .runtime_test }
+tests.package.test_luasocket.TestLuajitLuaSocket: { extends: .runtime_test }
 tests.package.test_perl.TestPerl: { extends: .runtime_test }
 tests.package.test_perl_class_load.TestPerlClassLoad: { extends: .runtime_test }
 tests.package.test_perl_dbd_mysql.TestPerlDBDmysql: { extends: .runtime_test }
support/testing/tests/package/test_luasocket.py new file +25 -0
new file mode 100644
index 000000000..c2d19d78c
@@ -0,0 +1,25 @@
+from tests.package.test_lua import TestLuaBase
+
+
+class TestLuaLuaSocket(TestLuaBase):
+    config = TestLuaBase.config + \
+        """
+        BR2_PACKAGE_LUA=y
+        BR2_PACKAGE_LUASOCKET=y
+        """
+
+    def test_run(self):
+        self.login()
+        self.module_test("socket")
+
+
+class TestLuajitLuaSocket(TestLuaBase):
+    config = TestLuaBase.config + \
+        """
+        BR2_PACKAGE_LUAJIT=y
+        BR2_PACKAGE_LUASOCKET=y
+        """
+
+    def test_run(self):
+        self.login()
+        self.module_test("socket")
Signature · 1 line
2.17.1
#10 lore raw

PATCH 11/11 support/testing: add rings test

In reply to Francois Perrad
---
 .gitlab-ci.yml                              |  2 ++
 support/testing/tests/package/test_rings.py | 25 +++++++++++++++++++++
 2 files changed, 27 insertions(+)
 create mode 100644 support/testing/tests/package/test_rings.py
.gitlab-ci.yml +2 -0
index 65f9d5a1f..86067757c 100644
@@ -403,6 +403,8 @@ tests.package.test_python_txtorcon.TestPythonPy2Txtorcon: { extends: .runtime_te
 tests.package.test_python_txtorcon.TestPythonPy3Txtorcon: { extends: .runtime_test }
 tests.package.test_python_ubjson.TestPythonPy2Ubjson: { extends: .runtime_test }
 tests.package.test_python_ubjson.TestPythonPy3Ubjson: { extends: .runtime_test }
+tests.package.test_rings.TestLuaRings: { extends: .runtime_test }
+tests.package.test_rings.TestLuajitRings: { extends: .runtime_test }
 tests.package.test_rust.TestRust: { extends: .runtime_test }
 tests.package.test_rust.TestRustBin: { extends: .runtime_test }
 tests.package.test_syslog_ng.TestSyslogNg: { extends: .runtime_test }
support/testing/tests/package/test_rings.py new file +25 -0
new file mode 100644
index 000000000..be9765f18
@@ -0,0 +1,25 @@
+from tests.package.test_lua import TestLuaBase
+
+
+class TestLuaRings(TestLuaBase):
+    config = TestLuaBase.config + \
+        """
+        BR2_PACKAGE_LUA=y
+        BR2_PACKAGE_RINGS=y
+        """
+
+    def test_run(self):
+        self.login()
+        self.module_test("rings")
+
+
+class TestLuajitRings(TestLuaBase):
+    config = TestLuaBase.config + \
+        """
+        BR2_PACKAGE_LUAJIT=y
+        BR2_PACKAGE_RINGS=y
+        """
+
+    def test_run(self):
+        self.login()
+        self.module_test("rings")
Signature · 1 line
2.17.1
#11 lore raw

PATCH 1/11 luarocks: add generation of test

In reply to Francois Perrad

Hello Fran?ois,

Quoted 4 lines · On Tue, 19 Feb 2019 16:43:01 +0100 Francois Perrad <[email protected]> wrote:
---
 package/luarocks/buildroot.lua | 60 ++++++++++++++++++++++++++++++++++
 1 file changed, 60 insertions(+)

I have applied this entire series, thanks! It's going in the good direction, but I found some odd things.

The lpeg test looks like this:

+ self.module_test("lpeg", script="print(require[[lpeg]].version())")

which clearly cannot have been generated by the Luarocks "buildroot" script, which does only:

+ f:write(' self.module_test("' .. modname .. '")\n')

Also, I've used "lpeg-upgrade" and "rings-upgrade" as tests, and noticed some differences:

- self.module_test("lpeg", script="print(require[[lpeg]].version())")
+ self.module_test("LPeg")

So we have the difference I explained above + a difference in the casing of the module.

We have the same casing difference with rings:

- self.module_test("rings")
+ self.module_test("Rings")

Is this expected ?

Best regards,

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
#12 lore raw

PATCH 1/11 luarocks: add generation of test

Le jeu. 28 mars 2019 ? 17:22, Thomas Petazzoni <[email protected]> a ?crit :

Quoted 38 lines

Hello Fran?ois,

Quoted 4 lines · On Tue, 19 Feb 2019 16:43:01 +0100 Francois Perrad <[email protected]> wrote:
---
 package/luarocks/buildroot.lua | 60 ++++++++++++++++++++++++++++++++++
 1 file changed, 60 insertions(+)

I have applied this entire series, thanks! It's going in the good direction, but I found some odd things.

The lpeg test looks like this:

+ self.module_test("lpeg",
script="print(require[[lpeg]].version())")

which clearly cannot have been generated by the Luarocks "buildroot" script, which does only:

+ f:write(' self.module_test("' .. modname .. '")\n')

Also, I've used "lpeg-upgrade" and "rings-upgrade" as tests, and noticed some differences:

- self.module_test("lpeg",
script="print(require[[lpeg]].version())")
+ self.module_test("LPeg")

So we have the difference I explained above + a difference in the casing of the module.

We have the same casing difference with rings:

(quoted diff) +1 -1
-        self.module_test("rings")
+        self.module_test("Rings")
Quoted 2 lines

Is this expected ?

Yes, more or less.

The lua ecosystem has no common policy about naming, etc... So, a generated stuff sometime needs a manual editing.

Fran?ois

Quoted 12 lines

Best regards,

Thomas
--
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
_______________________________________________
buildroot mailing list
buildroot at busybox.net
http://lists.busybox.net/mailman/listinfo/buildroot

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.busybox.net/pipermail/buildroot/attachments/20190328/6dcc32fc/attachment.html>

#13 lore raw

PATCH 1/11 luarocks: add generation of test

Quoted 7 lines · On Thu, 28 Mar 2019 18:13:05 +0100 Fran?ois Perrad <[email protected]>…
Quoted 2 lines

Is this expected ?

Yes, more or less.

The lua ecosystem has no common policy about naming, etc... So, a generated stuff sometime needs a manual editing.

So for lpeg you really a special .module_test() call ?

Why is the "rings" test case not matching the output of "make rings-upgrade" ?

Thanks,

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com