Skip to content

Commit

Permalink
Merge branch 'release-v0.1'
Browse files Browse the repository at this point in the history
* Re-import TODO.md
* Fix installing documentation
* Remove uncov-gcov on uninstalling
* Squash database versions
* Name this version v0.1
  • Loading branch information
xaizek committed Jan 9, 2017
2 parents ff52bc8 + 0cea11c commit fbdeb60
Show file tree
Hide file tree
Showing 8 changed files with 39 additions and 67 deletions.
11 changes: 6 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -110,13 +110,14 @@ self-coverage: UNCOV_PREFIX := $(out_dir)/
self-coverage: GCOV_PREFIX := ./
self-coverage: coverage

man: $(out_dir)/docs/uncov.1
man: docs/uncov.1
# the next target doesn't depend on $(wildcard docs/*.md) to make pandoc
# optional
$(out_dir)/docs/uncov.1: force | $(out_dir)/docs
docs/uncov.1: force | $(out_dir)/docs
pandoc -V title=uncov \
-V section=1 \
-V app=uncov \
-V footer="uncov v0.1" \
-V date="$$(date +'%B %d, %Y')" \
-V author='xaizek <[email protected]>' \
-s -o $@ $(sort $(wildcard docs/*.md))
Expand All @@ -139,11 +140,11 @@ check: $(target) $(out_dir)/tests/tests reset-coverage

install: release
$(INSTALL) -t $(DESTDIR)/usr/bin/ $(bin) uncov-gcov
$(INSTALL) -m 644 $(out_dir)/docs/uncov.1 \
$(DESTDIR)/usr/share/man/man1/uncov.1
$(INSTALL) -m 644 docs/uncov.1 $(DESTDIR)/usr/share/man/man1/uncov.1

uninstall:
$(RM) $(DESTDIR)/usr/bin/$(bin_name) $(DESTDIR)/usr/share/man/man1/uncov.1
$(RM) $(DESTDIR)/usr/bin/$(bin_name) $(DESTDIR)/usr/bin/uncov-gcov \
$(DESTDIR)/usr/share/man/man1/uncov.1

# work around parenthesis warning in tests somehow caused by ccache
$(out_dir)/tests/tests: EXTRA_CXXFLAGS += -Wno-error=parentheses -Itests/
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
**uncov**, _2016 – 2017_
**uncov**, _v0.1_, _2016 – 2017_

_This file last updated on 09 January, 2017_

Expand Down
18 changes: 18 additions & 0 deletions TODO.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,14 @@ Functions to use:
- `git_commit_parent_id()`
- `git_commit_parentcount()`

## Consider different path sorting. ##

| ID | Status | Type |
|------|-------------|----------|
| BSY | undecided | change |

The one which puts contents of child above contents of current one.

## @branch notation to lookup the latest build on that branch. ##

| ID | Status | Type |
Expand Down Expand Up @@ -161,6 +169,16 @@ Another suitable place is separate table in the database.

And might need a global one at some point too.

Implementation could be:

1. Abstract `*Settings` class per unit that needs settings (`FileComparator`,
`FilePrinter`, etc.).
2. A way to set pointer (wrapped in `std::shared<>`) for each such unit (a
static member of that abstract class, separate function or could be a
parameter).
3. One `Settings` class (in `main.cpp` probably) that implements all those
interfaces and is then set used by all units.

## Maybe introduce range syntax to specify two builds. ##

| ID | Status | Type |
Expand Down
2 changes: 1 addition & 1 deletion docs/uncov.1
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
.\" Automatically generated by Pandoc 1.17.0.3
.\"
.TH "uncov" "1" "January 08, 2017" "" ""
.TH "uncov" "1" "January 09, 2017" "uncov v0.1" ""
.hy
.SH NAME
.PP
Expand Down
63 changes: 5 additions & 58 deletions src/BuildHistory.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ static void updateDBSchema(DB &db, int fromVersion);
/**
* @brief Current database scheme version.
*/
const int AppDBVersion = 3;
const int AppDBVersion = 1;

File::File(std::string path, std::string hash, std::vector<int> coverage)
: path(std::move(path)), hash(std::move(hash)),
Expand Down Expand Up @@ -310,8 +310,10 @@ updateDBSchema(DB &db, int fromVersion)
buildid INTEGER,
vcsref TEXT NOT NULL,
vcsrefname TEXT NOT NULL,
covered INTEGER,
uncovered INTEGER,
covered INTEGER NOT NULL,
missed INTEGER NOT NULL,
timestamp INTEGER NOT NULL
DEFAULT (CAST(strftime('%s', 'now') AS INT)),
PRIMARY KEY (buildid)
)
Expand All @@ -337,61 +339,6 @@ updateDBSchema(DB &db, int fromVersion)
)
)");
// Fall through.
case 1:
db.execute(R"(
CREATE TABLE builds_new (
buildid INTEGER,
vcsref TEXT NOT NULL,
vcsrefname TEXT NOT NULL,
covered INTEGER NOT NULL,
uncovered INTEGER NOT NULL,
timestamp INTEGER NOT NULL
DEFAULT (CAST(strftime('%s', 'now') AS INT)),
PRIMARY KEY (buildid)
)
)");

