Source-Changes-D archive

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

Re: CVS commit: src/tests

On Jun 14,  5:14am, (Jukka Ruohonen) wrote:
-- Subject: Re: CVS commit: src/tests

| On Sat, Jun 11, 2011 at 02:03:20PM -0400, Christos Zoulas wrote:
| > Log Message:
| > Turn warns on for all tests and fix all the bugs.
| Thanks for the cleanup.
| Now the "wscrl"-test (lib/libcurses/t_curses) however fails:

Peeling though the layers and trying to figure out what's going on is really
annoying. So:

Let's start: t_curses is a shell script.

Try to run it from source:

        $ cd /usr/src/tests/lib/libcurses
        $ atf-run obj.amd64/t_curses
        atf-run: ERROR: Cannot open Atffile

Ok, let's try to run it from the object directory:

        $ cd obj.amd64
        $ atf-run t_curses
        [loads of crap printing}
 not found

Ok finds the wrong path for programs it needs, let's try the installed copy.

        $ cd /usr/tests/lib/libcurses
        $ atf-run t_curses
        [loads of crap printing}
        tps-count: 1
        tp-start: t_curses, 25
        tc-start: addch
        tc-se:Warning: excess data from slave at line 2 of file 

Perhaps we can add sh -x before to see what it tries to run:

        $ sh -x t_curses
        + 'atf_test_case' startup
        atf_test_case: not found

Nope, it needs atf-sh to run. Perhaps atf-sh as a shell will take -x?

        $ atf-sh -x t_curses
        atf-sh -x t_curses
        atf-sh: ERROR: Unknown option -x.
        atf-sh: Type `atf-sh -h' for more details.
        $ tf-sh -h
        atf-sh -h
        Usage: atf-sh [options]
        atf-sh is a shell interpreter that extends the functionality of the 
        sh(1) with the atf-sh library.
        Available options:
        -h     Shows this help message
        For more details please see atf-sh(1) and atf(7).

Very helpful. Ok I guess now I have to edit t_curses and add set -x to it.

        $ atf-run t_curses 
        [thousands of lines of unhelpful output]

Maybe running t_curses directly will help:

        $ ./t_curses startup
        [many many lines later...]
        + '/usr/tests/lib/libcurses/./director' -s 
'/usr/tests/lib/libcurses/./slave' '/usr/tests/lib/libcurses/./tests/start'
        Warning: excess data from slave at line 2 of file 

Oh goodie, let me run this.

        $ '/usr/tests/lib/libcurses/./director' -s 
'/usr/tests/lib/libcurses/./slave' '/usr/tests/lib/libcurses/./tests/start'
        WARNING: CHECK_PATH not set, defaulting to ./
        WARNING: INCLUDE_PATH not set, defaulting to ./
        director: Error opening ./std_defines: No such file or directory

Beautiful, we have a command that takes arguments from the command line,
the environment, and has default arguments, that I need to read the source
to find them.

I won't bore you any more with this, but I am still peeling layers of brown
cylindrical items to find out what's going on with the test program.

Surely, there must be a simpler way to isolate the test program that is
running so that I can run it by hand and debug it! So what is it?


Home | Main Index | Thread Index | Old Index