Skip to content

Abort on fail not working #150

@hl037

Description

@hl037

I tried to run this unit test (ttt.hpp):

#include <cxxtest/TestSuite.h>

class TestT : public CxxTest::TestSuite{
public:
  void test_t1(){
    TS_ASSERT_EQUALS(0,1);
  }
  void test_t2(){
    TS_ASSERT_EQUALS(0,1);
  }
  void test_t3(){
    TS_ASSERT_EQUALS(0,1);
  }
  void test_t4(){
    TS_ASSERT_EQUALS(0,1);
  }
  
};

by executing :

cxxtestgen --error-printer --have-eh --abort-on-fail -o testrunner_abort.cpp ttt.hpp
g++ -O0 testrunner_abort.cpp -o aa.out
./a.out

but It does not abort on any fail as the documentation says :

Running cxxtest tests (4 tests)
In TestT::test_t1:
ttt.hpp:6: Error: Expected (0 == 1), found (0 != 1)
In TestT::test_t2:
ttt.hpp:9: Error: Expected (0 == 1), found (0 != 1)
In TestT::test_t3:
ttt.hpp:12: Error: Expected (0 == 1), found (0 != 1)
In TestT::test_t4:
ttt.hpp:15: Error: Expected (0 == 1), found (0 != 1)
Failed 4 and Skipped 0 of 4 tests
Success rate: 0%

(I also tried to exec it with gdb and nothing is reported, the program exit normally with only the exit code non zero, but nothing about an abort...)

This may be caused by the "do nothing" at this line : https://github.com/CxxTest/cxxtest/blob/master/cxxtest/RealDescriptions.cpp#L122

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions