From 1642db7c335a5355cd8ffd059eedd511206a7557 Mon Sep 17 00:00:00 2001 From: Brad House Date: Tue, 23 Jul 2024 14:21:26 -0400 Subject: [PATCH] CI: backport test fixes from main --- .cirrus.yml | 5 +++-- .github/workflows/netbsd.yml | 7 ++++--- .github/workflows/openbsd.yml | 7 ++++--- ci/build.sh | 2 ++ ci/test.sh | 2 +- 5 files changed, 14 insertions(+), 9 deletions(-) diff --git a/.cirrus.yml b/.cirrus.yml index 7d20f563..396bea48 100644 --- a/.cirrus.yml +++ b/.cirrus.yml @@ -147,7 +147,7 @@ task: - | case "${DIST}" in ALPINE) - apk add cmake samurai gtest-dev autoconf autoconf-archive automake libtool pkgconf make + apk add bash cmake samurai gtest-dev autoconf autoconf-archive automake libtool pkgconf make case "${BUILD_TYPE}" in asan|lsan|ubsan) apk add clang17 compiler-rt @@ -185,7 +185,8 @@ task: ;; FREEBSD) # pkg upgrade -y && \ - pkg install -y cmake ninja googletest pkgconf + pkg install -y bash cmake ninja googletest pkgconf + ln -sf /usr/local/bin/bash /bin/bash case "${BUILD_TYPE}" in asan|analyze|ubsan|lsan) pkg install -y llvm autoconf automake libtool gmake diff --git a/.github/workflows/netbsd.yml b/.github/workflows/netbsd.yml index f93f9859..0739605c 100644 --- a/.github/workflows/netbsd.yml +++ b/.github/workflows/netbsd.yml @@ -21,18 +21,19 @@ jobs: CMAKE_TEST_FLAGS: "-DCARES_BUILD_TESTS=ON" PKG_PATH: https://cdn.netbsd.org/pub/pkgsrc/packages/NetBSD/amd64/10.0/All/ TEST_FILTER: "--gtest_filter=-*LiveSearchTXT*:*LiveSearchANY*:*Parallel*" - GTEST_INSTALL_FAILURE_SIGNAL_HANDLER: 1 + TEST_DEBUGGER: "gdb" with: operating_system: netbsd version: '10.0' shell: 'bash' - environment_variables: DIST BUILD_TYPE CMAKE_FLAGS CMAKE_TEST_FLAGS PKG_PATH TEST_FILTER GTEST_INSTALL_FAILURE_SIGNAL_HANDLER + environment_variables: DIST BUILD_TYPE CMAKE_FLAGS CMAKE_TEST_FLAGS PKG_PATH TEST_FILTER TEST_DEBUGGER run: | echo "BUILD_TYPE: $BUILD_TYPE" echo "CMAKE_FLAGS: $CMAKE_FLAGS" echo "CMAKE_TEST_FLAGS: $CMAKE_TEST_FLAGS" echo "PKG_PATH: $PKG_PATH" - sudo -E /usr/pkg/sbin/pkg_add -u cmake googletest pkgconf ninja-build + sudo -E /usr/pkg/sbin/pkg_add -u bash cmake googletest pkgconf ninja-build gdb + sudo ln -sf /usr/pkg/bin/bash /bin/bash ./ci/build.sh ./ci/test.sh diff --git a/.github/workflows/openbsd.yml b/.github/workflows/openbsd.yml index 7cf9d70e..d5c9b899 100644 --- a/.github/workflows/openbsd.yml +++ b/.github/workflows/openbsd.yml @@ -18,14 +18,15 @@ jobs: BUILD_TYPE: "cmake" CMAKE_FLAGS: "-DCMAKE_BUILD_TYPE=DEBUG -DCARES_STATIC=ON -DCARES_STATIC_PIC=ON -G Ninja" CMAKE_TEST_FLAGS: "-DCARES_BUILD_TESTS=ON" - GTEST_INSTALL_FAILURE_SIGNAL_HANDLER: 1 + TEST_DEBUGGER: "lldb" with: operating_system: openbsd version: '7.5' shell: 'bash' - environment_variables: DIST BUILD_TYPE CMAKE_FLAGS CMAKE_TEST_FLAGS GTEST_INSTALL_FAILURE_SIGNAL_HANDLER + environment_variables: DIST BUILD_TYPE CMAKE_FLAGS CMAKE_TEST_FLAGS TEST_DEBUGGER run: | - sudo pkg_add cmake gtest pkgconf ninja + sudo pkg_add bash cmake gtest pkgconf ninja gdb lldb + sudo ln -sf /usr/local/bin/bash /bin/bash echo "BUILD_TYPE: $BUILD_TYPE" echo "CMAKE_FLAGS: $CMAKE_FLAGS" echo "CMAKE_TEST_FLAGS: $CMAKE_TEST_FLAGS" diff --git a/ci/build.sh b/ci/build.sh index e4e9f771..04976d5a 100755 --- a/ci/build.sh +++ b/ci/build.sh @@ -29,6 +29,7 @@ if [ "$BUILD_TYPE" = "autotools" -o "$BUILD_TYPE" = "coverage" ]; then export CXXFLAGS="${CXXFLAGS} -O0 -g" $SCAN_WRAP ../configure --disable-symbol-hiding --enable-maintainer-mode $CONFIG_OPTS $SCAN_WRAP make + cd .. else # Use cmake for everything else rm -rf cmakebld @@ -39,4 +40,5 @@ else fi $SCAN_WRAP cmake ${CMAKE_FLAGS} ${CMAKE_TEST_FLAGS} .. $SCAN_WRAP cmake --build . + cd .. fi diff --git a/ci/test.sh b/ci/test.sh index 3dd6c166..938adee4 100755 --- a/ci/test.sh +++ b/ci/test.sh @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/bash # Copyright (C) The c-ares project and its contributors # SPDX-License-Identifier: MIT set -e -x -o pipefail