for (std::tuple<int, std::string, std::string, int, int> vals :
db.queryAll("SELECT buildid, vcsref, vcsrefname, "
"covered, uncovered "
"FROM builds")) {
db.execute("INSERT INTO builds_new (buildid, vcsref, "
"vcsrefname, covered, "
"uncovered) "
"VALUES (:buildid, :ref, :refname, :covered, "
":uncovered)",
{ ":buildid"_b = std::get<0>(vals),
":ref"_b = std::get<1>(vals),
":refname"_b = std::get<2>(vals),
":covered"_b = std::get<3>(vals),
":uncovered"_b = std::get<4>(vals) });
}

db.execute("DROP TABLE builds");
db.execute("ALTER TABLE builds_new RENAME TO builds");
// Fall through.
case 2:
db.execute(R"(
CREATE TABLE builds_new (
buildid INTEGER,
vcsref TEXT NOT NULL,
vcsrefname TEXT NOT NULL,
covered INTEGER NOT NULL,
missed INTEGER NOT NULL,
timestamp INTEGER NOT NULL
DEFAULT (CAST(strftime('%s', 'now') AS INT)),
PRIMARY KEY (buildid)
)
)");
db.execute("INSERT INTO builds_new (buildid, vcsref, vcsrefname, "
"covered, missed) "
"SELECT buildid, vcsref, vcsrefname, covered, uncovered "
"FROM builds");
db.execute("DROP TABLE builds");
db.execute("ALTER TABLE builds_new RENAME TO builds");
// Fall through.
case AppDBVersion:
break;
}
Expand Down
2 changes: 1 addition & 1 deletion src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ main(int argc, char *argv[])
}

if (invocation.shouldPrintVersion()) {
std::cout << "uncov\n";
std::cout << "uncov v0.1\n";
return EXIT_SUCCESS;
}

Expand Down
Binary file modified tests/test-repo/_git/uncov.sqlite
Binary file not shown.
8 changes: 7 additions & 1 deletion uncov-gcov
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,9 @@ _SKIP_DIRS = set(['.git', '.hg', '.svn', 'deps'])


def create_args(params):
parser = argparse.ArgumentParser('uncov')
parser = argparse.ArgumentParser('uncov-gcov')
parser.add_argument('-v', '--version', action='store_true',
help='print version information')
parser.add_argument('--verbose', action='store_true',
help='print verbose messages')
parser.add_argument('--dryrun', action='store_true',
Expand Down Expand Up @@ -494,6 +496,10 @@ def run():

args = create_args(sys.argv[1:])

if args.version:
print('uncov-gcov v0.1')
exit(0)

if args.verbose:
print('encodings: {}'.format(args.encodings))

Expand Down

0 comments on commit fbdeb60

Please sign in to comment.