如何在eclipse PDT中显示PHPUnit的测试覆盖率结果?

时间:2017-10-19 17:54:08

标签: php eclipse eclipse-pdt

我在eclipse中使用PDT来开发PHP应用程序。我将PHPUnit测试添加到项目中,并与之完全集成。现在,我正在寻找一种在项目中添加测试覆盖率检查的方法。我为PHPUnit测试添加了以下配置:

// Type your code here, or load an example.
#include <type_traits>

template<int ...>
struct u_list {};

template<char ...>
struct c_list {};

template<int, char >
struct foo {};

template<class ...>
struct bar {};

using int_vals = u_list<1, 5, 7>;
using char_vals = c_list<-3, 3>;

template<class... Args> struct type_list{
    template<class> struct make_concat;
    template<class ...Xs>
    struct make_concat<type_list<Xs...>>{
        using type = type_list<Args...,Xs...>;
    };
    template<class T>
    using concat = typename make_concat<T>::type;
    template<template<class...>class TT>
    using applied_to = TT<Args...>;
};

template<
         template<auto,auto> class C
        ,class X,class Y,class Yit=Y>
struct cart_prod;
template<template<auto,auto> class C,
         template<auto...> class Xt,
         template<auto...> class Yt,
         class Yit,
         auto Xi,auto...Xis,auto Yi,auto...Yis>
struct cart_prod<C,Xt<Xi,Xis...>,Yt<Yi,Yis...>,Yit>{
    using type = typename type_list<class C<Xi,Yi>>
       ::template concat<typename cart_prod<C,Xt<Xi,Xis...>,Yt<Yis...>,Yit>::type>;
};
template<template<auto,auto> class C,
         template<auto...> class Xt,
         template<auto...> class Yt,
         class Yit,
         auto Xi,auto...Xis,auto Yi>
struct cart_prod<C,Xt<Xi,Xis...>,Yt<Yi>,Yit>{
    using type = typename type_list<class C<Xi,Yi>>
       ::template concat<typename cart_prod<C,Xt<Xis...>,Yit,Yit>::type>;
};
template<template<auto,auto> class C,
         template<auto...> class Xt,
         template<auto...> class Yt,
         class Yit,
         auto Xi,auto Yi>
struct cart_prod<C,Xt<Xi>,Yt<Yi>,Yit>{
    using type = type_list<class C<Xi,Yi>>;
};


using result_t = cart_prod<foo,int_vals,char_vals>::type::applied_to<bar>;
using ref_t = bar<
    foo<1, -3>, foo<1, 3>,
    foo<5, -3>, foo<5, 3>,
    foo<7, -3>, foo<7, 3>
>;

static_assert(std::is_same<result_t, ref_t >::value, "");

生成了覆盖xml文件,但很难探索结果。

是否有任何插件可以在eclipse视图中显示结果?

1 个答案:

答案 0 :(得分:1)

我倾向于使用HTML输出......

<logging>
    <log type="coverage-html" target="./log/codeCoverage" charset="UTF-8"
        yui="true" highlight="true"
        lowUpperBound="50" highLowerBound="80"/>
</logging>

您可以在浏览器中打开输出。