Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

24.0.1 - Pre-MWEB #900

Open
wants to merge 47 commits into
base: 24.x
Choose a base branch
from
Open
Changes from 1 commit
Commits
Show all changes
47 commits
Select commit Hold shift + click to select a range
3b72be2
Litecoin: Update README.md
DavidBurkett Mar 14, 2023
f9d5cc5
Litecoin: Add historical release notes
DavidBurkett Mar 14, 2023
4cbe858
Litecoin: Update seeds
DavidBurkett Mar 20, 2023
1ae770b
Litecoin: Update seeds 2
DavidBurkett Mar 20, 2023
162663f
Litecoin: Adjust chain parameters and version bits
DavidBurkett Mar 21, 2023
45b5dfc
Litecoin: PoW (Scrypt)
DavidBurkett Mar 21, 2023
2244410
Litecoin: Add Litecoin logos, icons, and splash screen
DavidBurkett Mar 21, 2023
4dd605a
Litecoin: Update trusted keys
DavidBurkett Mar 21, 2023
7c0abbe
Litecoin: Update windows codesigning cert
DavidBurkett Mar 21, 2023
90fafba
Litecoin: Branding: litecoin-cli
DavidBurkett Apr 11, 2023
0eac430
Litecoin: Branding: litecoin-tx
DavidBurkett Apr 11, 2023
a64ce3d
Litecoin: Branding: litecoin-util
DavidBurkett Apr 11, 2023
50dd257
Litecoin: Branding: litecoind & litecoin.conf
DavidBurkett Apr 11, 2023
99b443b
Litecoin: Branding: litecoin-node
DavidBurkett Apr 11, 2023
3ff930e
Litecoin: Branding: litecoin-wallet
DavidBurkett Apr 11, 2023
9067618
Litecoin: Branding: litecoin-gui
DavidBurkett Apr 11, 2023
ddf23e3
Litecoin: Branding: litecoin-chainstate
DavidBurkett Apr 11, 2023
c31ce71
Litecoin: Branding: test_litecoin
DavidBurkett Apr 11, 2023
13f59d4
Litecoin: Branding: litecoin-qt & test-litecoin-qt
DavidBurkett Apr 11, 2023
95f5ea2
Litecoin: Linearize
DavidBurkett Apr 12, 2023
e60c30a
Litecoin: Removing signet
DavidBurkett Apr 28, 2023
aefc9a3
Litecoin: Removing signet
DavidBurkett Apr 28, 2023
f25dd38
Litecoin: Removing signet
DavidBurkett Apr 28, 2023
29fe6b8
Litecoin: Removing signet
DavidBurkett Apr 28, 2023
0c49aca
Litecoin: Removing signet
DavidBurkett Apr 28, 2023
ea2807d
Litecoin: Consensus: Always enforce P2SH (BIP16)
DavidBurkett Apr 28, 2023
b9963d2
Litecoin: Assume UTXO hash for regtest
DavidBurkett Apr 28, 2023
d0e2c07
Litecoin: Encode/Decode script addresses with 'M' prefix
DavidBurkett Apr 28, 2023
9401442
Litecoin: Consensus: Avoid overflow when calculating next difficulty
DavidBurkett Apr 28, 2023
7a7f7d9
Litecoin: Consensus: Prevent Zeitgest2 attack by using the full adjus…
DavidBurkett Apr 28, 2023
107d533
Litecoin: Consensus: Require block version >= VERSIONBITS_TOP_BITS (0…
DavidBurkett Apr 28, 2023
314a2f2
Litecoin: Protocol: final alert, ipv6 prefix, DEFAULT_MAX_TIME_ADJUST…
DavidBurkett Apr 28, 2023
c3d2d88
Litecoin: Increase number of blocks checked at startup (DEFAULT_CHECK…
DavidBurkett Apr 28, 2023
f06d60e
Litecoin: Update benchmark block
DavidBurkett Apr 28, 2023
5f6576f
Litecoin: Consensus: Set MAX_MONEY to 84M
DavidBurkett Apr 28, 2023
39b67fc
Litecoin: Disable RBF
DavidBurkett Apr 29, 2023
26658bd
Litecoin: Branding: contrib/macdeploy
DavidBurkett Apr 29, 2023
7e78989
Litecoin: Branding: Docs
DavidBurkett Apr 29, 2023
23f3c5e
Litecoin: Build fixes
DavidBurkett Apr 29, 2023
b8cb2cb
Litecoin: Branding: Currency unit
DavidBurkett Apr 29, 2023
496349f
Litecoin: Branding: RPC
DavidBurkett Apr 29, 2023
5b6702d
Litecoin: Branding: Wallet RPC
DavidBurkett Apr 29, 2023
ed300cf
Litecoin: Branding: App paths, client name, wallet dump
DavidBurkett Apr 29, 2023
43c12ac
Litecoin: Branding: QT
DavidBurkett Apr 29, 2023
382eb8c
Litecoin: Unit-tests
DavidBurkett May 4, 2023
9816a41
Litecoin: Functional Tests
DavidBurkett May 13, 2023
07d0d51
Litecoin: Util Tests
DavidBurkett May 31, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Litecoin: Branding: test_litecoin
DavidBurkett committed May 30, 2023

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
commit c31ce719c5f876ec0ffecb3a4152b0e46d8676e2
2 changes: 1 addition & 1 deletion .cirrus.yml
Original file line number Diff line number Diff line change
@@ -174,7 +174,7 @@ task:
- msbuild build_msvc\bitcoin.sln -property:CLToolExe=%WRAPPED_CL% -property:Configuration=Release -maxCpuCount -verbosity:minimal -noLogo
- ccache --show-stats
unit_tests_script:
- src\test_bitcoin.exe -l test_suite
- src\test_litecoin.exe -l test_suite
- src\bench_bitcoin.exe > NUL
- python test\util\test_runner.py
- python test\util\rpcauth-test.py
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -12,7 +12,7 @@ src/litecoin-util
src/litecoin-chainstate
src/litecoin-wallet
src/test/fuzz/fuzz
src/test/test_bitcoin
src/test/test_litecoin
src/qt/test/test_bitcoin-qt

# autoreconf
@@ -116,7 +116,7 @@ releases
*.gcno
*.gcda
/*.info
test_bitcoin.coverage/
test_litecoin.coverage/
total.coverage/
fuzz.coverage/
coverage_percent.txt
26 changes: 13 additions & 13 deletions Makefile.am
Original file line number Diff line number Diff line change
@@ -67,9 +67,9 @@ OSX_PACKAGING = $(OSX_DEPLOY_SCRIPT) $(OSX_INSTALLER_ICONS) \
$(top_srcdir)/contrib/macdeploy/detached-sig-create.sh

COVERAGE_INFO = $(COV_TOOL_WRAPPER) baseline.info \
test_bitcoin_filtered.info total_coverage.info \
test_litecoin_filtered.info total_coverage.info \
baseline_filtered.info functional_test.info functional_test_filtered.info \
test_bitcoin_coverage.info test_bitcoin.info fuzz.info fuzz_filtered.info fuzz_coverage.info
test_litecoin_coverage.info test_litecoin.info fuzz.info fuzz_filtered.info fuzz_coverage.info

dist-hook:
-$(GIT) archive --format=tar HEAD -- src/clientversion.cpp | $(AMTAR) -C $(top_distdir) -xf -
@@ -203,16 +203,16 @@ fuzz_filtered.info: fuzz.info
$(abs_builddir)/contrib/filter-lcov.py $(LCOV_FILTER_PATTERN) $< $@
$(LCOV) -a $@ $(LCOV_OPTS) -o $@

test_bitcoin.info: baseline_filtered.info
test_litecoin.info: baseline_filtered.info
$(MAKE) -C src/ check
$(LCOV) -c $(LCOV_OPTS) -d $(abs_builddir)/src -t test_bitcoin -o $@
$(LCOV) -c $(LCOV_OPTS) -d $(abs_builddir)/src -t test_litecoin -o $@
$(LCOV) -z $(LCOV_OPTS) -d $(abs_builddir)/src

test_bitcoin_filtered.info: test_bitcoin.info
test_litecoin_filtered.info: test_litecoin.info
$(abs_builddir)/contrib/filter-lcov.py $(LCOV_FILTER_PATTERN) $< $@
$(LCOV) -a $@ $(LCOV_OPTS) -o $@

functional_test.info: test_bitcoin_filtered.info
functional_test.info: test_litecoin_filtered.info
@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
@@ -224,17 +224,17 @@ functional_test_filtered.info: functional_test.info
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_bitcoin_coverage.info: baseline_filtered.info test_bitcoin_filtered.info
$(LCOV) -a $(LCOV_OPTS) baseline_filtered.info -a test_bitcoin_filtered.info -o $@
test_litecoin_coverage.info: baseline_filtered.info test_litecoin_filtered.info
$(LCOV) -a $(LCOV_OPTS) baseline_filtered.info -a test_litecoin_filtered.info -o $@

total_coverage.info: test_bitcoin_filtered.info functional_test_filtered.info
$(LCOV) -a $(LCOV_OPTS) baseline_filtered.info -a test_bitcoin_filtered.info -a functional_test_filtered.info -o $@ | $(GREP) "\%" | $(AWK) '{ print substr($$3,2,50) "/" $$5 }' > coverage_percent.txt
total_coverage.info: test_litecoin_filtered.info functional_test_filtered.info
$(LCOV) -a $(LCOV_OPTS) baseline_filtered.info -a test_litecoin_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_bitcoin.coverage/.dirstamp: test_bitcoin_coverage.info
test_litecoin.coverage/.dirstamp: test_litecoin_coverage.info
$(GENHTML) -s $(LCOV_OPTS) $< -o $(@D)
@touch $@

@@ -244,7 +244,7 @@ total.coverage/.dirstamp: total_coverage.info

cov_fuzz: fuzz.coverage/.dirstamp

cov: test_bitcoin.coverage/.dirstamp total.coverage/.dirstamp
cov: test_litecoin.coverage/.dirstamp total.coverage/.dirstamp

endif

@@ -333,7 +333,7 @@ clean-docs:
rm -rf doc/doxygen

clean-local: clean-docs
rm -rf coverage_percent.txt test_bitcoin.coverage/ total.coverage/ fuzz.coverage/ test/tmp/ cache/ $(OSX_APP)
rm -rf coverage_percent.txt test_litecoin.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/

2 changes: 1 addition & 1 deletion ci/test/06_script_b.sh
Original file line number Diff line number Diff line change
@@ -27,7 +27,7 @@ if [ "$RUN_UNIT_TESTS" = "true" ]; then
fi

if [ "$RUN_UNIT_TESTS_SEQUENTIAL" = "true" ]; then
CI_EXEC "${TEST_RUNNER_ENV}" DIR_UNIT_TEST_DATA="${DIR_UNIT_TEST_DATA}" LD_LIBRARY_PATH="${DEPENDS_DIR}/${HOST}/lib" "${BASE_OUTDIR}/bin/test_bitcoin" --catch_system_errors=no -l test_suite
CI_EXEC "${TEST_RUNNER_ENV}" DIR_UNIT_TEST_DATA="${DIR_UNIT_TEST_DATA}" LD_LIBRARY_PATH="${DEPENDS_DIR}/${HOST}/lib" "${BASE_OUTDIR}/bin/test_litecoin" --catch_system_errors=no -l test_suite
fi

if [ "$RUN_FUNCTIONAL_TESTS" = "true" ]; then
6 changes: 3 additions & 3 deletions configure.ac
Original file line number Diff line number Diff line change
@@ -31,7 +31,7 @@ fi

BITCOIN_DAEMON_NAME=litecoind
BITCOIN_GUI_NAME=bitcoin-qt
BITCOIN_TEST_NAME=test_bitcoin
BITCOIN_TEST_NAME=test_litecoin
BITCOIN_CLI_NAME=litecoin-cli
BITCOIN_TX_NAME=litecoin-tx
BITCOIN_UTIL_NAME=litecoin-util
@@ -1876,7 +1876,7 @@ fi

AM_CONDITIONAL([ENABLE_ZMQ], [test "$use_zmq" = "yes"])

AC_MSG_CHECKING([whether to build test_bitcoin])
AC_MSG_CHECKING([whether to build test_litecoin])
if test "$use_tests" = "yes"; then
if test "$enable_fuzz" = "yes"; then
AC_MSG_RESULT([no, because fuzzing is enabled])
@@ -2088,7 +2088,7 @@ echo " with zmq = $use_zmq"
if test $enable_fuzz = "no"; then
echo " with test = $use_tests"
else
echo " with test = not building test_bitcoin because fuzzing is enabled"
echo " with test = not building test_litecoin because fuzzing is enabled"
fi
echo " with fuzz binary = $enable_fuzz_binary"
echo " with bench = $use_bench"
8 changes: 4 additions & 4 deletions contrib/devtools/README.md
Original file line number Diff line number Diff line change
@@ -129,10 +129,10 @@ If no errors occur the return value will be 0 and the output will be empty.

If there are any errors the return value will be 1 and output like this will be printed:

.../64/test_bitcoin: symbol memcpy from unsupported version GLIBC_2.14
.../64/test_bitcoin: symbol __fdelt_chk from unsupported version GLIBC_2.15
.../64/test_bitcoin: symbol std::out_of_range::~out_of_range() from unsupported version GLIBCXX_3.4.15
.../64/test_bitcoin: symbol _ZNSt8__detail15_List_nod from unsupported version GLIBCXX_3.4.15
.../64/test_litecoin: symbol memcpy from unsupported version GLIBC_2.14
.../64/test_litecoin: symbol __fdelt_chk from unsupported version GLIBC_2.15
.../64/test_litecoin: symbol std::out_of_range::~out_of_range() from unsupported version GLIBCXX_3.4.15
.../64/test_litecoin: symbol _ZNSt8__detail15_List_nod from unsupported version GLIBCXX_3.4.15

circular-dependencies.py
========================
2 changes: 1 addition & 1 deletion contrib/devtools/test_deterministic_coverage.sh
Original file line number Diff line number Diff line change
@@ -34,7 +34,7 @@ NON_DETERMINISTIC_TESTS=(
"wallet_tests/wallet_disableprivkeys" # validation.cpp: if (GetMainSignals().CallbacksPending() > 10)
)

TEST_BITCOIN_BINARY="src/test/test_bitcoin"
TEST_BITCOIN_BINARY="src/test/test_litecoin"

print_usage() {
echo "Usage: $0 [custom test filter (default: all but known non-deterministic tests)] [number of test runs (default: 2)]"
6 changes: 3 additions & 3 deletions contrib/valgrind.supp
Original file line number Diff line number Diff line change
@@ -2,14 +2,14 @@
# dependencies that cannot be fixed in-tree.
#
# Example use:
# $ valgrind --suppressions=contrib/valgrind.supp src/test/test_bitcoin
# $ valgrind --suppressions=contrib/valgrind.supp src/test/test_litecoin
# $ valgrind --suppressions=contrib/valgrind.supp --leak-check=full \
# --show-leak-kinds=all src/test/test_bitcoin
# --show-leak-kinds=all src/test/test_litecoin
#
# To create suppressions for found issues, use the --gen-suppressions=all option:
# $ valgrind --suppressions=contrib/valgrind.supp --leak-check=full \
# --show-leak-kinds=all --gen-suppressions=all --show-reachable=yes \
# --error-limit=no src/test/test_bitcoin
# --error-limit=no src/test/test_litecoin
#
# Note that suppressions may depend on OS and/or library versions.
# Tested on:
6 changes: 3 additions & 3 deletions doc/developer-notes.md
Original file line number Diff line number Diff line change
@@ -463,9 +463,9 @@ which includes known Valgrind warnings in our dependencies that cannot be fixed
in-tree. Example use:

```shell
$ valgrind --suppressions=contrib/valgrind.supp src/test/test_bitcoin
$ valgrind --suppressions=contrib/valgrind.supp src/test/test_litecoin
$ valgrind --suppressions=contrib/valgrind.supp --leak-check=full \
--show-leak-kinds=all src/test/test_bitcoin --log_level=test_suite
--show-leak-kinds=all src/test/test_litecoin --log_level=test_suite
$ valgrind -v --leak-check=full src/litecoind -printtoconsole
$ ./test/functional/test_runner.py --valgrind
```
@@ -483,7 +483,7 @@ To enable LCOV report generation during test runs:
make
make cov

# A coverage report will now be accessible at `./test_bitcoin.coverage/index.html`.
# A coverage report will now be accessible at `./test_litecoin.coverage/index.html`.
```

### Performance profiling with perf
30 changes: 15 additions & 15 deletions src/Makefile.test.include
Original file line number Diff line number Diff line change
@@ -7,11 +7,11 @@ noinst_PROGRAMS += test/fuzz/fuzz
endif

if ENABLE_TESTS
bin_PROGRAMS += test/test_bitcoin
bin_PROGRAMS += test/test_litecoin
endif

TEST_SRCDIR = test
TEST_BINARY=test/test_bitcoin$(EXEEXT)
TEST_BINARY=test/test_litecoin$(EXEEXT)
FUZZ_BINARY=test/fuzz/fuzz$(EXEEXT)

JSON_TEST_FILES = \
@@ -62,7 +62,7 @@ if USE_NATPMP
FUZZ_SUITE_LD_COMMON += $(NATPMP_LIBS)
endif

# test_bitcoin binary #
# test_litecoin binary #
BITCOIN_TESTS =\
test/addrman_tests.cpp \
test/allocator_tests.cpp \
@@ -204,23 +204,23 @@ BITCOIN_TEST_SUITE += \
wallet/test/init_test_fixture.h
endif # ENABLE_WALLET

test_test_bitcoin_SOURCES = $(BITCOIN_TEST_SUITE) $(BITCOIN_TESTS) $(JSON_TEST_FILES) $(RAW_TEST_FILES)
test_test_bitcoin_CPPFLAGS = $(AM_CPPFLAGS) $(BITCOIN_INCLUDES) $(TESTDEFS) $(BOOST_CPPFLAGS) $(EVENT_CFLAGS)
test_test_bitcoin_LDADD = $(LIBTEST_UTIL)
test_test_litecoin_SOURCES = $(BITCOIN_TEST_SUITE) $(BITCOIN_TESTS) $(JSON_TEST_FILES) $(RAW_TEST_FILES)
test_test_litecoin_CPPFLAGS = $(AM_CPPFLAGS) $(BITCOIN_INCLUDES) $(TESTDEFS) $(BOOST_CPPFLAGS) $(EVENT_CFLAGS)
test_test_litecoin_LDADD = $(LIBTEST_UTIL)
if ENABLE_WALLET
test_test_bitcoin_LDADD += $(LIBBITCOIN_WALLET)
test_test_bitcoin_CPPFLAGS += $(BDB_CPPFLAGS)
test_test_litecoin_LDADD += $(LIBBITCOIN_WALLET)
test_test_litecoin_CPPFLAGS += $(BDB_CPPFLAGS)
endif

test_test_bitcoin_LDADD += $(LIBBITCOIN_NODE) $(LIBBITCOIN_CLI) $(LIBBITCOIN_COMMON) $(LIBBITCOIN_UTIL) $(LIBBITCOIN_CONSENSUS) $(LIBBITCOIN_CRYPTO) $(LIBUNIVALUE) \
test_test_litecoin_LDADD += $(LIBBITCOIN_NODE) $(LIBBITCOIN_CLI) $(LIBBITCOIN_COMMON) $(LIBBITCOIN_UTIL) $(LIBBITCOIN_CONSENSUS) $(LIBBITCOIN_CRYPTO) $(LIBUNIVALUE) \
$(LIBLEVELDB) $(LIBMEMENV) $(LIBSECP256K1) $(EVENT_LIBS) $(EVENT_PTHREADS_LIBS) $(MINISKETCH_LIBS)
test_test_bitcoin_CXXFLAGS = $(AM_CXXFLAGS) $(PIE_FLAGS)
test_test_litecoin_CXXFLAGS = $(AM_CXXFLAGS) $(PIE_FLAGS)

test_test_bitcoin_LDADD += $(BDB_LIBS) $(MINIUPNPC_LIBS) $(CRYPTO_LIBS) $(NATPMP_LIBS) $(SQLITE_LIBS)
test_test_bitcoin_LDFLAGS = $(RELDFLAGS) $(AM_LDFLAGS) $(LIBTOOL_APP_LDFLAGS) $(PTHREAD_FLAGS) -static
test_test_litecoin_LDADD += $(BDB_LIBS) $(MINIUPNPC_LIBS) $(CRYPTO_LIBS) $(NATPMP_LIBS) $(SQLITE_LIBS)
test_test_litecoin_LDFLAGS = $(RELDFLAGS) $(AM_LDFLAGS) $(LIBTOOL_APP_LDFLAGS) $(PTHREAD_FLAGS) -static

if ENABLE_ZMQ
test_test_bitcoin_LDADD += $(LIBBITCOIN_ZMQ) $(ZMQ_LIBS)
test_test_litecoin_LDADD += $(LIBBITCOIN_ZMQ) $(ZMQ_LIBS)
FUZZ_SUITE_LD_COMMON += $(LIBBITCOIN_ZMQ) $(ZMQ_LIBS)
endif

@@ -341,7 +341,7 @@ test_fuzz_fuzz_SOURCES = \
test/fuzz/versionbits.cpp
endif # ENABLE_FUZZ_BINARY

nodist_test_test_bitcoin_SOURCES = $(GENERATED_TEST_FILES)
nodist_test_test_litecoin_SOURCES = $(GENERATED_TEST_FILES)

$(BITCOIN_TESTS): $(GENERATED_TEST_FILES)

@@ -363,7 +363,7 @@ bitcoin_test_check: $(TEST_BINARY) FORCE
$(MAKE) check-TESTS TESTS=$^

bitcoin_test_clean : FORCE
rm -f $(CLEAN_BITCOIN_TEST) $(test_test_bitcoin_OBJECTS) $(TEST_BINARY)
rm -f $(CLEAN_BITCOIN_TEST) $(test_test_litecoin_OBJECTS) $(TEST_BINARY)

check-local: $(BITCOIN_TESTS:.cpp=.cpp.test)
if BUILD_BITCOIN_TX
26 changes: 13 additions & 13 deletions src/test/README.md
Original file line number Diff line number Diff line change
@@ -6,7 +6,7 @@ sense to simply use this framework rather than require developers to
configure some other framework (we want as few impediments to creating
unit tests as possible).

The build system is set up to compile an executable called `test_bitcoin`
The build system is set up to compile an executable called `test_litecoin`
that runs all of the unit tests. The main source file for the test library is found in
`util/setup_common.cpp`.

@@ -17,7 +17,7 @@ and tests weren't explicitly disabled.

After configuring, they can be run with `make check`.

To run the unit tests manually, launch `src/test/test_bitcoin`. To recompile
To run the unit tests manually, launch `src/test/test_litecoin`. To recompile
after a test file was modified, run `make` and then run the test again. If you
modify a non-test file, use `make -C src/test` to recompile only what's needed
to run the unit tests.
@@ -33,20 +33,20 @@ the `src/qt/test/test_main.cpp` file.

### Running individual tests

`test_bitcoin` accepts the command line arguments from the boost framework.
`test_litecoin` accepts the command line arguments from the boost framework.
For example, to run just the `getarg_tests` suite of tests:

```bash
test_bitcoin --log_level=all --run_test=getarg_tests
test_litecoin --log_level=all --run_test=getarg_tests
```

`log_level` controls the verbosity of the test framework, which logs when a
test case is entered, for example. `test_bitcoin` also accepts the command
test case is entered, for example. `test_litecoin` also accepts the command
line arguments accepted by `litecoind`. Use `--` to separate both types of
arguments:

```bash
test_bitcoin --log_level=all --run_test=getarg_tests -- -printtoconsole=1
test_litecoin --log_level=all --run_test=getarg_tests -- -printtoconsole=1
```

The `-printtoconsole=1` after the two dashes redirects the debug log, which
@@ -56,10 +56,10 @@ would normally go to a file in the test datadir
... or to run just the doubledash test:

```bash
test_bitcoin --run_test=getarg_tests/doubledash
test_litecoin --run_test=getarg_tests/doubledash
```

Run `test_bitcoin --help` for the full list.
Run `test_litecoin --help` for the full list.

### Adding test cases

@@ -80,17 +80,17 @@ on failure. For running individual tests verbosely, refer to the section
To write to logs from unit tests you need to use specific message methods
provided by Boost. The simplest is `BOOST_TEST_MESSAGE`.

For debugging you can launch the `test_bitcoin` executable with `gdb` or `lldb` and
For debugging you can launch the `test_litecoin` executable with `gdb` or `lldb` and
start debugging, just like you would with any other program:

```bash
gdb src/test/test_bitcoin
gdb src/test/test_litecoin
```

#### Segmentation faults

If you hit a segmentation fault during a test run, you can diagnose where the fault
is happening by running `gdb ./src/test/test_bitcoin` and then using the `bt` command
is happening by running `gdb ./src/test/test_litecoin` and then using the `bt` command
within gdb.

Another tool that can be used to resolve segmentation faults is
@@ -99,7 +99,7 @@ Another tool that can be used to resolve segmentation faults is
If for whatever reason you want to produce a core dump file for this fault, you can do
that as well. By default, the boost test runner will intercept system errors and not
produce a core file. To bypass this, add `--catch_system_errors=no` to the
`test_bitcoin` arguments and ensure that your ulimits are set properly (e.g. `ulimit -c
`test_litecoin` arguments and ensure that your ulimits are set properly (e.g. `ulimit -c
unlimited`).

Running the tests and hitting a segmentation fault should now produce a file called `core`
@@ -108,7 +108,7 @@ Running the tests and hitting a segmentation fault should now produce a file cal

You can then explore the core dump using
```bash
gdb src/test/test_bitcoin core
gdb src/test/test_litecoin core

(gbd) bt # produce a backtrace for where a segfault occurred
```
2 changes: 1 addition & 1 deletion src/test/main.cpp
Original file line number Diff line number Diff line change
@@ -29,7 +29,7 @@ const std::function<void(const std::string&)> G_TEST_LOG_FUN = [](const std::str
/**
* Retrieve the command line arguments from boost.
* Allows usage like:
* `test_bitcoin --run_test="net_tests/cnode_listen_port" -- -checkaddrman=1 -printtoconsole=1`
* `test_litecoin --run_test="net_tests/cnode_listen_port" -- -checkaddrman=1 -printtoconsole=1`
* which would return `["-checkaddrman=1", "-printtoconsole=1"]`.
*/
const std::function<std::vector<const char*>()> G_TEST_COMMAND_LINE_ARGUMENTS = []() {
2 changes: 1 addition & 1 deletion src/test/settings_tests.cpp
Original file line number Diff line number Diff line change
@@ -251,7 +251,7 @@ BOOST_FIXTURE_TEST_CASE(Merge, MergeTestingSetup)

// If check below fails, should manually dump the results with:
//
// SETTINGS_MERGE_TEST_OUT=results.txt ./test_bitcoin --run_test=settings_tests/Merge
// SETTINGS_MERGE_TEST_OUT=results.txt ./test_litecoin --run_test=settings_tests/Merge
//
// And verify diff against previous results to make sure the changes are expected.
//
Loading