Skip to content

Commit 9d49fbf

Browse files
authored
Merge pull request #3025 from PastaPastaPasta/backports-0.15-pr20
Backports 0.15 pr20
2 parents acab8c5 + 8b224e0 commit 9d49fbf

File tree

117 files changed

+1451
-751
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

117 files changed

+1451
-751
lines changed

Makefile.am

Lines changed: 22 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -59,10 +59,10 @@ OSX_PACKAGING = $(OSX_DEPLOY_SCRIPT) $(OSX_FANCY_PLIST) $(OSX_INSTALLER_ICONS) \
5959
$(top_srcdir)/contrib/macdeploy/detached-sig-apply.sh \
6060
$(top_srcdir)/contrib/macdeploy/detached-sig-create.sh
6161

62-
COVERAGE_INFO = baseline_filtered_combined.info baseline.info \
63-
leveldb_baseline.info test_dash_filtered.info total_coverage.info \
62+
COVERAGE_INFO = baseline.info \
63+
test_dash_filtered.info total_coverage.info \
6464
baseline_filtered.info functional_test.info functional_test_filtered.info \
65-
leveldb_baseline_filtered.info test_dash_coverage.info test_dash.info
65+
test_dash_coverage.info test_dash.info
6666

6767
dist-hook:
6868
-$(GIT) archive --format=tar HEAD -- src/clientversion.cpp | $(AMTAR) -C $(top_distdir) -xf -
@@ -166,52 +166,45 @@ $(BITCOIN_CLI_BIN): FORCE
166166
$(MAKE) -C src $(@F)
167167

168168
if USE_LCOV
169+
LCOV_FILTER_PATTERN=-p "/usr/include/" -p "src/leveldb/" -p "src/bench/" -p "src/univalue" -p "src/crypto/ctaes" -p "src/secp256k1"
169170

170171
baseline.info:
171172
$(LCOV) -c -i -d $(abs_builddir)/src -o $@
172173

173174
baseline_filtered.info: baseline.info
174-
$(LCOV) -r $< "/usr/include/*" -o $@
175+
$(abs_builddir)/contrib/filter-lcov.py $(LCOV_FILTER_PATTERN) $< $@
176+
$(LCOV) -a $@ $(LCOV_OPTS) -o $@
175177

176-
leveldb_baseline.info: baseline_filtered.info
177-
$(LCOV) -c -i -d $(abs_builddir)/src/leveldb -b $(abs_builddir)/src/leveldb -o $@
178-
179-
leveldb_baseline_filtered.info: leveldb_baseline.info
180-
$(LCOV) -r $< "/usr/include/*" -o $@
181-
182-
baseline_filtered_combined.info: leveldb_baseline_filtered.info baseline_filtered.info
183-
$(LCOV) -a leveldb_baseline_filtered.info -a baseline_filtered.info -o $@
184-
185-
test_dash.info: baseline_filtered_combined.info
178+
test_dash.info: baseline_filtered.info
186179
$(MAKE) -C src/ check
187-
$(LCOV) -c -d $(abs_builddir)/src -t test_dash -o $@
188-
$(LCOV) -z -d $(abs_builddir)/src
189-
$(LCOV) -z -d $(abs_builddir)/src/leveldb
180+
$(LCOV) -c $(LCOV_OPTS) -d $(abs_builddir)/src -t test_dash -o $@
181+
$(LCOV) -z $(LCOV_OPTS) -d $(abs_builddir)/src
190182

191183
test_dash_filtered.info: test_dash.info
192-
$(LCOV) -r $< "/usr/include/*" -o $@
184+
$(abs_builddir)/contrib/filter-lcov.py $(LCOV_FILTER_PATTERN) $< $@
185+
$(LCOV) -a $@ $(LCOV_OPTS) -o $@
193186

