xaizek / uncov (License: AGPLv3+) (since 2018-12-07)
Uncov(er) is a tool that collects and processes code coverage reports.
<root> / web / changes.ecpp (c432865ec131eb8bcc88c8470be8914eeed9916c) (3,712B) (mode 100644) [raw]
<!--

Copyright (C) 2017 xaizek <xaizek@posteo.net>

This file is part of uncov.

uncov is free software: you can redistribute it and/or modify
it under the terms of version 3 of the GNU Affero General Public License as
published by the Free Software Foundation.

uncov is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU Affero General Public License for more details.

You should have received a copy of the GNU Affero General Public License
along with uncov.  If not, see <http://www.gnu.org/licenses/>.

-->

<%pre>
    #include <boost/optional.hpp>

    #include "utils/strings.hpp"
    #include "BuildHistory.hpp"
    #include "listings.hpp"

    extern BuildHistory *globalBH;
</%pre>

<%cpp>
    const std::string buildIdStr = request.getArg("buildId");
    const int buildId = [&request, &buildIdStr]() {
        try {
            return std::stoi(buildIdStr);
        } catch (const std::exception &) {
            return 0;
        }
    }();
</%cpp>

<html>

<head>
    <title>
    Changes in build #<$ buildIdStr $> | uncov
    </title>

    <%include>web/header.ecpp</%include>

    <style>
    table {
        table-layout: fixed;
    }
    </style>
</head>

<body>
%   if (boost::optional<Build> build = globalBH->getBuild(buildId)) {

%   std::vector<std::string> buildInfo = describeBuild(globalBH, *build,
%                                                      !DoExtraAlign{},
%                                                      DoSpacing{});

    <div class="sidenav">
        <a href="/builds">All builds</a>
        <a class="branch" href="/branches/<$ buildInfo[5] $>">Current branch</a>
        <a href="/builds/<$ buildIdStr $>">Current build</a>
        <br/>
        <a class="action" href="/changes/<$ buildIdStr $>">Changed files</a>
    </div>

    <div class="rightbar">
    <div class="bargroup">
        <span class="barelem">Build <$$ buildInfo[0] $></span>
        <span class="barelem"><$$ buildInfo[1] $></br>
                              <small><$$ buildInfo[2] $></small></span>
        <span class="barelem"><$$ buildInfo[3] $></br>
                              <small><$$ buildInfo[4] $></small></span>
        <span class="barelem">
            <div class="tooltip">
                <span class="tooltipobj">
                    <a class="branch" href="/branches/<$ buildInfo[5] $>">
                        <$$ buildInfo[5] $>
                    </a>
                </span>
                <span class="tooltiptext">
                    <$$ buildInfo[6] $>
                </span>
            </div>
        </span>
    </div>
    <%include>web/footer.ecpp</%include>
    </div>

    <h3 class="title">
    List of files with changed coverage
    </h3>

    <table>
    <tr>
    <th>File</th>
    <th>Coverage</th>
    <th>C/R Lines</th>
    <th>Cov Change</th>
    <th>C/U/R Line Changes</th>
    </tr>

%   for (const std::vector<std::string> &row :
%        describeBuildFiles(globalBH, *build, std::string(), ListChangedOnly{},
%                           !ListDirectOnly{})) {
        <tr>
%       for (const std::string &cell : row) {
%           if (&cell != &row.front()) {
                <td><$$ cell $></td>
%               continue;
%           }

            <td>
                <a class="nav" href="/changes/<$ buildIdStr $>/<$ row.front() $>">
                    <$$ cell $>
                </a>
            </td>
%       }
        </tr>
%   }

    </table>

%   } else {
%   log_warn("Can't find requested build with ID: " + std::to_string(buildId));
    <h1>No such build</h1>
%   }

    </table>
</body>

</html>
Hints

Before first commit, do not forget to setup your git environment:
git config --global user.name "your_name_here"
git config --global user.email "your@email_here"

Clone this repository using HTTP(S):
git clone https://code.reversed.top/user/xaizek/uncov

Clone this repository using ssh (do not forget to upload a key first):
git clone ssh://rocketgit@code.reversed.top/user/xaizek/uncov

You are allowed to anonymously push to this repository.
This means that your pushed commits will automatically be transformed into a pull request:
... clone the repository ...
... make some changes and some commits ...
git push origin master