From 2e824edbc30710a8834ab8bed4ba69391a7776b9 Mon Sep 17 00:00:00 2001 From: Joachim Metz Date: Sat, 7 Oct 2023 11:54:05 +0200 Subject: [PATCH] Changes for CI tests --- appveyor.yml | 15 ++++++++++++++- hmactools/hmactools_signal.c | 6 +++--- tests/test_library.sh | 6 ++++-- tests/test_md5sum.sh | 6 +++--- tests/test_sha1sum.sh | 6 +++--- tests/test_sha2sum.sh | 6 +++--- 6 files changed, 30 insertions(+), 15 deletions(-) diff --git a/appveyor.yml b/appveyor.yml index 426a9e7..a9de9fb 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -84,11 +84,16 @@ environment: APPVEYOR_BUILD_WORKER_IMAGE: macos-monterey HOMEBREW_NO_INSTALL_CLEANUP: 1 CC: clang + CFLAGS: "-I/usr/local/include" + LDFLAGS: "-L/usr/local/lib" CONFIGURE_OPTIONS: "" - TARGET: macos-x64-gcc BUILD_ENVIRONMENT: xcode APPVEYOR_BUILD_WORKER_IMAGE: macos-monterey HOMEBREW_NO_INSTALL_CLEANUP: 1 + CC: gcc + CFLAGS: "-I/usr/local/include" + LDFLAGS: "-L/usr/local/lib" CONFIGURE_OPTIONS: "" - TARGET: macos-x64-gcc-python BUILD_ENVIRONMENT: xcode @@ -96,6 +101,7 @@ environment: PYTHON: "/usr/local/opt/python@3.11/bin/python3" PYTHON_CONFIG: "/usr/local/opt/python@3.11/bin/python3-config" HOMEBREW_NO_INSTALL_CLEANUP: 1 + CC: gcc CFLAGS: "-I/usr/local/include" LDFLAGS: "-L/usr/local/lib" CONFIGURE_OPTIONS: "--enable-python" @@ -105,6 +111,7 @@ environment: PYTHON: "/usr/local/opt/python@3.11/bin/python3" PYTHON_CONFIG: "/usr/local/opt/python@3.11/bin/python3-config" HOMEBREW_NO_INSTALL_CLEANUP: 1 + CC: gcc CFLAGS: "-I/usr/local/include" LDFLAGS: "-L/usr/local/lib" CONFIGURE_OPTIONS: "--disable-dependency-tracking --prefix=/usr/local --enable-python --with-pyprefix" @@ -140,6 +147,12 @@ environment: HOMEBREW_NO_INSTALL_CLEANUP: 1 PYTHON_VERSION: 3.11 TOXENV: py311 + - TARGET: macos-tox-py312 + BUILD_ENVIRONMENT: python-tox + APPVEYOR_BUILD_WORKER_IMAGE: macos-monterey + HOMEBREW_NO_INSTALL_CLEANUP: 1 + PYTHON_VERSION: 3.12 + TOXENV: py312 - TARGET: cygwin64-gcc BUILD_ENVIRONMENT: cygwin64 APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2022 @@ -184,7 +197,7 @@ install: - cmd: if [%BUILD_ENVIRONMENT%]==[msbuild] ( git clone https://github.com/libyal/vstools.git ..\vstools ) - sh: if test ${BUILD_ENVIRONMENT} = "python-tox" || test ${BUILD_ENVIRONMENT} = "xcode"; then brew update-reset && brew update -q; fi -- sh: if test ${BUILD_ENVIRONMENT} = "python-tox" || test ${BUILD_ENVIRONMENT} = "xcode"; then brew install -q gettext gnu-sed || true; fi +- sh: if test ${BUILD_ENVIRONMENT} = "python-tox" || test ${BUILD_ENVIRONMENT} = "xcode"; then brew install -q autoconf automake gettext gnu-sed libtool openssl pkg-config || true; fi - sh: if test ${BUILD_ENVIRONMENT} = "python-tox"; then brew install -q python@${PYTHON_VERSION} tox twine-pypi || true; fi - cmd: if [%BUILD_ENVIRONMENT%]==[python] ( "%PYTHON%" -m pip install -U pip setuptools twine wheel ) diff --git a/hmactools/hmactools_signal.c b/hmactools/hmactools_signal.c index cf3ca20..0df3dde 100644 --- a/hmactools/hmactools_signal.c +++ b/hmactools/hmactools_signal.c @@ -40,7 +40,7 @@ void (*hmactools_signal_signal_handler)( hmactools_signal_t ) = NULL; /* Signal handler for Ctrl+C or Ctrl+Break signals */ BOOL WINAPI hmactools_signal_handler( - unsigned long signal ) + DWORD signal ) { static char *function = "hmactools_signal_handler"; @@ -112,7 +112,7 @@ int hmactools_signal_attach( hmactools_signal_signal_handler = signal_handler; if( SetConsoleCtrlHandler( - hmactools_signal_handler, + (PHANDLER_ROUTINE) hmactools_signal_handler, TRUE ) == 0 ) { libcerror_error_set( @@ -179,7 +179,7 @@ int hmactools_signal_detach( static char *function = "hmactools_signal_detach"; if( SetConsoleCtrlHandler( - hmactools_signal_handler, + (PHANDLER_ROUTINE) hmactools_signal_handler, FALSE ) == 0 ) { libcerror_error_set( diff --git a/tests/test_library.sh b/tests/test_library.sh index 24aae74..2bb3910 100755 --- a/tests/test_library.sh +++ b/tests/test_library.sh @@ -1,7 +1,7 @@ #!/usr/bin/env bash # Tests library functions and types. # -# Version: 20231005 +# Version: 20231007 EXIT_SUCCESS=0; EXIT_FAILURE=1; @@ -86,6 +86,8 @@ run_test_with_input() fi for INPUT_FILE in "${INPUT_FILES[@]}"; do + OPTION_INPUT_FILE="${INPUT_FILE}"; + if test "${OSTYPE}" = "msys"; then # A test executable built with MinGW expects a Windows path. @@ -95,7 +97,7 @@ run_test_with_input() for OPTION_SET in ${OPTION_SETS[@]}; do - local TEST_DATA_OPTION_FILE=$(get_test_data_option_file "${TEST_SET_DIRECTORY}" "${INPUT_FILE}" "${OPTION_SET}"); + local TEST_DATA_OPTION_FILE=$(get_test_data_option_file "${TEST_SET_DIRECTORY}" "${OPTION_INPUT_FILE}" "${OPTION_SET}"); if test -f ${TEST_DATA_OPTION_FILE}; then diff --git a/tests/test_md5sum.sh b/tests/test_md5sum.sh index ef5e2ee..7407ba8 100755 --- a/tests/test_md5sum.sh +++ b/tests/test_md5sum.sh @@ -1,7 +1,7 @@ #!/usr/bin/env bash # Sum tool testing script # -# Version: 20231001 +# Version: 20231007 EXIT_SUCCESS=0; EXIT_FAILURE=1; @@ -165,7 +165,7 @@ do IFS=" " read -a OPTIONS <<< $(read_test_data_option_file "${TEST_SET_DIRECTORY}" "${INPUT_FILE}" "${OPTION_SET}"); - run_test_on_input_file "${TEST_SET_DIRECTORY}" "hmacsum" "with_stdout_reference" "${OPTION_SET}" "${TEST_EXECUTABLE}" "${INPUT_FILE}" "${PROFILE_OPTIONS[@]}" "${OPTIONS[@]}"; + run_test_on_input_file "${TEST_SET_DIRECTORY}" "hmacsum" "with_callback" "${OPTION_SET}" "${TEST_EXECUTABLE}" "${INPUT_FILE}" "${PROFILE_OPTIONS[@]}" "${OPTIONS[@]}"; RESULT=$?; if test ${RESULT} -ne ${EXIT_SUCCESS}; @@ -177,7 +177,7 @@ do if test ${TESTED_WITH_OPTIONS} -eq 0; then - run_test_on_input_file "${TEST_SET_DIRECTORY}" "hmacsum" "with_stdout_reference" "" "${TEST_EXECUTABLE}" "${INPUT_FILE}" "${PROFILE_OPTIONS[@]}"; + run_test_on_input_file "${TEST_SET_DIRECTORY}" "hmacsum" "with_callback" "" "${TEST_EXECUTABLE}" "${INPUT_FILE}" "${PROFILE_OPTIONS[@]}"; RESULT=$?; fi diff --git a/tests/test_sha1sum.sh b/tests/test_sha1sum.sh index a4791bc..7197620 100755 --- a/tests/test_sha1sum.sh +++ b/tests/test_sha1sum.sh @@ -1,7 +1,7 @@ #!/usr/bin/env bash # Sum tool testing script # -# Version: 20231001 +# Version: 20231007 EXIT_SUCCESS=0; EXIT_FAILURE=1; @@ -165,7 +165,7 @@ do IFS=" " read -a OPTIONS <<< $(read_test_data_option_file "${TEST_SET_DIRECTORY}" "${INPUT_FILE}" "${OPTION_SET}"); - run_test_on_input_file "${TEST_SET_DIRECTORY}" "hmacsum" "with_stdout_reference" "${OPTION_SET}" "${TEST_EXECUTABLE}" "${INPUT_FILE}" "${PROFILE_OPTIONS[@]}" "${OPTIONS[@]}"; + run_test_on_input_file "${TEST_SET_DIRECTORY}" "hmacsum" "with_callback" "${OPTION_SET}" "${TEST_EXECUTABLE}" "${INPUT_FILE}" "${PROFILE_OPTIONS[@]}" "${OPTIONS[@]}"; RESULT=$?; if test ${RESULT} -ne ${EXIT_SUCCESS}; @@ -177,7 +177,7 @@ do if test ${TESTED_WITH_OPTIONS} -eq 0; then - run_test_on_input_file "${TEST_SET_DIRECTORY}" "hmacsum" "with_stdout_reference" "" "${TEST_EXECUTABLE}" "${INPUT_FILE}" "${PROFILE_OPTIONS[@]}"; + run_test_on_input_file "${TEST_SET_DIRECTORY}" "hmacsum" "with_callback" "" "${TEST_EXECUTABLE}" "${INPUT_FILE}" "${PROFILE_OPTIONS[@]}"; RESULT=$?; fi diff --git a/tests/test_sha2sum.sh b/tests/test_sha2sum.sh index 59d2933..28cb793 100755 --- a/tests/test_sha2sum.sh +++ b/tests/test_sha2sum.sh @@ -1,7 +1,7 @@ #!/usr/bin/env bash # Sum tool testing script # -# Version: 20231001 +# Version: 20231007 EXIT_SUCCESS=0; EXIT_FAILURE=1; @@ -199,7 +199,7 @@ do IFS=" " read -a OPTIONS <<< $(read_test_data_option_file "${TEST_SET_DIRECTORY}" "${INPUT_FILE}" "${OPTION_SET}"); - run_test_on_input_file "${TEST_SET_DIRECTORY}" "hmacsum" "with_stdout_reference" "${OPTION_SET}" "${TEST_EXECUTABLE}" "${INPUT_FILE}" "${PROFILE_OPTIONS[@]}" "${OPTIONS[@]}"; + run_test_on_input_file "${TEST_SET_DIRECTORY}" "hmacsum" "with_callback" "${OPTION_SET}" "${TEST_EXECUTABLE}" "${INPUT_FILE}" "${PROFILE_OPTIONS[@]}" "${OPTIONS[@]}"; RESULT=$?; if test ${RESULT} -ne ${EXIT_SUCCESS}; @@ -211,7 +211,7 @@ do if test ${TESTED_WITH_OPTIONS} -eq 0; then - run_test_on_input_file "${TEST_SET_DIRECTORY}" "hmacsum" "with_stdout_reference" "" "${TEST_EXECUTABLE}" "${INPUT_FILE}" "${PROFILE_OPTIONS[@]}"; + run_test_on_input_file "${TEST_SET_DIRECTORY}" "hmacsum" "with_callback" "" "${TEST_EXECUTABLE}" "${INPUT_FILE}" "${PROFILE_OPTIONS[@]}"; RESULT=$?; fi