Test for presence of bison and flex when building from git

Fixes #74

Signed-off-by: Yannick Brosseau <yannick.brosseau@gmail.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Put the libbabeltrace-ctf specific parts of babeltrace.pc into a babeltrace-ctf.pc file

On some distributions libbabeltrace and libbabeltrace-ctf are packaged
into separate packages. This means they should have their own pkg-config
file.

The babeltrace-ctf.pc file requires the babeltrace.pc one.

With this change, to have the ctf support in libbabeltrace a pkg-config
user will need to specify the babeltrace-ctf package. To compile and
link with only the base libbabeltrace, the package babeltrace would be
used.

Fixes #550

Signed-off-by: Yannick Brosseau <yannick.brosseau@gmail.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Add missing lex/bison generated files to make clean

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Fix CTF parser hang with bison 3.0

Replace deprecated YYLEX_PARAM with %lex-param

See http://article.gmane.org/gmane.org.fsf.announce/2006 for details.

Tested with bison 2.5 and bison 3.0.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Fix ctf_clock_declaration_visit returning an error when reading a boolean

The ret variable is used to read the "absolute" field's value and was
not reset to zero, thus returning an error whenever that value was TRUE.

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Tests: Move TAP helpers to tests/utils/tap

tests/utils/tap/tap.{h,c}:
For use in C tests. You can link against libtap with the usual automake
mechanisms.

New TAP helper:

tests/utils/tap/tap.sh:
For use in shell scripts tests. Source the script
(e.g. source "tests/utils/tap/tap.sh") to use the relevants TAP
functions.

Signed-off-by: Christian Babeux <christian.babeux@efficios.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Tests: Rename tests under lib with tests naming convention

Signed-off-by: Christian Babeux <christian.babeux@efficios.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Tests: Split lib tests in multiple standalone test scripts

Signed-off-by: Christian Babeux <christian.babeux@efficios.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Tests: Add trace reading test with babeltrace bin

This test uses the sample traces found in tests/ctf-traces and the
babeltrace cli tool to parse them. The traces found in
ctf-traces/succeed should return a successful exit code and those in
ctf-traces/fail should return a failure exit code.

Signed-off-by: Christian Babeux <christian.babeux@efficios.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Tests: Use Perl prove as the testsuite runner

This commit modify the make check target to run Perl prove as the
testsuite runner.

$ cd babeltrace/tests
$ ./run.sh tests

One can also run tests manually using prove:

$ prove --exec '' path/to/test

    OR

$ prove --exec '' - < testlist

Signed-off-by: Christian Babeux <christian.babeux@efficios.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Add missing test files to make dist

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
make check VPATH build

Copy scripts to builddir if VPATH build is detected.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Add missing Makefile.am

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Tests: fix string octal encoding

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Fix: test_seek static linking

./configure --disable-shared --enable-static
make
make check

The make check fails for test_seek.

Fix this by ensuring that test_seek has a dependency on libbabeltrace
and libbabeltrace-ctf. This is a temporary work-around until we improve
our plugin handling.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Fix: test_seek should only output one TAP plan

On critical failure paths, the test_seek test was outputting multiple
TAP plans, which according to the specification [1] is invalid. This
causes parsing issues on very strict TAP parsers.

[1] - http://podwiki.hexten.net/TAP/TAP.html?page=TAP

Signed-off-by: Christian Babeux <christian.babeux@efficios.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Parse LTTng indexes

If a trace file has an associated index (same filename and .idx suffix),
we open it and use it instead of generating the index at open.

Signed-off-by: Julien Desfossez <jdesfossez@efficios.com>