xaizek / uncov (License: AGPLv3+) (since 2018-12-07)
Uncov(er) is a tool that collects and processes code coverage reports.
Commit 35ee2f3b9ceacb579500b02507bff5869f72a305

Accept reference with spaces in it by new subcmd
Author: xaizek
Author date (UTC): 2018-11-19 17:36
Committer name: xaizek
Committer date (UTC): 2018-11-19 17:38
Parent(s): 02c8703a2cb367d840cc4d68497c2dd4c13203f8
Signing key: 99DC5E4DB05F6BE2
Tree: f6b1034026efdcf0ef054ae38e8c2d34d13a7096
File Lines added Lines deleted
src/sub_commands.cpp 2 2
tests/sub_commands.cpp 14 0
File src/sub_commands.cpp changed (mode: 100644) (index ef1fb1e..7c58cd0)
... ... private:
708 708 const std::vector<std::string> &/*args*/) override const std::vector<std::string> &/*args*/) override
709 709 { {
710 710 std::string ref, refName; std::string ref, refName;
711 if (!(std::cin >> ref)) {
711 if (!std::getline(std::cin, ref)) {
712 712 std::cerr << "Invalid input format: failed to read reference\n"; std::cerr << "Invalid input format: failed to read reference\n";
713 713 error(); error();
714 714 return; return;
715 715 } }
716 if (!(std::cin >> refName)) {
716 if (!std::getline(std::cin, refName)) {
717 717 std::cerr << "Invalid input format: failed to read reference " std::cerr << "Invalid input format: failed to read reference "
718 718 "name\n"; "name\n";
719 719 error(); error();
File tests/sub_commands.cpp changed (mode: 100644) (index 73ca3ad..3699987)
... ... TEST_CASE("New creates new builds", "[subcommands][new-subcommand]")
506 506 BuildHistory bh(db); BuildHistory bh(db);
507 507 StreamCapture coutCapture(std::cout), cerrCapture(std::cerr); StreamCapture coutCapture(std::cout), cerrCapture(std::cerr);
508 508
509 SECTION("Reference name can contain spaces")
510 {
511 auto sizeWas = bh.getBuilds().size();
512 StreamSubstitute cinSubst(std::cin,
513 "8e354da4df664b71e06c764feb29a20d64351a01\n"
514 "WIP on master\n");
515 CHECK(getCmd("new")->exec(getSettings(), bh, repo, "new",
516 {}) == EXIT_SUCCESS);
517 REQUIRE(bh.getBuilds().size() == sizeWas + 1);
518 REQUIRE(bh.getBuilds().back().getPaths() == vs({}));
519
520 CHECK(cerrCapture.get() == std::string());
521 }
522
509 523 SECTION("File missing from commit is just skipped") SECTION("File missing from commit is just skipped")
510 524 { {
511 525 auto sizeWas = bh.getBuilds().size(); auto sizeWas = bh.getBuilds().size();
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