aboutsummaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
authorChristophe Milard <christophe.milard@linaro.org>2016-01-13 18:08:11 +0100
committerMaxim Uvarov <maxim.uvarov@linaro.org>2016-01-25 16:05:30 +0300
commit43625d21d3afabf4022f49e470cbe3e1e45ea3fc (patch)
tree6aa2c4f2990cc301440a5aea8f3caee66a3a5e4f /doc
parentac034ee36d293683669c4ad46f259051b299b7a6 (diff)
doc: implementers-guide: conditional tests
Documentation on conditional test is added here, as it seemed to be missing Signed-off-by: Christophe Milard <christophe.milard@linaro.org> Reviewed-by: Bill Fischofer <bill.fischofer@linaro.org> Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
Diffstat (limited to 'doc')
-rw-r--r--doc/implementers-guide/implementers-guide.adoc29
1 files changed, 29 insertions, 0 deletions
diff --git a/doc/implementers-guide/implementers-guide.adoc b/doc/implementers-guide/implementers-guide.adoc
index 574317a6d..77dc55c1e 100644
--- a/doc/implementers-guide/implementers-guide.adoc
+++ b/doc/implementers-guide/implementers-guide.adoc
@@ -390,4 +390,33 @@ It's expected that early in the development cycle of a new implementation the
inactive list will be quite long, but it should shrink over time as more parts
of the API are implemented.
+==== conditionnal tests ====
+
+Some tests may require specific conditions to make sense: for instance, on
+pktio, checking that sending a packet larger than the MTU is rejected only makes
+sense if packets can indeed, on that ODP implementation, exceed the MTU.
+A test can be marked conditionnal as follows:
+
+[source,c]
+------------------
+odp_testinfo_t foo_tests[] = {
+ ...
+ ODP_TEST_INFO_CONDITIONAL(foo_test_x, foo_check_x),
+ ...
+ ODP_TEST_INFO_NULL
+};
+
+odp_suiteinfo_t foo_suites[] = {
+ {"Foo", foo_suite_init, foo_suite_term, foo_tests},
+ ODP_SUITE_INFO_NULL
+};
+------------------
+
+Foo_test_x is the usual test function. Foo_check_x is the test precondition,
+i.e. a function returning an bollean (int).
+It is called before the test suite is started. If it returns true, the
+test (foo_test_x) is run. If the precondition function (foo_check_x above)
+returns false, the test is not relevant (or impossible to perform) and it will
+be skipped.
+
include::../glossary.adoc[]