Git Product home page Git Product logo

Comments (4)

lornat75 avatar lornat75 commented on August 14, 2024

@traversaro @randaz81 @valegagge

from robot-testing-framework.

apaikan avatar apaikan commented on August 14, 2024

I doubt which message user should include in RTF_TEST_CHECK; i.e. reports the cause of failure or a comment on what has been checked. For example:

bool ret = yarp::os::Network::connect("/port1", "/port2");
RTF_TEST_CHECK(ret, "connecting two ports.");    // what was the reason of failure?

or

bool ret = yarp::os::Network::connect("/port1", "/port2");
RTF_TEST_CHECK(ret, "cannot connect two ports because blablabla..." ); 

for now this can be solved by using two different macros (maybe not very convenient):

RTF_TEST_REPORT("connecting two ports.");
bool ret = yarp::os::Network::connect("/port1", "/port2");
RTF_TEST_CHECK(ret, "cannot connect two ports because blablabla..." ); 

The RTF_TEST_CHECK macro has been used in many different test cases and changing it may needs changes to some of the tests implementation :s What about introducing another macro which aggregate both (comment and cause of failure) ?

from robot-testing-framework.

lornat75 avatar lornat75 commented on August 14, 2024

I vote for the first option because you rarely know why a test fails but you do known what you are testing.

I think we just need to extend the macro so that it always reports the result of the test (either success or fail).

from robot-testing-framework.

apaikan avatar apaikan commented on August 14, 2024
  • the RTF_TEST_CHECK has been modified to shows the corresponding messages (thanks to @lornat75 )
  • for the backward compatibility, the RTF_TEST_FAIL_IF has been implemented which does the same job as the old RTF_TEST_CHECK
  • for example, the following code:
RTF_TEST_CHECK(2<3, "two is less than three");

will result:

[INFO]  (MyTest) checks: two is less than three
  • and the following code:
RTF_TEST_CHECK(2==3, "two is equal to three");

will result:

[FAIL]  (MyTest) checks: two is equal to three

from robot-testing-framework.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.