How to process Boost.Test output with Eclipse

后端 未结 3 857
别那么骄傲
别那么骄傲 2020-12-29 13:27

I\'m using Eclipse CDT and Boost.Test(with Boost.Build). I would like Eclipse to parse output of Boost.Test generated during by run of test suites during build.
Does an

3条回答
  •  隐瞒了意图╮
    2020-12-29 13:49

    I had the same problem of my IDE (gedit) not recognizing the output format of Boost.Test (which is not compatible with gnu and clang output for some reason).

    You can change the output format programmatically by sticking this in your test(s):

    #include
    struct gedit_config{
        struct formatter : boost::unit_test::output::compiler_log_formatter{
            void print_prefix(std::ostream& out, boost::unit_test::const_string file, std::size_t line){
                out<< file <<':'<< line <<": ";
            }
        };
        gedit_config(){boost::unit_test::unit_test_log.set_formatter(new formatter);}
    };
    BOOST_GLOBAL_FIXTURE(gedit_config);
    

    (original answer here: https://stackoverflow.com/a/64619245/225186)

提交回复
热议问题