chore: Use more descriptive names for helper scripts

Signed-off-by: Michael Vetter <jubalh@iodoru.org>
This commit is contained in:
Michael Vetter
2026-03-21 00:18:52 +01:00
parent 53a980cdd3
commit 4347af833a
6 changed files with 14 additions and 12 deletions

View File

@@ -0,0 +1,156 @@
#!/usr/bin/env bash
# Exhaustive build configuration matrix testing for Profanity
log_content()
{
echo
if [ -f "$1" ]; then
echo "Content of $1:"
cat "$1"
else
echo "Log file $1 not found."
fi
}
error_handler()
{
ERR_CODE=$?
log_content ./config.log
log_content ./test-suite.log
log_content ./test-suite-memcheck.log
echo
echo "Error ${ERR_CODE} with command '${BASH_COMMAND}' on line ${BASH_LINENO[0]}. Exiting."
echo
exit ${ERR_CODE}
}
trap error_handler ERR
num_cores()
{
# Check for cores, for systems with:
# Line 1. Linux w/ coreutils, or...
# Line 2. OpenBSD, FreeBSD, NetBSD or macOS, or...
# Line 3. Fallback for Linux w/o coreutils (glibc).
nproc \
|| sysctl -n hw.ncpu \
|| getconf _NPROCESSORS_ONLN 2>/dev/null
}
./bootstrap.sh
tests=()
MAKE="make --quiet -j$(num_cores)"
CC="gcc"
ARCH="$(uname | tr '[:upper:]' '[:lower:]')"
case "$ARCH" in
linux*)
tests=(
"--enable-notifications --enable-icons-and-clipboard --enable-otr --enable-pgp
--enable-omemo --enable-plugins --enable-c-plugins
--enable-python-plugins --with-xscreensaver --enable-omemo-qrcode --enable-gdk-pixbuf"
"--disable-notifications --disable-icons-and-clipboard --disable-otr --disable-pgp
--disable-omemo --disable-plugins --disable-c-plugins
--disable-python-plugins --without-xscreensaver"
"--disable-notifications"
"--disable-icons-and-clipboard"
"--disable-otr"
"--disable-pgp"
"--disable-omemo --disable-omemo-qrcode"
"--disable-pgp --disable-otr"
"--disable-pgp --disable-otr --disable-omemo"
"--disable-plugins"
"--disable-python-plugins"
"--disable-c-plugins"
"--disable-c-plugins --disable-python-plugins"
"--without-xscreensaver"
"--disable-gdk-pixbuf"
"")
source /etc/profile.d/debuginfod.sh 2>/dev/null || true
;;
darwin*)
tests=(
"--enable-notifications --enable-icons-and-clipboard --enable-otr --enable-pgp
--enable-omemo --enable-plugins --enable-c-plugins
--enable-python-plugins"
"--disable-notifications --disable-icons-and-clipboard --disable-otr --disable-pgp
--disable-omemo --disable-plugins --disable-c-plugins
--disable-python-plugins"
"--disable-notifications"
"--disable-icons-and-clipboard"
"--disable-otr"
"--disable-pgp"
"--disable-omemo"
"--disable-pgp --disable-otr"
"--disable-pgp --disable-otr --disable-omemo"
"--disable-plugins"
"--disable-python-plugins"
"--disable-c-plugins"
"--disable-c-plugins --disable-python-plugins"
"")
;;
openbsd*)
MAKE="gmake"
# TODO(#1231):
# `-std=gnu99 -fexec-charset=UTF-8` to silence:
# src/event/server_events.c:1453:19: error: universal character names are only valid in C++ and C99
# src/event/server_events.c:1454:19: error: universal character names are only valid in C++ and C99
CC="egcc -std=gnu99 -fexec-charset=UTF-8"
tests=(
"--enable-notifications --enable-icons-and-clipboard --enable-otr --enable-pgp
--enable-omemo --enable-plugins --enable-c-plugins
--enable-python-plugins"
"--disable-notifications --disable-icons-and-clipboard --disable-otr --disable-pgp
--disable-omemo --disable-plugins --disable-c-plugins
--disable-python-plugins"
"--disable-notifications"
"--disable-icons-and-clipboard"
"--disable-otr"
"--disable-pgp"
"--disable-omemo"
"--disable-pgp --disable-otr"
"--disable-pgp --disable-otr --disable-omemo"
"--disable-plugins"
"--disable-python-plugins"
"--disable-c-plugins"
"--disable-c-plugins --disable-python-plugins"
"")
;;
esac
case "$ARCH" in
linux*)
echo
echo "--> Building with ./configure ${tests[0]} --enable-valgrind --disable-functional-tests $*"
echo
# shellcheck disable=SC2086
./configure ${tests[0]} --enable-valgrind --disable-functional-tests $*
$MAKE CC="${CC}"
$MAKE check-valgrind
$MAKE distclean
;;
esac
for features in "${tests[@]}"
do
echo
echo "--> Building with ./configure ${features} --disable-functional-tests $*"
echo
# shellcheck disable=SC2086
./configure $features --disable-functional-tests $*
$MAKE CC="${CC}"
$MAKE check-unit
./profanity -v
$MAKE clean
done

View File

@@ -1,6 +1,6 @@
#!/usr/bin/env bash
# Central quality check script for Profanity
# Central linting and testing script for Profanity
set -e
@@ -118,7 +118,7 @@ while [[ "$#" -gt 0 ]]; do
echo "Installing pre-commit hook..."
mkdir -p .git/hooks
echo "#!/usr/bin/env bash" > .git/hooks/pre-commit
echo "./scripts/quality-check.sh --hook" >> .git/hooks/pre-commit
echo "./scripts/lint-and-test.sh --hook" >> .git/hooks/pre-commit
chmod +x .git/hooks/pre-commit
echo "Hook installed."
exit 0
@@ -140,4 +140,4 @@ if [ "$BUILD_SYSTEM" != "none" ]; then
run_tests "$BUILD_SYSTEM"
fi
echo -e "${GREEN}Quality check successful!${NC}"
echo -e "${GREEN}Validation successful!${NC}"