From a3feb548c0e63ee3d01c7abc1ff25b7c49d31175 Mon Sep 17 00:00:00 2001 From: Robin Jarry Date: Sun, 4 Aug 2024 15:12:12 +0200 Subject: filters: replace valgrind with libasan Libasan is not available under alpine which has musl-libc. Add fedora rawhide to the list of builds and run all tests with the address sanitizer enabled for C programs. Remove FILTERS_TEST_*PREFIX which isn't needed anymore. Signed-off-by: Robin Jarry --- .builds/alpine-edge.yml | 7 ------- .builds/fedora.yml | 26 ++++++++++++++++++++++++++ filters/test.sh | 19 ++++++++----------- 3 files changed, 34 insertions(+), 18 deletions(-) create mode 100644 .builds/fedora.yml diff --git a/.builds/alpine-edge.yml b/.builds/alpine-edge.yml index a03f101e..f9abb3b4 100644 --- a/.builds/alpine-edge.yml +++ b/.builds/alpine-edge.yml @@ -2,23 +2,16 @@ image: alpine/edge packages: - curl - - go - gnupg - notmuch-dev - scdoc - - valgrind sources: - "https://git.sr.ht/~rjarry/aerc" environment: DESTDIR: ./out GOFLAGS: "-tags=notmuch" CC: gcc - FILTERS_TEST_BIN_PREFIX: valgrind --leak-check=full --error-exitcode=1 tasks: - - validate: | - gmake -C aerc validate - - install: | - gmake -C aerc install checkinstall - ancient-go-version: | curl -O https://dl-cdn.alpinelinux.org/alpine/v3.19/community/x86_64/go-1.21.10-r0.apk sudo apk add ./go-1.21.10-r0.apk diff --git a/.builds/fedora.yml b/.builds/fedora.yml new file mode 100644 index 00000000..f4177ebc --- /dev/null +++ b/.builds/fedora.yml @@ -0,0 +1,26 @@ +--- +image: fedora/rawhide +packages: + - curl + - diff + - gcc + - git + - gmake + - gnupg + - golang + - libasan + - notmuch-devel + - scdoc +sources: + - "https://git.sr.ht/~rjarry/aerc" +environment: + DESTDIR: ./out + GOFLAGS: "-tags=notmuch" + CC: gcc + CFLAGS: -Wall -Wextra -Wconversion -Werror -Wformat-security -Wstack-protector -Wpedantic -Wmissing-prototypes -fsanitize=address + LDFLAGS: -lasan +tasks: + - validate: | + gmake -C aerc validate + - install: | + gmake -C aerc install checkinstall diff --git a/filters/test.sh b/filters/test.sh index cd4aeb88..35c8e698 100755 --- a/filters/test.sh +++ b/filters/test.sh @@ -34,14 +34,13 @@ export AERC_STYLESET=$style export AERC_OSC8_URLS=1 do_test() { - prefix="$1" - tool_bin="$2" - tool="$3" - vec="$4" - expected="$5" + tool_bin="$1" + tool="$2" + vec="$3" + expected="$4" tmp=$(mktemp) status=0 - $prefix $tool_bin < $vec > $tmp || status=$? + $tool_bin < $vec > $tmp || status=$? if [ $status -eq 0 ] && diff -u "$expected" "$tmp"; then echo "ok $tool < $vec > $tmp" else @@ -55,19 +54,17 @@ for vec in $here/vectors/*.in; do expected=${vec%%.in}.expected tool=$(basename $vec | sed 's/-.*//') tool_bin=$here/../$tool - prefix="$FILTERS_TEST_PREFIX $FILTERS_TEST_BIN_PREFIX" - # execute source directly (and omit $...BIN_PREFIX) for interpreted filters if ! [ -f "$tool_bin" ]; then + # execute source directly for interpreted filters tool_bin=$here/$tool - prefix="$FILTERS_TEST_PREFIX" fi - do_test "$prefix" "$tool_bin" "$tool" "$vec" "$expected" + do_test "$tool_bin" "$tool" "$vec" "$expected" case $tool in # additional test runs calendar) # Awk if awk -W posix -- '' >/dev/null 2>&1; then # test POSIX-compatibility - do_test "$prefix" "awk -W posix -f $tool_bin" \ + do_test "awk -W posix -f $tool_bin" \ "$tool (posix)" "$vec" "$expected" else # "-W posix" is not supported and not ignored, skip test echo "? $tool < $vec > $tmp [no '-W posix' support]" -- cgit