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

Add two more format checks for new subcommand
Author: xaizek
Author date (UTC): 2018-11-19 15:42
Committer name: xaizek
Committer date (UTC): 2018-11-19 17:38
Parent(s): 6c5ae4154d1a234082f502a8ae59ca9d1dbd4ebb
Signing key: 99DC5E4DB05F6BE2
Tree: 5dc10e2610d1d1d275fcc92111d5489bb1d0ee8d
File Lines added Lines deleted
src/sub_commands.cpp 11 1
tests/sub_commands.cpp 15 0
File src/sub_commands.cpp changed (mode: 100644) (index 7bb942b..ef1fb1e)
... ... 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 std::cin >> ref >> refName;
711 if (!(std::cin >> ref)) {
712 std::cerr << "Invalid input format: failed to read reference\n";
713 error();
714 return;
715 }
716 if (!(std::cin >> refName)) {
717 std::cerr << "Invalid input format: failed to read reference "
718 "name\n";
719 error();
720 return;
721 }
712 722
713 723 const std::unordered_map<std::string, std::string> files = const std::unordered_map<std::string, std::string> files =
714 724 repo->listFiles(ref); repo->listFiles(ref);
File tests/sub_commands.cpp changed (mode: 100644) (index 1fe853b..73ca3ad)
... ... TEST_CASE("New handles input gracefully", "[subcommands][new-subcommand]")
440 440 BuildHistory bh(db); BuildHistory bh(db);
441 441 StreamCapture coutCapture(std::cout), cerrCapture(std::cerr); StreamCapture coutCapture(std::cout), cerrCapture(std::cerr);
442 442
443 SECTION("Empty input")
444 {
445 StreamSubstitute cinSubst(std::cin, "");
446 CHECK(getCmd("new")->exec(getSettings(), bh, repo, "new",
447 {}) == EXIT_FAILURE);
448 }
449
450 SECTION("No reference name")
451 {
452 StreamSubstitute cinSubst(std::cin,
453 "8e354da4df664b71e06c764feb29a20d64351a01\n");
454 CHECK(getCmd("new")->exec(getSettings(), bh, repo, "new",
455 {}) == EXIT_FAILURE);
456 }
457
443 458 SECTION("Missing hashsum") SECTION("Missing hashsum")
444 459 { {
445 460 StreamSubstitute cinSubst(std::cin, StreamSubstitute cinSubst(std::cin,
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