Skip to content

Commit fbdeb60

Browse files
committed
Merge branch 'release-v0.1'
* Re-import TODO.md * Fix installing documentation * Remove uncov-gcov on uninstalling * Squash database versions * Name this version v0.1
2 parents ff52bc8 + 0cea11c commit fbdeb60

File tree

8 files changed

+39
-67
lines changed

8 files changed

+39
-67
lines changed

Makefile

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -110,13 +110,14 @@ self-coverage: UNCOV_PREFIX := $(out_dir)/
110110
self-coverage: GCOV_PREFIX := ./
111111
self-coverage: coverage
112112

113-
man: $(out_dir)/docs/uncov.1
113+
man: docs/uncov.1
114114
# the next target doesn't depend on $(wildcard docs/*.md) to make pandoc
115115
# optional
116-
$(out_dir)/docs/uncov.1: force | $(out_dir)/docs
116+
docs/uncov.1: force | $(out_dir)/docs
117117
pandoc -V title=uncov \
118118
-V section=1 \
119119
-V app=uncov \
120+
-V footer="uncov v0.1" \
120121
-V date="$$(date +'%B %d, %Y')" \
121122
-V author='xaizek <xaizek@openmailbox.org>' \
122123
-s -o $@ $(sort $(wildcard docs/*.md))
@@ -139,11 +140,11 @@ check: $(target) $(out_dir)/tests/tests reset-coverage
139140

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

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

148149
# work around parenthesis warning in tests somehow caused by ccache
149150
$(out_dir)/tests/tests: EXTRA_CXXFLAGS += -Wno-error=parentheses -Itests/

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
**uncov**, _2016 – 2017_
1+
**uncov**, _v0.1_, _2016 – 2017_
22

33
_This file last updated on 09 January, 2017_
44

TODO.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,14 @@ Functions to use:
4949
- `git_commit_parent_id()`
5050
- `git_commit_parentcount()`
5151

52+
## Consider different path sorting. ##
53+
54+
| ID | Status | Type |
55+
|------|-------------|----------|
56+
| BSY | undecided | change |
57+
58+
The one which puts contents of child above contents of current one.
59+
5260
## @branch notation to lookup the latest build on that branch. ##
5361

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

162170
And might need a global one at some point too.
163171

172+
Implementation could be:
173+
174+
1. Abstract `*Settings` class per unit that needs settings (`FileComparator`,
175+
`FilePrinter`, etc.).
176+
2. A way to set pointer (wrapped in `std::shared<>`) for each such unit (a
177+
static member of that abstract class, separate function or could be a
178+
parameter).
179+
3. One `Settings` class (in `main.cpp` probably) that implements all those
180+
interfaces and is then set used by all units.
181+
164182
## Maybe introduce range syntax to specify two builds. ##
165183

166184
| ID | Status | Type |

docs/uncov.1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
.\" Automatically generated by Pandoc 1.17.0.3
22
.\"
3-
.TH "uncov" "1" "January 08, 2017" "" ""
3+
.TH "uncov" "1" "January 09, 2017" "uncov v0.1" ""
44
.hy
55
.SH NAME
66
.PP

src/BuildHistory.cpp

Lines changed: 5 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ static void updateDBSchema(DB &db, int fromVersion);
3737
/**
3838
* @brief Current database scheme version.
3939
*/
40-
const int AppDBVersion = 3;
40+
const int AppDBVersion = 1;
4141

4242
File::File(std::string path, std::string hash, std::vector<int> coverage)
4343
: path(std::move(path)), hash(std::move(hash)),
@@ -310,8 +310,10 @@ updateDBSchema(DB &db, int fromVersion)
310310
buildid INTEGER,
311311
vcsref TEXT NOT NULL,
312312
vcsrefname TEXT NOT NULL,
313-
covered INTEGER,
314-
uncovered INTEGER,
313+
covered INTEGER NOT NULL,
314+
missed INTEGER NOT NULL,
315+
timestamp INTEGER NOT NULL
316+
DEFAULT (CAST(strftime('%s', 'now') AS INT)),
315317
316318
PRIMARY KEY (buildid)
317319
)
@@ -337,61 +339,6 @@ updateDBSchema(DB &db, int fromVersion)
337339
)
338340
)");
339341
// Fall through.
340-
case 1:
341-
db.execute(R"(
342-
CREATE TABLE builds_new (
343-
buildid INTEGER,
344-
vcsref TEXT NOT NULL,
345-
vcsrefname TEXT NOT NULL,
346-
covered INTEGER NOT NULL,
347-
uncovered INTEGER NOT NULL,
348-
timestamp INTEGER NOT NULL
349-
DEFAULT (CAST(strftime('%s', 'now') AS INT)),
350-
351-
PRIMARY KEY (buildid)
352-
)
353-
)");
354-
355-
for (std::tuple<int, std::string, std::string, int, int> vals :
356-
db.queryAll("SELECT buildid, vcsref, vcsrefname, "
357-
"covered, uncovered "
358-
"FROM builds")) {
359-
db.execute("INSERT INTO builds_new (buildid, vcsref, "
360-
"vcsrefname, covered, "
361-
"uncovered) "
362-
"VALUES (:buildid, :ref, :refname, :covered, "
363-
":uncovered)",
364-
{ ":buildid"_b = std::get<0>(vals),
365-
":ref"_b = std::get<1>(vals),
366-
":refname"_b = std::get<2>(vals),
367-
":covered"_b = std::get<3>(vals),
368-
":uncovered"_b = std::get<4>(vals) });
369-
}
370-
371-
db.execute("DROP TABLE builds");
372-
db.execute("ALTER TABLE builds_new RENAME TO builds");
373-
// Fall through.
374-
case 2:
375-
db.execute(R"(
376-
CREATE TABLE builds_new (
377-
buildid INTEGER,
378-
vcsref TEXT NOT NULL,
379-
vcsrefname TEXT NOT NULL,
380-
covered INTEGER NOT NULL,
381-
missed INTEGER NOT NULL,
382-
timestamp INTEGER NOT NULL
383-
DEFAULT (CAST(strftime('%s', 'now') AS INT)),
384-
385-
PRIMARY KEY (buildid)
386-
)
387-
)");
388-
db.execute("INSERT INTO builds_new (buildid, vcsref, vcsrefname, "
389-
"covered, missed) "
390-
"SELECT buildid, vcsref, vcsrefname, covered, uncovered "
391-
"FROM builds");
392-
db.execute("DROP TABLE builds");
393-
db.execute("ALTER TABLE builds_new RENAME TO builds");
394-
// Fall through.
395342
case AppDBVersion:
396343
break;
397344
}

src/main.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ main(int argc, char *argv[])
5757
}
5858

5959
if (invocation.shouldPrintVersion()) {
60-
std::cout << "uncov\n";
60+
std::cout << "uncov v0.1\n";
6161
return EXIT_SUCCESS;
6262
}
6363

tests/test-repo/_git/uncov.sqlite

0 Bytes
Binary file not shown.

uncov-gcov

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,9 @@ _SKIP_DIRS = set(['.git', '.hg', '.svn', 'deps'])
4949

5050

5151
def create_args(params):
52-
parser = argparse.ArgumentParser('uncov')
52+
parser = argparse.ArgumentParser('uncov-gcov')
53+
parser.add_argument('-v', '--version', action='store_true',
54+
help='print version information')
5355
parser.add_argument('--verbose', action='store_true',
5456
help='print verbose messages')
5557
parser.add_argument('--dryrun', action='store_true',
@@ -494,6 +496,10 @@ def run():
494496

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

499+
if args.version:
500+
print('uncov-gcov v0.1')
501+
exit(0)
502+
497503
if args.verbose:
498504
print('encodings: {}'.format(args.encodings))
499505

0 commit comments

Comments
 (0)