Skip to content

Commit 0da4706

Browse files
authored
Merge pull request #2023 from profanity-im/debug-1946-1994
Some more fixes & improvements
2 parents 0081db6 + edb41be commit 0da4706

Some content is hidden

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

84 files changed

+1313
-709
lines changed

.github/workflows/main.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@ on:
66
pull_request:
77
branches: [master]
88

9+
concurrency:
10+
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
11+
cancel-in-progress: true
12+
913
jobs:
1014
linux:
1115
runs-on: ubuntu-latest

Dockerfile.arch

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ RUN pacman -Syu --noconfirm && pacman -S --needed --noconfirm \
99
cmake \
1010
cmocka \
1111
curl \
12+
debuginfod \
1213
doxygen \
1314
expat \
1415
gcc \
@@ -28,6 +29,7 @@ RUN pacman -Syu --noconfirm && pacman -S --needed --noconfirm \
2829
python \
2930
wget \
3031
sqlite \
32+
valgrind \
3133
gdk-pixbuf2 \
3234
qrencode
3335

Dockerfile.debian

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
2727
pkg-config \
2828
python3-dev \
2929
python-dev-is-python3 \
30+
valgrind \
3031
libsqlite3-dev \
3132
libgdk-pixbuf-2.0-dev \
3233
libqrencode-dev

Dockerfile.fedora

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ RUN dnf install -y \
3333
readline-devel \
3434
openssl-devel \
3535
sqlite-devel \
36+
valgrind \
3637
gdk-pixbuf2-devel \
3738
qrencode-devel
3839

Dockerfile.tumbleweed

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ RUN zypper --non-interactive in --no-recommends \
3333
python310-devel \
3434
readline-devel \
3535
sqlite3-devel \
36+
valgrind \
3637
gdk-pixbuf-devel \
3738
qrencode-devel
3839

Dockerfile.ubuntu

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
2828
pkg-config \
2929
python3-dev \
3030
python-dev-is-python3 \
31+
valgrind \
3132
libsqlite3-dev \
3233
libgdk-pixbuf-2.0-dev \
3334
libqrencode-dev

Makefile.am

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -354,9 +354,15 @@ my-prof.supp:
354354
check-unit: tests/unittests/unittests
355355
tests/unittests/unittests
356356

357+
@VALGRIND_CHECK_RULES@
358+
VALGRIND_SUPPRESSIONS_FILES=prof.supp
359+
357360
format: $(all_c_sources)
358361
clang-format -i $(all_c_sources)
359362

363+
format-sources: $(core_sources) $(main_source)
364+
clang-format -i $^
365+
360366
spell:
361367
codespell
362368

ci-build.sh

Lines changed: 26 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ error_handler()
1313

1414
log_content ./config.log
1515
log_content ./test-suite.log
16+
log_content ./test-suite-memcheck.log
1617

1718
echo
1819
echo "Error ${ERR_CODE} with command '${BASH_COMMAND}' on line ${BASH_LINENO[0]}. Exiting."
@@ -39,7 +40,9 @@ tests=()
3940
MAKE="make --quiet -j$(num_cores)"
4041
CC="gcc"
4142

42-
case $(uname | tr '[:upper:]' '[:lower:]') in
43+
ARCH="$(uname | tr '[:upper:]' '[:lower:]')"
44+
45+
case "$ARCH" in
4346
linux*)
4447
tests=(
4548
"--enable-notifications --enable-icons-and-clipboard --enable-otr --enable-pgp
@@ -62,6 +65,7 @@ case $(uname | tr '[:upper:]' '[:lower:]') in
6265
"--without-xscreensaver"
6366
"--disable-gdk-pixbuf"
6467
"")
68+
source /etc/profile.d/debuginfod.sh 2>/dev/null || true
6569
;;
6670
darwin*)
6771
tests=(
@@ -114,14 +118,33 @@ case $(uname | tr '[:upper:]' '[:lower:]') in
114118
;;
115119
esac
116120

121+
case "$ARCH" in
122+
linux*)
123+
echo
124+
echo "--> Building with ./configure ${tests[0]} --enable-valgrind $*"
125+
echo
126+
127+
# shellcheck disable=SC2086
128+
./configure ${tests[0]} --enable-valgrind $*
129+
130+
$MAKE CC="${CC}"
131+
if grep '^ID=' /etc/os-release | grep -q -e debian; then
132+
$MAKE check-valgrind
133+
else
134+
$MAKE check-valgrind || log_content ./test-suite-memcheck.log
135+
fi
136+
$MAKE distclean
137+
;;
138+
esac
139+
117140
for features in "${tests[@]}"
118141
do
119142
echo
120-
echo "--> Building with ./configure ${features}"
143+
echo "--> Building with ./configure ${features} $*"
121144
echo
122145

123146
# shellcheck disable=SC2086
124-
./configure $features
147+
./configure $features $*
125148

126149
$MAKE CC="${CC}"
127150
$MAKE check

configure.ac

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,12 @@ AC_ARG_ENABLE([gdk-pixbuf],
7070
AC_ARG_ENABLE([omemo-qrcode],
7171
[AS_HELP_STRING([--enable-omemo-qrcode], [enable ability to display omemo qr code])])
7272

73+
m4_include([m4/ax_valgrind_check.m4])
74+
AX_VALGRIND_DFLT([drd], [off])
75+
AX_VALGRIND_DFLT([helgrind], [off])
76+
AX_VALGRIND_DFLT([sgcheck], [off])
77+
AX_VALGRIND_CHECK
78+
7379
# Required dependencies
7480

7581
AC_CHECK_FUNCS([atexit memset strdup strstr])

docs/profanity.1

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,13 @@ may be set to DEBUG, INFO (the default), WARN or ERROR.
3636
.BI "\-f, \-\-logfile"
3737
Specify a different logfile
3838
.TP
39+
.BI "\-r, \-\-cmd"
40+
Specify the commands that should be run right after starting up.
41+
This can be given multiple times, e.g.
42+
.EX
43+
profanity --cmd /foo --cmd "/sleep 10" --cmd /quit
44+
.EE
45+
.TP
3946
.BI "\-t, \-\-theme "THEME
4047
Specify which theme to use.
4148
.I THEME

0 commit comments

Comments
 (0)