Skip to content

Commit

Permalink
Merge branch '0.21.todo' into feature/moderation_flag
Browse files Browse the repository at this point in the history
  • Loading branch information
andyoknen authored Apr 8, 2022
2 parents 7842673 + 21afd5f commit b8c1abf
Show file tree
Hide file tree
Showing 1,542 changed files with 257,192 additions and 109,944 deletions.
6 changes: 3 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
cmake_minimum_required(VERSION 3.15)

set(_CLIENT_VERSION_MAJOR 0)
set(_CLIENT_VERSION_MINOR 20)
set(_CLIENT_VERSION_REVISION 19)
set(_CLIENT_VERSION_MINOR 21)
set(_CLIENT_VERSION_REVISION 0)
set(_CLIENT_VERSION_BUILD 0)
set(_CLIENT_VERSION_IS_RELEASE false)
set(_COPYRIGHT_YEAR 2022)
Expand All @@ -29,7 +29,7 @@ add_compile_definitions(CLIENT_VERSION_MAJOR=${_CLIENT_VERSION_MAJOR}
COPYRIGHT_HOLDERS_FINAL=${_COPYRIGHT_HOLDERS_FINAL}
HOMEPAGE=${_HOMEPAGE})

# TODO missing bug report url
# TODO (build): missing bug report url
project (
Pocketnet-Core
VERSION ${_CLIENT_VERSION_MAJOR}.${_CLIENT_VERSION_MINOR}.${_CLIENT_VERSION_REVISION}
Expand Down
103 changes: 83 additions & 20 deletions Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.

# Pattern rule to print variables, e.g. make print-top_srcdir
print-%:
@echo $* = $($*)

ACLOCAL_AMFLAGS = -I build-aux/m4
SUBDIRS = src
if ENABLE_MAN
Expand All @@ -19,6 +23,8 @@ endif
POCKETCOIND_BIN=$(top_builddir)/src/$(POCKETCOIN_DAEMON_NAME)$(EXEEXT)
POCKETCOIN_QT_BIN=$(top_builddir)/src/qt/$(POCKETCOIN_GUI_NAME)$(EXEEXT)
POCKETCOIN_CLI_BIN=$(top_builddir)/src/$(POCKETCOIN_CLI_NAME)$(EXEEXT)
POCKETCOIN_TX_BIN=$(top_builddir)/src/$(POCKETCOIN_TX_NAME)$(EXEEXT)
# POCKETCOIN_WALLET_BIN=$(top_builddir)/src/$(POCKETCOIN_WALLET_TOOL_NAME)$(EXEEXT)
POCKETCOIN_WIN_INSTALLER=$(PACKAGE)_$(PACKAGE_VERSION)_win_x64_setup.exe
POCKETCOIN_LINUX_INSTALLER = $(PACKAGE)_$(PACKAGE_VERSION)_linux_x64
POCKETCOIN_LINUX_INSTALLER_NAME = $(PACKAGE)_$(PACKAGE_VERSION)_linux_x64
Expand All @@ -37,14 +43,12 @@ OSX_DEPLOY_SCRIPT=$(top_srcdir)/contrib/macdeploy/macdeployqtplus
OSX_FANCY_PLIST=$(top_srcdir)/contrib/macdeploy/fancy.plist
OSX_INSTALLER_ICONS=$(top_srcdir)/src/qt/res/icons/pocketcoin.icns
OSX_PLIST=$(top_builddir)/share/qt/Info.plist #not installed
OSX_QT_TRANSLATIONS = da,de,es,hu,ru,uk,zh_CN,zh_TW

DIST_DOCS = $(wildcard doc/*.md) $(wildcard doc/release-notes/*.md)
DIST_CONTRIB = $(top_srcdir)/contrib/pocketcoin-cli.bash-completion \
$(top_srcdir)/contrib/pocketcoin-tx.bash-completion \
$(top_srcdir)/contrib/pocketcoind.bash-completion \
$(top_srcdir)/contrib/init \
$(top_srcdir)/contrib/install_db4.sh
OSX_QT_TRANSLATIONS = ar,bg,ca,cs,da,de,es,fa,fi,fr,gd,gl,he,hu,it,ja,ko,lt,lv,pl,pt,ru,sk,sl,sv,uk,zh_CN,zh_TW

DIST_CONTRIB = \
$(top_srcdir)/contrib/linearize/linearize-data.py \
$(top_srcdir)/contrib/linearize/linearize-hashes.py

DIST_SHARE = \
$(top_srcdir)/share/genbuild.sh \
$(top_srcdir)/share/rpcauth
Expand All @@ -63,20 +67,21 @@ OSX_PACKAGING = $(OSX_DEPLOY_SCRIPT) $(OSX_FANCY_PLIST) $(OSX_INSTALLER_ICONS) \
$(top_srcdir)/contrib/macdeploy/detached-sig-apply.sh \
$(top_srcdir)/contrib/macdeploy/detached-sig-create.sh

COVERAGE_INFO = baseline.info \
COVERAGE_INFO = $(COV_TOOL_WRAPPER) baseline.info \
test_pocketcoin_filtered.info total_coverage.info \
baseline_filtered.info functional_test.info functional_test_filtered.info \
test_pocketcoin_coverage.info test_pocketcoin.info
test_pocketcoin_coverage.info test_pocketcoin.info fuzz.info fuzz_filtered.info fuzz_coverage.info

dist-hook:
-$(GIT) archive --format=tar HEAD -- src/clientversion.cpp | $(AMTAR) -C $(top_distdir) -xf -

$(POCKETCOIN_WIN_INSTALLER): all-recursive
$(MKDIR_P) $(top_builddir)/release
STRIPPROG="$(STRIP)" $(INSTALL_STRIP_PROGRAM) $(POCKETCOIND_BIN) $(top_builddir)/release
STRIPPROG="$(STRIP)" $(INSTALL_STRIP_PROGRAM) $(POCKETCOIN_CLI_BIN) $(top_builddir)/release
STRIPPROG="$(STRIP)" $(INSTALL_STRIP_PROGRAM) $(POCKETCOIN_QT_BIN) $(top_builddir)/release
@test -f $(MAKENSIS) && $(MAKENSIS) -V2 $(top_builddir)/share/setup.nsi || \
STRIPPROG="$(STRIP)" $(INSTALL_STRIP_PROGRAM) $(POCKETCOIN_CLI_BIN) $(top_builddir)/release
STRIPPROG="$(STRIP)" $(INSTALL_STRIP_PROGRAM) $(POCKETCOIN_TX_BIN) $(top_builddir)/release
@test -f $(MAKENSIS) && echo 'OutFile "$@"' | cat $(top_builddir)/share/setup.nsi - | $(MAKENSIS) -V2 - || \
echo error: could not build $@
@echo built $@

Expand All @@ -101,7 +106,7 @@ $(OSX_APP)/Contents/PkgInfo:

$(OSX_APP)/Contents/Resources/empty.lproj:
$(MKDIR_P) $(@D)
@touch $@
@touch $@

$(OSX_APP)/Contents/Info.plist: $(OSX_PLIST)
$(MKDIR_P) $(@D)
Expand Down Expand Up @@ -187,16 +192,48 @@ $(POCKETCOIND_BIN): FORCE
$(POCKETCOIN_CLI_BIN): FORCE
$(MAKE) -C src $(@F)

if USE_LCOV
LCOV_FILTER_PATTERN=-p "/usr/include/" -p "src/leveldb/" -p "src/bench/" -p "src/univalue" -p "src/crypto/ctaes" -p "src/secp256k1"
$(POCKETCOIN_TX_BIN): FORCE
$(MAKE) -C src $(@F)

# $(POCKETCOIN_WALLET_BIN): FORCE
# $(MAKE) -C src $(@F)

baseline.info:
if USE_LCOV
LCOV_FILTER_PATTERN = \
-p "/usr/local/" \
-p "/usr/include/" \
-p "/usr/lib/" \
-p "/usr/lib64/" \
-p "src/leveldb/" \
-p "src/crc32c/" \
-p "src/bench/" \
-p "src/univalue" \
-p "src/crypto/ctaes" \
-p "src/secp256k1" \
-p "depends"

DIR_FUZZ_SEED_CORPUS ?= qa-assets/fuzz_seed_corpus

$(COV_TOOL_WRAPPER):
@echo 'exec $(COV_TOOL) "$$@"' > $(COV_TOOL_WRAPPER)
@chmod +x $(COV_TOOL_WRAPPER)

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

baseline_filtered.info: baseline.info
$(abs_builddir)/contrib/filter-lcov.py $(LCOV_FILTER_PATTERN) $< $@
$(LCOV) -a $@ $(LCOV_OPTS) -o $@

fuzz.info: baseline_filtered.info
@TIMEOUT=15 test/fuzz/test_runner.py $(DIR_FUZZ_SEED_CORPUS) -l DEBUG
$(LCOV) -c $(LCOV_OPTS) -d $(abs_builddir)/src --t fuzz-tests -o $@
$(LCOV) -z $(LCOV_OPTS) -d $(abs_builddir)/src

fuzz_filtered.info: fuzz.info
$(abs_builddir)/contrib/filter-lcov.py $(LCOV_FILTER_PATTERN) $< $@
$(LCOV) -a $@ $(LCOV_OPTS) -o $@

test_pocketcoin.info: baseline_filtered.info
$(MAKE) -C src/ check
$(LCOV) -c $(LCOV_OPTS) -d $(abs_builddir)/src -t test_pocketcoin -o $@
Expand All @@ -207,20 +244,27 @@ test_pocketcoin_filtered.info: test_pocketcoin.info
$(LCOV) -a $@ $(LCOV_OPTS) -o $@

functional_test.info: test_pocketcoin_filtered.info
-@TIMEOUT=15 test/functional/test_runner.py $(EXTENDED_FUNCTIONAL_TESTS)
@TIMEOUT=15 test/functional/test_runner.py $(EXTENDED_FUNCTIONAL_TESTS)
$(LCOV) -c $(LCOV_OPTS) -d $(abs_builddir)/src --t functional-tests -o $@
$(LCOV) -z $(LCOV_OPTS) -d $(abs_builddir)/src

functional_test_filtered.info: functional_test.info
$(abs_builddir)/contrib/filter-lcov.py $(LCOV_FILTER_PATTERN) $< $@
$(LCOV) -a $@ $(LCOV_OPTS) -o $@

fuzz_coverage.info: fuzz_filtered.info
$(LCOV) -a $(LCOV_OPTS) baseline_filtered.info -a fuzz_filtered.info -o $@ | $(GREP) "\%" | $(AWK) '{ print substr($$3,2,50) "/" $$5 }' > coverage_percent.txt

test_pocketcoin_coverage.info: baseline_filtered.info test_pocketcoin_filtered.info
$(LCOV) -a $(LCOV_OPTS) baseline_filtered.info -a test_pocketcoin_filtered.info -o $@

total_coverage.info: test_pocketcoin_filtered.info functional_test_filtered.info
$(LCOV) -a $(LCOV_OPTS) baseline_filtered.info -a test_pocketcoin_filtered.info -a functional_test_filtered.info -o $@ | $(GREP) "\%" | $(AWK) '{ print substr($$3,2,50) "/" $$5 }' > coverage_percent.txt

fuzz.coverage/.dirstamp: fuzz_coverage.info
$(GENHTML) -s $(LCOV_OPTS) $< -o $(@D)
@touch $@

test_pocketcoin.coverage/.dirstamp: test_pocketcoin_coverage.info
$(GENHTML) -s $(LCOV_OPTS) $< -o $(@D)
@touch $@
Expand All @@ -229,13 +273,19 @@ total.coverage/.dirstamp: total_coverage.info
$(GENHTML) -s $(LCOV_OPTS) $< -o $(@D)
@touch $@

cov_fuzz: fuzz.coverage/.dirstamp

cov: test_pocketcoin.coverage/.dirstamp total.coverage/.dirstamp

endif

dist_noinst_SCRIPTS = autogen.sh

EXTRA_DIST = $(DIST_SHARE) test/functional/test_runner.py test/functional $(DIST_CONTRIB) $(DIST_DOCS) $(WINDOWS_PACKAGING) $(OSX_PACKAGING) $(BIN_CHECKS)
EXTRA_DIST = $(DIST_SHARE) $(DIST_CONTRIB) $(WINDOWS_PACKAGING) $(OSX_PACKAGING) $(BIN_CHECKS)

EXTRA_DIST += \
test/functional \
test/fuzz

EXTRA_DIST += \
test/util/pocketcoin-util-test.py \
Expand Down Expand Up @@ -286,6 +336,8 @@ EXTRA_DIST += \
test/util/data/txcreatescript3.json \
test/util/data/txcreatescript4.hex \
test/util/data/txcreatescript4.json \
test/util/data/txcreatescript5.hex \
test/util/data/txcreatescript6.hex \
test/util/data/txcreatesignv1.hex \
test/util/data/txcreatesignv1.json \
test/util/data/txcreatesignv2.hex \
Expand Down Expand Up @@ -313,6 +365,17 @@ clean-docs:
rm -rf doc/doxygen

clean-local: clean-docs
rm -rf coverage_percent.txt test_pocketcoin.coverage/ total.coverage/ test/tmp/ cache/ $(OSX_APP)
rm -rf test/functional/__pycache__ test/functional/test_framework/__pycache__ test/cache
rm -rf coverage_percent.txt test_pocketcoin.coverage/ total.coverage/ fuzz.coverage/ test/tmp/ cache/ $(OSX_APP)
rm -rf test/functional/__pycache__ test/functional/test_framework/__pycache__ test/cache share/rpcauth/__pycache__
rm -rf osx_volname dist/ dpi36.background.tiff dpi72.background.tiff

test-security-check:
if TARGET_DARWIN
$(AM_V_at) $(PYTHON) $(top_srcdir)/contrib/devtools/test-security-check.py TestSecurityChecks.test_MACHO
endif
if TARGET_WINDOWS
$(AM_V_at) $(PYTHON) $(top_srcdir)/contrib/devtools/test-security-check.py TestSecurityChecks.test_PE
endif
if TARGET_LINUX
$(AM_V_at) $(PYTHON) $(top_srcdir)/contrib/devtools/test-security-check.py TestSecurityChecks.test_ELF
endif
Loading

0 comments on commit b8c1abf

Please sign in to comment.