diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index daba21e..1a0fe34 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 408267b..1800320 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 73f12de..a78f937 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 72b1176..798080a 100644 --- a/configure.ac +++ b/configure.ac @@ -2,7 +2,7 @@ AC_PREREQ([2.71]) AC_INIT( [libcdirectory], - [20231031], + [20231208], [joachim.metz@gmail.com]) AC_CONFIG_SRCDIR( 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