From 44c4a10843f0214b268817e453961473e0e9b51c Mon Sep 17 00:00:00 2001 From: Joachim Metz Date: Tue, 26 Dec 2023 06:47:23 +0100 Subject: [PATCH] Applied updates --- .github/workflows/build.yml | 18 ------- .github/workflows/build_freebsd.yml | 21 ++++++++ .gitignore | 2 +- appveyor.yml | 2 +- configure.ac | 2 +- libbfio/Makefile.am | 2 + runtests.sh | 80 +++-------------------------- tests/test_runner.sh | 25 ++------- 8 files changed, 39 insertions(+), 113 deletions(-) create mode 100644 .github/workflows/build_freebsd.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 445adec..053ca6f 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -3,24 +3,6 @@ name: build on: [push, pull_request] permissions: read-all jobs: - build_freebsd: - # FreeBSD support is provided via virtualization on MacOS 12 - # See https://github.com/vmactions/freebsd-vm#under-the-hood. - runs-on: macos-12 - steps: - - uses: actions/checkout@v3 - - name: Building from source - id: build_freebsd - uses: vmactions/freebsd-vm@v0 - with: - usesh: true - mem: 4096 - # Note that the test scripts require bash - prepare: | - pkg install -y autoconf automake bash gettext git libtool pkgconf - run: | - tests/build.sh - tests/runtests.sh build_ubuntu: runs-on: ubuntu-22.04 strategy: diff --git a/.github/workflows/build_freebsd.yml b/.github/workflows/build_freebsd.yml new file mode 100644 index 0000000..53b87c8 --- /dev/null +++ b/.github/workflows/build_freebsd.yml @@ -0,0 +1,21 @@ +# Build from source on FreeBSD. +name: build_freebsd +on: [push] +permissions: read-all +jobs: + build_freebsd: + runs-on: ubuntu-22.04 + steps: + - uses: actions/checkout@v3 + - name: Building from source + id: build_freebsd + uses: vmactions/freebsd-vm@v1 + with: + usesh: true + mem: 4096 + # Note that the test scripts require bash + prepare: | + pkg install -y autoconf automake bash gettext git libtool pkgconf + run: | + tests/build.sh + tests/runtests.sh diff --git a/.gitignore b/.gitignore index 4445e4c..0eff0bc 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,6 @@ # Files to ignore by git # -# Version: 20230926 +# Version: 20231119 # Generic auto-generated build files *~ diff --git a/appveyor.yml b/appveyor.yml index 16dec4f..871c568 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -118,7 +118,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 pkg-config || true; fi - ps: If ($env:BUILD_ENVIRONMENT -eq "cygwin64") { (New-Object Net.WebClient).DownloadFile("https://cygwin.com/setup-x86_64.exe", "C:\\cygwin64\\setup-x86_64.exe") } - cmd: if [%BUILD_ENVIRONMENT%]==[cygwin64] ( diff --git a/configure.ac b/configure.ac index b7c1fcf..ad9790b 100644 --- a/configure.ac +++ b/configure.ac @@ -2,7 +2,7 @@ AC_PREREQ([2.71]) AC_INIT( [libbfio], - [20231031], + [20231226], [joachim.metz@gmail.com]) AC_CONFIG_SRCDIR( diff --git a/libbfio/Makefile.am b/libbfio/Makefile.am index c8e3a4a..74585e3 100644 --- a/libbfio/Makefile.am +++ b/libbfio/Makefile.am @@ -69,6 +69,8 @@ distclean: clean -rm -f libbfio.rc -rm -f Makefile +sources-local: $(BUILT_SOURCES) + splint-local: @echo "Running splint on libbfio ..." -splint -preproc -redef $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(libbfio_la_SOURCES) diff --git a/runtests.sh b/runtests.sh index 276a2d3..81313c4 100755 --- a/runtests.sh +++ b/runtests.sh @@ -1,7 +1,7 @@ #!/usr/bin/env bash # Script that runs the tests # -# Version: 20230507 +# Version: 20231119 EXIT_SUCCESS=0; EXIT_FAILURE=1; @@ -330,83 +330,19 @@ fi if test ${HAVE_ENABLE_PYTHON} -eq 0 && test -n "${PYTHON_CONFIG}"; then - # Test with Python 2. - PYTHON2=`which python2 2> /dev/null`; + run_configure_make_check_python "--enable-python"; + RESULT=$?; - # Note that "test -x" on Mac OS X will succeed if the argument is not set. - if test -n "${PYTHON2}" && test -x ${PYTHON2}; + if test ${RESULT} -ne ${EXIT_SUCCESS}; then - export PYTHON_VERSION=2; - - run_configure_make_check_python "--enable-python"; - RESULT=$?; - - export PYTHON_VERSION=; - - if test ${RESULT} -ne ${EXIT_SUCCESS}; - then - exit ${EXIT_FAILURE}; - fi - export PYTHON_VERSION=2; - - run_configure_make_check_python "--enable-python2"; - RESULT=$?; - - export PYTHON_VERSION=; - - if test ${RESULT} -ne ${EXIT_SUCCESS}; - then - exit ${EXIT_FAILURE}; - fi + exit ${EXIT_FAILURE}; fi - # Test with Python 3. - PYTHON3=`which python3 2> /dev/null`; - - # Note that "test -x" on Mac OS X will succeed if the argument is not set. - if test -n "${PYTHON3}" && test -x ${PYTHON3}; - then - export PYTHON_VERSION=3; - - run_configure_make_check_python "--enable-python"; - RESULT=$?; - - export PYTHON_VERSION=; + PYTHON=`which python 2> /dev/null`; - if test ${RESULT} -ne ${EXIT_SUCCESS}; - then - exit ${EXIT_FAILURE}; - fi - export PYTHON_VERSION=3; - - run_configure_make_check_python "--enable-python3"; - RESULT=$?; - - export PYTHON_VERSION=; - - if test ${RESULT} -ne ${EXIT_SUCCESS}; - then - exit ${EXIT_FAILURE}; - fi - fi - - # Test with the default Python version. - if test -z ${PYTHON2} && test -z ${PYTHON3}; + if test -f "setup.py" && ! run_setup_py_tests ${PYTHON}; then - run_configure_make_check_python "--enable-python"; - RESULT=$?; - - if test ${RESULT} -ne ${EXIT_SUCCESS}; - then - exit ${EXIT_FAILURE}; - fi - - PYTHON=`which python 2> /dev/null`; - - if test -f "setup.py" && ! run_setup_py_tests ${PYTHON}; - then - exit ${EXIT_FAILURE}; - fi + exit ${EXIT_FAILURE}; fi fi diff --git a/tests/test_runner.sh b/tests/test_runner.sh index e527367..3144c9d 100644 --- a/tests/test_runner.sh +++ b/tests/test_runner.sh @@ -1,7 +1,7 @@ #!/usr/bin/env bash # Bash functions to run an executable for testing. # -# Version: 20231013 +# Version: 20231119 # # When CHECK_WITH_ASAN is set to a non-empty value the test executable # is run with asan, otherwise it is run without. @@ -15,7 +15,7 @@ # When CHECK_WITH_VALGRIND is set to a non-empty value the test executable # is run with valgrind, otherwise it is run without. # -# PYTHON and PYTHON_VERSION are used to determine the Python interpreter. +# PYTHON is used to determine the Python interpreter. EXIT_SUCCESS=0; EXIT_FAILURE=1; @@ -227,9 +227,6 @@ find_binary_library_path() # Searches for the path to the binary variant of the Python module # -# Globals: -# PYTHON_VERSION -# # Arguments: # a string containing the path of the test executable # @@ -246,18 +243,8 @@ find_binary_python_module_path() TEST_EXECUTABLE=`dirname ${TEST_EXECUTABLE}`; TEST_EXECUTABLE=`dirname ${TEST_EXECUTABLE}`; - PYTHON_VERSION=`echo ${PYTHON_VERSION} | cut -c1`; - - local PYTHON_MODULE_PATH="${TEST_EXECUTABLE}/${PYTHON_MODULE_NAME}-python${PYTHON_VERSION}/.libs"; + local PYTHON_MODULE_PATH="${TEST_EXECUTABLE}/${PYTHON_MODULE_NAME}/.libs"; - if ! test -d "${PYTHON_MODULE_PATH}"; - then - PYTHON_MODULE_PATH="../${PYTHON_MODULE_NAME}-python${PYTHON_VERSION}/.libs"; - fi - if ! test -d "${PYTHON_MODULE_PATH}"; - then - PYTHON_MODULE_PATH="${TEST_EXECUTABLE}/${PYTHON_MODULE_NAME}/.libs"; - fi if ! test -d "${PYTHON_MODULE_PATH}"; then PYTHON_MODULE_PATH="../${PYTHON_MODULE_NAME}/.libs"; @@ -422,7 +409,6 @@ read_test_data_option_file() # CHECK_WITH_GDB # CHECK_WITH_STDERR # CHECK_WITH_VALGRIND -# PYTHON_VERSION # # Arguments: # a string containing the test description @@ -459,7 +445,7 @@ run_test_with_arguments() if test ${IS_PYTHON_SCRIPT} -eq 0 && test -z ${PYTHON}; then - local PYTHON=`which python${PYTHON_VERSION} 2> /dev/null`; + local PYTHON=`which python 2> /dev/null`; if ! test -x ${PYTHON}; then @@ -743,7 +729,6 @@ run_test_with_arguments() # CHECK_WITH_GDB # CHECK_WITH_STDERR # CHECK_WITH_VALGRIND -# PYTHON_VERSION # # Arguments: # a string containing the path of the test executable @@ -780,7 +765,7 @@ run_test_with_input_and_arguments() if test ${IS_PYTHON_SCRIPT} -eq 0 && test -z ${PYTHON}; then - local PYTHON=`which python${PYTHON_VERSION} 2> /dev/null`; + local PYTHON=`which python 2> /dev/null`; if ! test -x ${PYTHON}; then