Merge pull request #2 from fishman/master

Get latest fishman changes
readLine: do not use strlen to determine line size

fgets may read a buffer that contains NUL characters.  Caught by
valgrind: when the first byte is NUL, invalid read occurred.
units: Don't include the test directory in the output tags file

Not having the test directory name in the expected output makes it
easier to move the test case, e.g. from a ".i" or ".b" directory
(broken tests) to a ".d" one (normal test) e.g. when fixing a parser
bug.
units: Strip directory name from all expected output
units: add SHRINK parameter to testing.mak

If SHRINK=1 is specified as argument for units target of testing.mak,
and a test case if failed or timed out, shurink action is automaically
taken.

Here is an example (A bug is embedded for produce this exmpale):

    $ make -f testing.mak units SHRINK=1 UNITS_TIMEOUT=1
    Testing test.py as Python                                   passed
    Testing test.vhd as VHDL                                    failed (TIMED OUT)
    Shringking Units/test.vhd.t/input.vhd as VHDL
    [0     192381]...timeout(124)
    [0          0]...ok(0)
    [0     192381]...timeout(124)
    [0      96191]...timeout(124)
    [0      48096]...timeout(124)
    ...
    [158      160]...timeout(124)
    [159      160]...timeout(124)
    Minimal badinput input: Units/test.vhd.t/SHRINK-VHDL.tmp
    ............................................................
    a
    Testing traffic_signal.v as Verilog                         passed

Signed-off-by: Masatake YAMATO <yamato@redhat.com>
Merge pull request #122 from dtikhonov/master

Fixed a bug in readLine
Merge branch 'units-basename' of https://github.com/b4n/fishman-ctags into b4n-units-basename

Conflicts:
	misc/units
Merge branch 'b4n-units-basename'
units: fix a typo, missing end '}' for run_shrink

Signed-off-by: Masatake YAMATO <yamato@redhat.com>
units: close stderr of subshell to suppress error messages

When ctags exits with abnormal status, its parent shell
reports it to stderr. This is noise for our purpose. This
patch makes the subshell close its stderr.

This bug(noise) is reported by in #60 by @vhda.
This patch reverts wrong fix (59cfb8df658162b5ba852c7bddbbd4a8d0b14f10)
for the same bug.

Signed-off-by: Masatake YAMATO <yamato@redhat.com>
Make file name pattern take precedence over modelines when guessing a parser

Conceptually this reverts 29e3d93c93e8d4117568e1c4b81c512062b78901.
There some reasons in this reversion.
(1) guessing a parser by file contents takes cost than by matching file name(@dtikhonov),
(2) modelines leads false positives guessing(@dtikhonov), and
(3) it may be a rare case that a parser guessed by file name is not equal to a
    parser guessed by file contents. In many case no parser is guessed by
    a file name and a parser can be guessed by file contents. In this case
    guessing a parser by file name before guessing a parser by file contents
    is acceptable because the cost of doing former is enough low (@masatake).

Suggested by @dtikhonov in #123.

Signed-off-by: Masatake YAMATO <yamato@redhat.com>
units: allow multiple categories

    multiple categories seprated by comma can be specified with CATEGORIES=.

Signed-off-by: Masatake YAMATO <yamato@redhat.com>
Units: add new category named "parser-ada" and move all ada relates cases to here

Signed-off-by: Masatake YAMATO <yamato@redhat.com>
Units: remove add ada test cases at ROOT category

Signed-off-by: Masatake YAMATO <yamato@redhat.com>
Fixed an off-by-one bug in previous commit.
units: remove --name from help message

--name was converted to --units.

Signed-off-by: Masatake YAMATO <yamato@redhat.com>
units: don't use undefined variable UNITS_DIR

Signed-off-by: Masatake YAMATO <yamato@redhat.com>
units: remove unnecessary backslash at the end of line

Signed-off-by: Masatake YAMATO <yamato@redhat.com>
units: fix wrong variable reference

${guessed_lang} is referred in run_shrink.
This should be ${lang}.

Signed-off-by: Masatake YAMATO <yamato@redhat.com>
units: add --quiet option to shrink action

Signed-off-by: Masatake YAMATO <yamato@redhat.com>