194187
functional_test.info: test_dash_filtered.info
195-
-@TIMEOUT=15 python test/functional/test_runner.py $(EXTENDED_FUNCTIONAL_TESTS)
196-
$(LCOV) -c -d $(abs_builddir)/src --t functional-tests -o $@
197-
$(LCOV) -z -d $(abs_builddir)/src
198-
$(LCOV) -z -d $(abs_builddir)/src/leveldb
188+
-@TIMEOUT=15 test/functional/test_runner.py $(EXTENDED_FUNCTIONAL_TESTS)
189+
$(LCOV) -c $(LCOV_OPTS) -d $(abs_builddir)/src --t functional-tests -o $@
190+
$(LCOV) -z $(LCOV_OPTS) -d $(abs_builddir)/src
199191

200192
functional_test_filtered.info: functional_test.info
201-
$(LCOV) -r $< "/usr/include/*" -o $@
193+
$(abs_builddir)/contrib/filter-lcov.py $(LCOV_FILTER_PATTERN) $< $@
194+
$(LCOV) -a $@ $(LCOV_OPTS) -o $@
202195

203-
test_dash_coverage.info: baseline_filtered_combined.info test_dash_filtered.info
204-
$(LCOV) -a baseline_filtered.info -a leveldb_baseline_filtered.info -a test_dash_filtered.info -o $@
196+
test_dash_coverage.info: baseline_filtered.info test_dash_filtered.info
197+
$(LCOV) -a $(LCOV_OPTS) baseline_filtered.info -a test_dash_filtered.info -o $@
205198

206-
total_coverage.info: baseline_filtered_combined.info test_dash_filtered.info functional_test_filtered.info
207-
$(LCOV) -a baseline_filtered.info -a leveldb_baseline_filtered.info -a test_dash_filtered.info -a functional_test_filtered.info -o $@ | $(GREP) "\%" | $(AWK) '{ print substr($$3,2,50) "/" $$5 }' > coverage_percent.txt
199+
total_coverage.info: test_dash_filtered.info functional_test_filtered.info
200+
$(LCOV) -a $(LCOV_OPTS) baseline_filtered.info -a test_dash_filtered.info -a functional_test_filtered.info -o $@ | $(GREP) "\%" | $(AWK) '{ print substr($$3,2,50) "/" $$5 }' > coverage_percent.txt
208201

209202
test_dash.coverage/.dirstamp: test_dash_coverage.info
210-
$(GENHTML) -s $< -o $(@D)
203+
$(GENHTML) -s $(LCOV_OPTS) $< -o $(@D)
211204
@touch $@
212205

213206
total.coverage/.dirstamp: total_coverage.info
214-
$(GENHTML) -s $< -o $(@D)
207+
$(GENHTML) -s $(LCOV_OPTS) $< -o $(@D)
215208
@touch $@
216209

217210
cov: test_dash.coverage/.dirstamp total.coverage/.dirstamp

configure.ac

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,12 @@ AC_ARG_ENABLE([lcov],
159159
[enable lcov testing (default is no)])],
160160
[use_lcov=yes],
161161
[use_lcov=no])
162+
163+
AC_ARG_ENABLE([lcov-branch-coverage],
164+
[AS_HELP_STRING([--enable-lcov-branch-coverage],
165+
[enable lcov testing branch coverage (default is no)])],
166+
[use_lcov_branch=yes],
167+
[use_lcov_branch=no])
162168

