-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathtox.ini
145 lines (128 loc) · 6.66 KB
/
tox.ini
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
[tox]
envlist = py3{6,7,8,9,10,11}-tests
skip_missing_interpreters = true
skipsdist = true
[testenv]
# uncomment next line to force older system python for local testing
#basepython = python3.8
install_command = pip install {opts} {packages}
skip_install = true
[testenv:{tests,clang,ctest,bionic,lcov,lint,grind,clean,cover}]
envdir = {toxworkdir}/build
runner = ignore_env_name_mismatch
passenv =
pythonLocation
CC
CXX
LD
AR
NM
PYTHON
DISPLAY
XAUTHORITY
HOME
USERNAME
USER
CI
XDG_*
GITHUB*
PIP_DOWNLOAD_CACHE
setenv =
clang: CC = {env:CC:clang}
clang: CXX = {env:CXX:clang++}
bionic: ENV_RIPC_RUNTIME_DIR = {env:ENV_RIPC_RUNTIME_DIR:{envtmpdir}}
LLVM_VER_DIR = {env:LLVM_VER_DIR:llvm-15}
allowlist_externals =
{tests,clang,ctest,bionic,lint,grind,clean}: bash
{tests,clang,bionic,grind,cover}: mkdir
changedir =
{tests,bionic,clang,grind}: build
deps =
{tests,bionic,clang,ctest,grind,lcov,lint,cover}: pip>=21.0.1
{tests,bionic,clang,ctest,grind,lcov,cover}: gcovr
{tests,bionic,clang,ctest,grind,lcov,cover}: lcov_cobertura
{tests,bionic,clang,ctest,grind,lcov,cover}: cmake
{tests,bionic,clang,ctest,grind,lcov,cover}: ninja
{tests,bionic,clang,ctest,grind,lcov,cover}: ValgrindCI
#lint: cpplint
lint: https://github.com/sarnold/cpplint/releases/download/2.0.1/cpplint-2.0.0-py3-none-any.whl
lint: beautysh
commands_pre =
bionic: mkdir -p {toxinidir}/coverage
{tests,clang,bionic,grind}: mkdir -p {toxinidir}/build
{tests,clang,ctest,grind}: bash -c '{toxinidir}/scripts/run_redis.sh start > /dev/null'
{tests,clang,ctest,grind}: bash -c '{toxinidir}/scripts/run_redis.sh status'
commands =
bionic: bash -c 'cmake -G {posargs:"Unix Makefiles"} -DWITH_COVERAGE=1 -DCMAKE_BUILD_TYPE=Debug ..'
bionic: bash -c 'cmake --build .'
bionic: bash -c 'make cov || true'
bionic: bash -c 'RIPC_RUNTIME_DIR=$ENV_RIPC_RUNTIME_DIR {toxinidir}/scripts/run_redis.sh start > /dev/null'
bionic: bash -c 'RIPC_RUNTIME_DIR=$ENV_RIPC_RUNTIME_DIR {toxinidir}/scripts/run_redis.sh status'
bionic: bash -c 'RIPC_SERVER_PATH=$ENV_RIPC_RUNTIME_DIR/socket make cov'
clang: bash -c 'cmake -G {posargs:"Unix Makefiles"} -DRIPC_BUILD_TESTING=ON -DCOVERAGE_BUILD=ON -DCOVERAGE_HTML=ON ..'
tests: bash -c 'cmake -G {posargs:"Unix Makefiles"} -DWITH_COVERAGE=1 -DCMAKE_BUILD_TYPE=Debug ..'
grind: bash -c 'cmake -DRIPC_BUILD_TESTING=ON -DCMAKE_BUILD_TYPE=Debug ..'
{tests,clang,grind}: bash -c 'cmake --build . -j $(nproc)'
tests: bash -c 'ctest -V --test-dir ./'
clang: bash -c 'cmake --build . --target coverage'
lcov: lcov_cobertura build/coverage/lcov.info --base-dir {toxinidir} --output coverage.xml
lint: bash -c 'cpplint --output=gsed {toxinidir}/src/* {toxinidir}/inc/*'
{bionic,tests}: gcovr --gcov-ignore-parse-errors=negative_hits.warn -s --txt-metric branch -r {toxinidir} .
bionic: gcovr -r {toxinidir} --xml-pretty -o coverage.xml .
bionic: gcovr -r {toxinidir} --html --html-details -o {toxinidir}/coverage/coverage.html .
{bionic}: bash -c 'RIPC_RUNTIME_DIR=$ENV_RIPC_RUNTIME_DIR {toxinidir}/scripts/run_redis.sh stop'
ctest: bash -c 'ctest --build-generator {posargs:"Ninja"} --build-and-test . build --build-options -DWITH_COVERAGE=ON -DCMAKE_BUILD_TYPE=Debug --test-command ctest --rerun-failed --output-on-failure -V'
ctest: gcovr --gcov-ignore-parse-errors=negative_hits.warn -s --txt-metric branch build/
cover: gcovr --xml-pretty -o coverage.xml build/
# runtime assertion error without || true => (SIGSEGV)) (exited with code -11)
grind: bash -c 'valgrind --tool=memcheck --xml=yes --xml-file=json_check.xml --leak-check=full --show-leak-kinds=definite,possible --error-exitcode=127 ./json_test || true'
# valgrind error exit without || true => (exited with code 127)
grind: bash -c 'valgrind --tool=memcheck --xml=yes --xml-file=multithread_check.xml --leak-check=full --show-leak-kinds=definite,possible --error-exitcode=127 ./multithread_test || true'
grind: bash -c 'valgrind --tool=memcheck --xml=yes --xml-file=command_check.xml --leak-check=full --show-leak-kinds=definite,possible --error-exitcode=127 ./command_result_test || true'
grind: bash -c '[[ -f json_check.xml ]] && valgrind-ci json_check.xml --number-of-errors'
grind: bash -c '[[ -f json_check.xml ]] && valgrind-ci json_check.xml --summary'
grind: valgrind-ci multithread_check.xml --number-of-errors
grind: valgrind-ci multithread_check.xml --summary
# xml exception (no errors in report) => junk after document element
#grind: bash -c '[[ -f command_check.xml ]] && valgrind-ci command_check.xml --number-of-errors || true'
#grind: bash -c '[[ -f command_check.xml ]] && valgrind-ci command_check.xml --summary || true'
clean: bash -c 'rm -rf build/ coverage/ coverage.xml *.gcov __pycache__/'
commands_post =
{tests,clang,ctest,grind,dist}: bash -c '{toxinidir}/scripts/run_redis.sh stop > /dev/null'
[testenv:{auto,autoclean,dist}]
envdir = {toxworkdir}/auto
runner = ignore_env_name_mismatch
passenv =
pythonLocation
CC
CXX
CI
GITHUB*
PIP_DOWNLOAD_CACHE
setenv =
auto: ENV_RIPC_RUNTIME_DIR = {env:ENV_RIPC_RUNTIME_DIR:{envtmpdir}}
allowlist_externals =
{auto,autoclean,dist}: bash
deps =
{auto,autoclean,dist}: pip>=21.0.1
{auto,autoclean,dist}: this-cli
{auto,autoclean,dist}: gcovr
commands_pre =
{dist}: bash -c '{toxinidir}/scripts/run_redis.sh start > /dev/null'
{dist}: bash -c '{toxinidir}/scripts/run_redis.sh status'
commands =
# sadly this-cli cannot pass args to configure
dist: this check
dist: bash -c 'make clean'
dist: bash -c 'make dist'
auto: bash -c 'autoreconf -fiv'
auto: bash -c './configure {posargs:"--with-coverage"}'
auto: bash -c 'make cov || true'
auto: bash -c 'RIPC_RUNTIME_DIR=$ENV_RIPC_RUNTIME_DIR {toxinidir}/scripts/run_redis.sh start > /dev/null'
auto: bash -c 'RIPC_RUNTIME_DIR=$ENV_RIPC_RUNTIME_DIR {toxinidir}/scripts/run_redis.sh status'
auto: bash -c 'RIPC_SERVER_PATH=$ENV_RIPC_RUNTIME_DIR/socket make cov'
auto: gcovr --gcov-ignore-parse-errors=negative_hits.warn -s --txt-metric branch src/.libs/ test/
auto: gcovr --gcov-ignore-parse-errors=negative_hits.warn --xml-pretty -o coverage.xml src/.libs/ test/
auto: bash -c 'RIPC_RUNTIME_DIR=$ENV_RIPC_RUNTIME_DIR {toxinidir}/scripts/run_redis.sh stop'
autoclean: -bash -c 'make distclean-recursive'
autoclean: bash -c 'rm -rf Makefile Makefile.in aclocal.m4 ar-lib autom4te.cache/ compile config.* coverage* configure configure~ depcomp install-sh libltdl/ ltmain.sh m4/ missing src/Makefile.in test-driver test/gmon.out test/Makefile.in'