Tests: Move tests to tests/regression Also move the utils.sh and utils.h helper files under tests/utils. Signed-off-by: Christian Babeux <christian.babeux@efficios.com>
Tests: Add filtering tests for uncovered cases While investigating the code coverage of the filtering feature, a couple of possible tests cases were uncovered: Error tests: * Strings can't be IR root node * Unary ! not allowed on string type * Comparison with string type not allowed * Logical operator not allowed with string types * Nesting of binary operator not allowed Valid tests: * Cover all left/right operands permutations with fields ref. and numeric values. Signed-off-by: Christian Babeux <christian.babeux@efficios.com> Signed-off-by: David Goulet <dgoulet@efficios.com>
Tests: Add filtering tests to configure Add filtering folder to top-level Makefile.am. Also add a runall script to run all filtering tests. Signed-off-by: Christian Babeux <christian.babeux@efficios.com> Signed-off-by: David Goulet <dgoulet@efficios.com>
Tests: Add a test for valid filters This test validate that for a given filter the expected trace output is conform to the expected filter behavior. This test rely on the babelstats utility. With the help of this script, we can verify that the expected minimum and maximum values on fields of interest are within the expected ranges. For example, given 100 iterations on a tracepoint with the field 'intfield', with values starting from 0 and incrementing on each iteration, and the filter expression 'intfield < 4', we would expect that the min-max range lie within [0,3]. Thus, if the babelstat computed range does not match the expected range, this could potentially indicate failure in the filtering mechanism. Signed-off-by: Christian Babeux <christian.babeux@efficios.com> Signed-off-by: David Goulet <dgoulet@efficios.com>
Tests: Add a trace statistics utility The babelstats script output statistics on fields values for a particular tracepoint. At the moment, the script only show minimum and maximum value for each fields of a particular tracepoint. The trace must be in the babeltrace text format. It can be passed via stdin. The script output this format: field_name min max Sample usage: > babeltrace sometracedir | babelstats.pl --tracepoint tp:tptest _seqfield1_length 4 4 seqfield2 "test" "test" stringfield2 "\*" "\*" floatfield 2222 2222 netintfieldhex 0x0 0x63 _seqfield2_length 4 4 longfield 0 99 netintfield 0 99 intfield2 0x0 0x63 intfield 0 99 stringfield "test" "test" doublefield 2 2 arrfield2 "test" "test" Use case: This script could be useful to validate that fields values are within some predefined expected ranges. Signed-off-by: Christian Babeux <christian.babeux@efficios.com> Signed-off-by: David Goulet <dgoulet@efficios.com>
Tests: Add a test for invalid filters This test validate that an invalid filter (unmatched parenthesis, field dereferences, unsupported ops, etc.) are correctly flagged as such. Signed-off-by: Christian Babeux <christian.babeux@efficios.com> Signed-off-by: David Goulet <dgoulet@efficios.com>
Tests: Add an unsupported operators filtering test This test validate that filters with unsupported operators are correctly flagged and that an enable event with these filters properly fails. Signed-off-by: Christian Babeux <christian.babeux@efficios.com> Signed-off-by: David Goulet <dgoulet@efficios.com>