lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


Matěj Cepl píše v Čt 02. 07. 2020 v 18:47 +0200:
> When trying to build Lua 5.4 for openSUSE (with running the test 
> suite from https://www.lua.org/tests/) we hit one failing test 
> (the full log is on https://is.gd/pFDvtp):
> 
> [   65s] ***** FILE 'files.lua'*****
> [   65s] testing i/o
> [   65s] /home/abuild/rpmbuild/BUILDROOT/lua54-5.4.0-134.1.x86_64/usr/bin/lua5.4: files.lua:84: assertion failed!
> [   65s] stack traceback:
> [   65s] 	[C]: in function 'assert'
> [   65s] 	files.lua:84: in main chunk
> [   65s] 	(...tail calls...)
> [   65s] 	all.lua:205: in main chunk
> [   65s] 	[C]: in ?
> [   65s] .>>> closing state <<<
> 
> Anybody any idea, what’s going on? Also, how do I make one test 
> to be skipped?

OK, there is more than one test which seems like a problem.

1. In the file attrib.lua I had to apply this patch:

    --- a/lua-5.4.0-tests/attrib.lua
    +++ b/lua-5.4.0-tests/attrib.lua
    @@ -269,7 +269,7 @@ local p = ""   -- On Mac OS X, redefine
     local st, err, when = package.loadlib(DC"lib1", "*")
     if not st then
       local f, err, when = package.loadlib("donotexist", p.."xuxu")
    -  assert(not f and type(err) == "string" and when == "absent")
    +  assert(not f and type(err) == "string" and when == "open")
       ;(Message or print)('\n >>> cannot load dynamic library <<<\n')
       print(err, when)
     else

2. In files.lua (original error I have reported above), I add to 
   comment out the assert line in this test (line 84):

   if not _port then   -- invalid seek
     local status, msg, code = io.stdin:seek("set", 1000)
     assert(not status and type(msg) == "string" and type(code) == "number")
   end

    First of all, according to 
    https://www.lua.org/manual/5.4/manual.html#pdf-file:seek 
    I don't think seek method returns three values, just two 
    (“If seek fails, it returns fail, plus a string describing 
    the error.”) What is worse, in this case I get status == 
    0 and msg is nil. I had to comment out this assert line.

3. In the same file there is another test (on line 747):

    for _, v in ipairs(tests) do
        local x, y, z = io.popen(v[1]):close()
        local x1, y1, z1 = os.execute(v[1])
        assert(x == x1 and y == y1 and z == z1)
        if v[2] == "ok" then
          assert(x and y == 'exit' and z == 0)
        else
          print('y = ' .. y)
          print('v[2] = ' .. v[2])
          assert(not x and y == v[2])   -- correct status and 'what'
          -- correct code if known (but always different from 0)
          assert((v[3] == nil and z > 0) or v[3] == z)
        end
      end

Which prints to me this:

    [   41s] sh: not-to-be-found-command: command not found
    [   41s] sh: not-to-be-found-command: command not found
    [   41s] y = exit
    [   41s] v[1] = not-to-be-found-command
    [   41s] v[2] = exit
    [   41s] y = exit
    [   41s] v[1] = exit 3
    [   41s] v[2] = exit
    [   41s] y = exit
    [   41s] v[1] = exit 129
    [   41s] v[2] = exit
    [   41s] y = signal
    [   41s] v[1] = kill -s HUP $$
    [   41s] v[2] = signal
    [   41s] y = signal
    [   41s] v[1] = kill -s KILL $$
    [   41s] v[2] = signal
    [   41s] y = signal
    [   41s] v[1] = sh -c 'kill -s HUP $$'
    [   41s] v[2] = exit
    [   41s] /home/abuild/rpmbuild/BUILDROOT/lua54-5.4.0-0.x86_64/usr/bin/lua5.4: files.lua:748: assertion failed!
    [   41s] stack traceback:
    [   41s] 	[C]: in function 'assert'
    [   41s] 	files.lua:748: in main chunk
    [   41s] 	(...tail calls...)
    [   41s] 	all.lua:205: in main chunk
    [   41s] 	[C]: in ?
    [   41s] .>>> closing state <<<

    It seems to me that the when the test fails, it is really 
    wrong: $$ in this situation should expand to the PID of the 
    inferior process, shouldn’t it? When I comment this one line 
    in the tests table, this tests passes.

Any comments?

Thank you very much for any reply,

Best,

Matěj

-- 
https://matej.ceplovi.cz/blog/, Jabber: mcepl@ceplovi.cz
GPG Finger: 3C76 A027 CA45 AD70 98B5  BC1D 7920 5802 880B C9D8
 
I know of no country in which there is so little independence of
mind and real freedom of discussion as in America.
    -- Alexis de Tocqueville

Attachment: signature.asc
Description: This is a digitally signed message part