Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Default file name #218

Closed
diorcety opened this issue Apr 19, 2019 · 2 comments

Comments

@diorcety
Copy link

commented Apr 19, 2019

In the documentation it is written:

This format defaults its log level to General information and its default stream to a file named after master test suite

With the following example

#define BOOST_TEST_MODULE my master test suite name
#define BOOST_TEST_DYN_LINK
#include <boost/test/included/unit_test.hpp>

BOOST_AUTO_TEST_CASE( free_test_function )
{
  BOOST_TEST( true /* test assertion */ );
}

This is not true. The file is named Master_Test_Suite.xml. It seems that the streams are initialized before the call to init_unit_test (the file is already created when the debugger reachs the breakpoint in this function).

The workaround is to use the following code

#define BOOST_TEST_MODULE my master test suite name
#define BOOST_TEST_DYN_LINK
#define BOOST_TEST_NO_MAIN
#include <boost/test/included/unit_test.hpp>

BOOST_AUTO_TEST_CASE( free_test_function )
{
  BOOST_TEST( true /* test assertion */ );
}

int main(int argc, char *argv[]) {
    init_unit_test();
    return ::boost::unit_test::unit_test_main(init_unit_test, argc, argv);
}

@raffienficiaud raffienficiaud added this to the 1.71 milestone May 13, 2019

@raffienficiaud raffienficiaud added 1.71 and removed 1.71 labels May 13, 2019

@raffienficiaud

This comment has been minimized.

Copy link
Member

commented Jul 22, 2019

Fix in branch topic/GH-218-outstream-default-filename. It would be good if you can give a try.

raffienficiaud added a commit that referenced this issue Jul 27, 2019
Merge branch 'topic/GH-218-outstream-default-filename' into next-inte…
…rnal

* topic/GH-218-outstream-default-filename:
  Change log
  Master test suite name setup prior to all other setup

# Conflicts:
#	doc/closing_chapters/change_log.qbk
raffienficiaud added a commit that referenced this issue Jul 27, 2019
Merge branch 'topic/GH-218-outstream-default-filename' into next-inte…
…rnal

* topic/GH-218-outstream-default-filename:
  Change log
  Master test suite name setup prior to all other setup

# Conflicts:
#	doc/closing_chapters/change_log.qbk

@raffienficiaud raffienficiaud added develop and removed develop labels Aug 3, 2019

@raffienficiaud

This comment has been minimized.

Copy link
Member

commented Aug 5, 2019

It is now on master and should be part of 1.71 release. Cheers!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.