163169
AC_ARG_ENABLE([glibc-back-compat],
164170
[AS_HELP_STRING([--enable-glibc-back-compat],
@@ -486,6 +492,12 @@ if test x$use_lcov = xyes; then
486492
[AC_MSG_ERROR("lcov testing requested but --coverage linker flag does not work")])
487493
AX_CHECK_COMPILE_FLAG([--coverage],[CXXFLAGS="$CXXFLAGS --coverage"],
488494
[AC_MSG_ERROR("lcov testing requested but --coverage flag does not work")])
495+
AC_DEFINE(USE_COVERAGE, 1, [Define this symbol if coverage is enabled])
496+
CXXFLAGS="$CXXFLAGS -Og"
497+
fi
498+
499+
if test x$use_lcov_branch != xno; then
500+
AC_SUBST(LCOV_OPTS, "$LCOV_OPTS --rc lcov_branch_coverage=1")
489501
fi
490502

491503
dnl Check for endianness

contrib/devtools/check-doc.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
REGEX_ARG = re.compile(r'(?:map(?:Multi)?Args(?:\.count\(|\[)|Get(?:Bool)?Arg\()\"(\-[^\"]+?)\"')
2222
REGEX_DOC = re.compile(r'HelpMessageOpt\(\"(\-[^\"=]+?)(?:=|\")')
2323
# list unsupported, deprecated and duplicate args as they need no documentation
24-
SET_DOC_OPTIONAL = set(['-rpcssl', '-benchmark', '-h', '-help', '-socks', '-tor', '-debugnet', '-whitelistalwaysrelay', '-blockminsize', '-sendfreetransactions'])
24+
SET_DOC_OPTIONAL = set(['-rpcssl', '-benchmark', '-h', '-help', '-socks', '-tor', '-debugnet', '-whitelistalwaysrelay', '-blockminsize'])
2525

2626
def main():
2727
used = check_output(CMD_GREP_ARGS, shell=True, universal_newlines=True)

contrib/filter-lcov.py

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
#!/usr/bin/env python3
2+
3+
import argparse
4+
5+
parser = argparse.ArgumentParser(description='Remove the coverage data from a tracefile for all files matching the pattern.')
6+
parser.add_argument('--pattern', '-p', action='append', help='the pattern of files to remove', required=True)
7+
parser.add_argument('tracefile', help='the tracefile to remove the coverage data from')
8+
parser.add_argument('outfile', help='filename for the output to be written to')
9+
10+
args = parser.parse_args()
11+
tracefile = args.tracefile
12+
pattern = args.pattern
13+
outfile = args.outfile
14+
15+
in_remove = False
16+
with open(tracefile, 'r') as f:
17+
with open(outfile, 'w') as wf:
18+
for line in f:
19+
for p in pattern:
20+
if line.startswith("SF:") and p in line:
21+
in_remove = True
22+
if not in_remove:
23+
wf.write(line)
24+
if line == 'end_of_record\n':
25+
in_remove = False

contrib/verifybinaries/README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,14 @@ The script returns 0 if everything passes the checks. It returns 1 if either the
2626
./verify.sh bitcoin-core-0.13.0-rc3
2727
```
2828

29+
If you only want to download the binaries of certain platform, add the corresponding suffix, e.g.:
30+
31+
```sh
32+
./verify.sh bitcoin-core-0.11.2-osx
33+
./verify.sh 0.12.0-linux
34+
./verify.sh bitcoin-core-0.13.0-rc3-win64
35+
```
36+
2937
If you do not want to keep the downloaded binaries, specify anything as the second parameter.
3038

3139
```sh

contrib/verifybinaries/verify.sh

Lines changed: 38 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -42,13 +42,36 @@ if [ -n "$1" ]; then
4242
VERSION="$VERSIONPREFIX$1"
4343
fi
4444

45-
#now let's see if the version string contains "rc", and strip it off if it does
46-
# and simultaneously add RCSUBDIR to BASEDIR, where we will look for SIGNATUREFILENAME
47-
if [[ $VERSION == *"$RCVERSIONSTRING"* ]]; then
48-
BASEDIR="$BASEDIR${VERSION/%-$RCVERSIONSTRING*}/"
49-
BASEDIR="$BASEDIR$RCSUBDIR.$RCVERSIONSTRING${VERSION: -1}/"
45+
STRIPPEDLAST="${VERSION%-*}"
46+
47+
#now let's see if the version string contains "rc" or a platform name (e.g. "osx")
48+
if [[ "$STRIPPEDLAST-" == "$VERSIONPREFIX" ]]; then
49+
BASEDIR="$BASEDIR$VERSION/"
5050
else
51+
# let's examine the last part to see if it's rc and/or platform name
52+
STRIPPEDNEXTTOLAST="${STRIPPEDLAST%-*}"
53+
if [[ "$STRIPPEDNEXTTOLAST-" == "$VERSIONPREFIX" ]]; then
54+
55+
LASTSUFFIX="${VERSION##*-}"
56+
VERSION="$STRIPPEDLAST"
57+
58+
if [[ $LASTSUFFIX == *"$RCVERSIONSTRING"* ]]; then
59+
RCVERSION="$LASTSUFFIX"
60+
else
61+
PLATFORM="$LASTSUFFIX"
62+
fi
63+
64+
else
65+
RCVERSION="${STRIPPEDLAST##*-}"
66+
PLATFORM="${VERSION##*-}"
67+
68+
VERSION="$STRIPPEDNEXTTOLAST"
69+
fi
70+
5171
BASEDIR="$BASEDIR$VERSION/"
72+
if [[ $RCVERSION == *"$RCVERSIONSTRING"* ]]; then
73+
BASEDIR="$BASEDIR$RCSUBDIR.$RCVERSION/"
74+
fi
5275
fi
5376

5477
SIGNATUREFILE="$BASEDIR$SIGNATUREFILENAME"
@@ -92,12 +115,22 @@ if [ $RET -ne 0 ]; then
92115
exit "$RET"
93116
fi
94117

118+
if [ -n "$PLATFORM" ]; then
119+
grep $PLATFORM $TMPFILE > "$TMPFILE-plat"
120+
TMPFILESIZE=$(stat -c%s "$TMPFILE-plat")
121+
if [ $TMPFILESIZE -eq 0 ]; then
122+
echo "error: no files matched the platform specified" && exit 3
123+
fi
124+
mv "$TMPFILE-plat" $TMPFILE
125+
fi
126+
95127
#here we extract the filenames from the signature file
96128
FILES=$(awk '{print $2}' "$TMPFILE")
97129

98130
#and download these one by one
99131
for file in $FILES
100132
do
133+
echo "Downloading $file"
101134
wget --quiet -N "$BASEDIR$file"
102135
done
103136

depends/packages/expat.mk

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
package=expat
2-
$(package)_version=2.2.0
2+
$(package)_version=2.2.1
33
$(package)_download_path=https://downloads.sourceforge.net/project/expat/expat/$($(package)_version)
44
$(package)_file_name=$(package)-$($(package)_version).tar.bz2
5-
$(package)_sha256_hash=d9e50ff2d19b3538bd2127902a89987474e1a4db8e43a66a4d1a712ab9a504ff
5+
$(package)_sha256_hash=1868cadae4c82a018e361e2b2091de103cd820aaacb0d6cfa49bd2cd83978885
66

77
define $(package)_set_vars
88
$(package)_config_opts=--disable-static

doc/developer-notes.md

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ class Class
4646
return true;
4747
}
4848
}
49-
}
49+
} // namespace foo
5050
```
5151
5252
Doxygen comments
@@ -267,7 +267,7 @@ General C++
267267

268268
- Assertions should not have side-effects
269269

270-
- *Rationale*: Even though the source code is set to to refuse to compile
270+
- *Rationale*: Even though the source code is set to refuse to compile
271271
with assertions disabled, having side-effects in assertions is unexpected and
272272
makes the code harder to understand
273273

@@ -417,6 +417,21 @@ Source code organization
417417
418418
- *Rationale*: Avoids symbol conflicts
419419
420+
- Terminate namespaces with a comment (`// namespace mynamespace`). The comment
421+
should be placed on the same line as the brace closing the namespace, e.g.
422+
423+
```c++
424+
namespace mynamespace {
425+
...
426+
} // namespace mynamespace
427+
428+
namespace {
429+
...
430+
} // namespace
431+
```
432+
433+
- *Rationale*: Avoids confusion about the namespace context
434+
420435
GUI
421436
-----
422437

src/Makefile.qttest.include

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,8 @@ qt_test_test_dash_qt_SOURCES = \
5050
if ENABLE_WALLET
5151
qt_test_test_dash_qt_SOURCES += \
5252
qt/test/paymentservertests.cpp \
53-
qt/test/wallettests.cpp
53+
qt/test/wallettests.cpp \
54+
wallet/test/wallet_test_fixture.cpp
5455
endif
5556

5657
nodist_qt_test_test_dash_qt_SOURCES = $(TEST_QT_MOC_CPP)

0 commit comments

Comments
 (0)