Opened 7 years ago

Closed 4 years ago

#12095 closed Bugs (fixed)

disabling test with precondition leads to error

Reported by: Patrick Moran <patrick.a.moran@…> Owned by: Raffi Enficiaud
Milestone: Boost 1.68.0 Component: test
Version: Boost 1.60.0 Severity: Problem
Keywords: test precondition failure Cc:

Description

Minimal reproduction:

#define BOOST_TEST_MODULE repro
#include <boost/test/unit_test.hpp>
BOOST_AUTO_TEST_CASE(fail, *boost::unit_test::precondition([](boost::unit_test::test_unit_id){ return false; })) {}

Output (1.60.0 from source):

Running 1 test case...

*** Errors were detected in the test module "repro"; see standard output for details

Based on the documentation here: http://www.boost.org/doc/libs/1_60_0/libs/test/doc/html/boost_test/tests_organization/enabling.html I assumed that disabling a test with a precondition was not supposed to be erroneous (the example had two tests fail, and one that did not run because of a failed precondition. Alltogether, two (not three) errors were reported. Also, the message indicates that we should look at stdout, but stdout has nothing.

  • It doesn't require the predicate to be a lambda, that was just the shortest thing I could find for a small repro.
  • It doesn't depend on this being the only test case - adding another case doesn't change the behaviour

Change History (7)

comment:1 by Raffi Enficiaud, 6 years ago

Owner: changed from Gennadiy Rozental to Raffi Enficiaud
Status: newassigned

comment:2 by Raffi Enficiaud, 5 years ago

Milestone: To Be DeterminedBoost 1.66.0

In branch topic/12095-disabling-test-with-precondition-leads-to-error

comment:3 by Raffi Enficiaud, 5 years ago

Milestone: Boost 1.66.0Boost 1.67.0

comment:4 by Raffi Enficiaud, 4 years ago

Milestone: Boost 1.67.0Boost 1.68.0

comment:5 by Raffi Enficiaud, 4 years ago

Would you be able to test this branch?

comment:6 by Raffi Enficiaud, 4 years ago

In develop, rev 0b7d68b8ef014475148ab36e1123d0ba40e070b2

comment:7 by Raffi Enficiaud, 4 years ago

Resolution: fixed
Status: assignedclosed
Note: See TracTickets for help on using tickets.