From patchwork Wed Jan 13 17:08:11 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christophe Milard X-Patchwork-Id: 59669 Delivered-To: patch@linaro.org Received: by 10.112.130.2 with SMTP id oa2csp3455811lbb; Wed, 13 Jan 2016 08:09:50 -0800 (PST) X-Received: by 10.140.173.132 with SMTP id t126mr189197302qht.96.1452701390833; Wed, 13 Jan 2016 08:09:50 -0800 (PST) Return-Path: Received: from lists.linaro.org (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id k9si1987090qge.20.2016.01.13.08.09.49; Wed, 13 Jan 2016 08:09:50 -0800 (PST) Received-SPF: pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.225.227.206 as permitted sender) client-ip=54.225.227.206; Authentication-Results: mx.google.com; spf=pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.225.227.206 as permitted sender) smtp.mailfrom=lng-odp-bounces@lists.linaro.org; dkim=neutral (body hash did not verify) header.i=@linaro.org Received: by lists.linaro.org (Postfix, from userid 109) id 8A50F6178E; Wed, 13 Jan 2016 16:09:49 +0000 (UTC) Authentication-Results: lists.linaro.org; dkim=fail reason="verification failed; unprotected key" header.d=linaro.org header.i=@linaro.org header.b=NMTzCd8M; dkim-adsp=none (unprotected policy); dkim-atps=neutral X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on ip-10-142-244-252 X-Spam-Level: X-Spam-Status: No, score=-2.5 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, T_DKIM_INVALID, URIBL_BLOCKED autolearn=disabled version=3.4.0 Received: from [127.0.0.1] (localhost [127.0.0.1]) by lists.linaro.org (Postfix) with ESMTP id 807BC61775; Wed, 13 Jan 2016 16:09:44 +0000 (UTC) X-Original-To: lng-odp@lists.linaro.org Delivered-To: lng-odp@lists.linaro.org Received: by lists.linaro.org (Postfix, from userid 109) id 9B34661775; Wed, 13 Jan 2016 16:09:36 +0000 (UTC) Received: from mail-lf0-f51.google.com (mail-lf0-f51.google.com [209.85.215.51]) by lists.linaro.org (Postfix) with ESMTPS id 767B961766 for ; Wed, 13 Jan 2016 16:09:35 +0000 (UTC) Received: by mail-lf0-f51.google.com with SMTP id 17so56212129lfz.1 for ; Wed, 13 Jan 2016 08:09:35 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id; bh=RWypnWUKKyAEHem0OKajH8JpWK4b5J4aQc57fn10fRs=; b=NMTzCd8MK4VyofKAvDf3eO3FAqP+HmrXcdki0urLz85uQpMF6SmvUncKz9mNDfB2Ph YobysfZUElBDP5NJT5w4AMhe3hpeOCBocJfQhQYhFB/QSG2sF7yYgu3UflIDQyyyTPYw aISKUxsAITkAj6cd0KD03sX/nGtCXtiq6n8PA= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=RWypnWUKKyAEHem0OKajH8JpWK4b5J4aQc57fn10fRs=; b=Rdz2gt32rjf/GQx04dupxfScWJouxA96R0bX6pjZkJ3EEutZ4eD4PAlQbSwTLTAJvU FTUhxKpz7/yhT5igMiCoaSY4Ak+dWyqnzc0+xs2NcVTc7T237C+3C+tWg67Jw2J29L3d CFlTiRqv2h9RvRFzn7l/iZs6RcTJSOJ8KxxESnpPD+4boWZiLnyLEv+ac0IMUB6x9ubD 3zNa+/h7cWQMLkBUvKOhiLKCUdSl4bRS/Rqa69frl2VrrG+euAjusy6qJANK8aYQd9Xc 5h3XpbkNHhYfnz9PJWHtgrAsVnkCiXWeao/0qFgPTSbNZsCx+gIKj05lXa98tRKJ5Elc wtAg== X-Gm-Message-State: ALoCoQkCV/1+GpTHO/9TUPDuMkArzbaziedmoeKGmUVhVVBvB0c2iCRWQJ8Xta2uIC5bvCUHiRUWykoddgNaP2ONR3ptW92JRQ== X-Received: by 10.25.29.193 with SMTP id d184mr9980695lfd.28.1452701373903; Wed, 13 Jan 2016 08:09:33 -0800 (PST) Received: from erachmi-ericsson.ki.sw.ericsson.se (c-83-233-90-46.cust.bredband2.com. [83.233.90.46]) by smtp.gmail.com with ESMTPSA id uk7sm257674lbb.32.2016.01.13.08.09.32 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 13 Jan 2016 08:09:33 -0800 (PST) From: Christophe Milard To: mike.holmes@linaro.org, stuart.haslam@linaro.org Date: Wed, 13 Jan 2016 18:08:11 +0100 Message-Id: <1452704893-17874-1-git-send-email-christophe.milard@linaro.org> X-Mailer: git-send-email 2.1.4 X-Topics: patch Cc: lng-odp@lists.linaro.org Subject: [lng-odp] [PATCHv2 1/3] doc: implementers-guide: conditional tests X-BeenThere: lng-odp@lists.linaro.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: "The OpenDataPlane \(ODP\) List" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: lng-odp-bounces@lists.linaro.org Sender: "lng-odp" Documentation on conditional test is added here, as it seemed to be missing Signed-off-by: Christophe Milard Reviewed-by: Bill Fischofer --- doc/implementers-guide/implementers-guide.adoc | 29 ++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/doc/implementers-guide/implementers-guide.adoc b/doc/implementers-guide/implementers-guide.adoc index eb076cf..57be4b2 100644 --- a/doc/implementers-guide/implementers-guide.adoc +++ b/doc/implementers-guide/implementers-guide.adoc @@ -389,4 +389,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[]