mirror of
https://github.com/XRPLF/rippled.git
synced 2025-12-06 17:27:55 +00:00
Default to ipv4 for unit tests, add ipv6 option
This commit is contained in:
committed by
Nik Bougalis
parent
49bcdda418
commit
63370b4441
@@ -36,7 +36,7 @@ matrix:
|
|||||||
include:
|
include:
|
||||||
|
|
||||||
- compiler: gcc
|
- compiler: gcc
|
||||||
env: GCC_VER=5 TARGET=debug APP_ARGS="--unittest-ipv4"
|
env: GCC_VER=5 TARGET=debug
|
||||||
|
|
||||||
# - compiler: gcc
|
# - compiler: gcc
|
||||||
# env: GCC_VER=5 TARGET=debug.nounity
|
# env: GCC_VER=5 TARGET=debug.nounity
|
||||||
@@ -45,7 +45,7 @@ matrix:
|
|||||||
# env: GCC_VER=5 TARGET=coverage PATH=$PWD/cmake/bin:$PATH
|
# env: GCC_VER=5 TARGET=coverage PATH=$PWD/cmake/bin:$PATH
|
||||||
|
|
||||||
- compiler: clang
|
- compiler: clang
|
||||||
env: GCC_VER=5 TARGET=debug APP_ARGS="--unittest-ipv4"
|
env: GCC_VER=5 TARGET=debug
|
||||||
|
|
||||||
# - compiler: clang
|
# - compiler: clang
|
||||||
# env: GCC_VER=5 TARGET=debug.nounity
|
# env: GCC_VER=5 TARGET=debug.nounity
|
||||||
|
|||||||
@@ -130,6 +130,12 @@ parser.add_argument(
|
|||||||
help='Run tests in parallel'
|
help='Run tests in parallel'
|
||||||
)
|
)
|
||||||
|
|
||||||
|
parser.add_argument(
|
||||||
|
'--ipv6',
|
||||||
|
action='store_true',
|
||||||
|
help='Use IPv6 localhost when running unit tests.',
|
||||||
|
)
|
||||||
|
|
||||||
parser.add_argument(
|
parser.add_argument(
|
||||||
'--clean', '-c',
|
'--clean', '-c',
|
||||||
action='store_true',
|
action='store_true',
|
||||||
@@ -292,13 +298,16 @@ def run_cmake_tests(directory, target, config):
|
|||||||
testflag = '--unittest'
|
testflag = '--unittest'
|
||||||
quiet = ''
|
quiet = ''
|
||||||
testjobs = ''
|
testjobs = ''
|
||||||
|
ipv6 = ''
|
||||||
if ARGS.test:
|
if ARGS.test:
|
||||||
testflag += ('=' + ARGS.test)
|
testflag += ('=' + ARGS.test)
|
||||||
if ARGS.quiet:
|
if ARGS.quiet:
|
||||||
quiet = '-q'
|
quiet = '-q'
|
||||||
|
if ARGS.ipv6:
|
||||||
|
ipv6 = '--unittest-ipv6'
|
||||||
if ARGS.testjobs:
|
if ARGS.testjobs:
|
||||||
testjobs = ('--unittest-jobs=' + str(ARGS.testjobs))
|
testjobs = ('--unittest-jobs=' + str(ARGS.testjobs))
|
||||||
resultcode, lines = shell(executable, (testflag, quiet, testjobs,))
|
resultcode, lines = shell(executable, (testflag, quiet, testjobs, ipv6))
|
||||||
|
|
||||||
if resultcode:
|
if resultcode:
|
||||||
if not ARGS.verbose:
|
if not ARGS.verbose:
|
||||||
|
|||||||
1
Jenkinsfile
vendored
1
Jenkinsfile
vendored
@@ -200,6 +200,7 @@ try {
|
|||||||
'NINJA_BUILD=false',
|
'NINJA_BUILD=false',
|
||||||
"CCACHE_BASEDIR=${cdir}",
|
"CCACHE_BASEDIR=${cdir}",
|
||||||
'PLANTUML_JAR=/opt/plantuml/plantuml.jar',
|
'PLANTUML_JAR=/opt/plantuml/plantuml.jar',
|
||||||
|
'APP_ARGS=--unittest-ipv6',
|
||||||
'CCACHE_NOHASHDIR=true',
|
'CCACHE_NOHASHDIR=true',
|
||||||
"CC=${cc}",
|
"CC=${cc}",
|
||||||
"CXX=${cxx}",
|
"CXX=${cxx}",
|
||||||
|
|||||||
@@ -216,7 +216,7 @@ static int runUnitTests(
|
|||||||
bool quiet,
|
bool quiet,
|
||||||
bool log,
|
bool log,
|
||||||
bool child,
|
bool child,
|
||||||
bool ipv4,
|
bool ipv6,
|
||||||
std::size_t num_jobs,
|
std::size_t num_jobs,
|
||||||
int argc,
|
int argc,
|
||||||
char** argv)
|
char** argv)
|
||||||
@@ -224,8 +224,7 @@ static int runUnitTests(
|
|||||||
using namespace beast::unit_test;
|
using namespace beast::unit_test;
|
||||||
using namespace ripple::test;
|
using namespace ripple::test;
|
||||||
|
|
||||||
if (ipv4)
|
ripple::test::envUseIPv4 = (! ipv6);
|
||||||
ripple::test::envUseIPv4 = true;
|
|
||||||
|
|
||||||
if (!child && num_jobs == 1)
|
if (!child && num_jobs == 1)
|
||||||
{
|
{
|
||||||
@@ -376,7 +375,7 @@ int run (int argc, char** argv)
|
|||||||
"argument is handled individually by any suite that accesses it -- "
|
"argument is handled individually by any suite that accesses it -- "
|
||||||
"as such, it typically only make sense to provide this when running "
|
"as such, it typically only make sense to provide this when running "
|
||||||
"a single suite.")
|
"a single suite.")
|
||||||
("unittest-ipv4", "Use IPv4 localhost when running unittests (default is IPv6).")
|
("unittest-ipv6", "Use IPv6 localhost when running unittests (default is IPv4).")
|
||||||
("unittest-log",
|
("unittest-log",
|
||||||
"Force unit test log message output. Only useful in combination with "
|
"Force unit test log message output. Only useful in combination with "
|
||||||
"--quiet, in which case log messages will print but suite/case names "
|
"--quiet, in which case log messages will print but suite/case names "
|
||||||
@@ -457,7 +456,7 @@ int run (int argc, char** argv)
|
|||||||
bool (vm.count ("quiet")),
|
bool (vm.count ("quiet")),
|
||||||
bool (vm.count ("unittest-log")),
|
bool (vm.count ("unittest-log")),
|
||||||
unittestChild,
|
unittestChild,
|
||||||
bool (vm.count ("unittest-ipv4")),
|
bool (vm.count ("unittest-ipv6")),
|
||||||
numJobs,
|
numJobs,
|
||||||
argc,
|
argc,
|
||||||
argv);
|
argv);
|
||||||
|
|||||||
Reference in New Issue
Block a user