Skip to content

Commit

Permalink
Applied updates
Browse files Browse the repository at this point in the history
  • Loading branch information
joachimmetz committed Dec 25, 2023
1 parent 0fdf998 commit 667a782
Show file tree
Hide file tree
Showing 7 changed files with 37 additions and 113 deletions.
18 changes: 0 additions & 18 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
21 changes: 21 additions & 0 deletions .github/workflows/build_freebsd.yml
Original file line number Diff line number Diff line change
@@ -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
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Files to ignore by git
#
# Version: 20230926
# Version: 20231119

# Generic auto-generated build files
*~
Expand Down
2 changes: 1 addition & 1 deletion appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,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] (
Expand Down
2 changes: 1 addition & 1 deletion configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ AC_PREREQ([2.71])

AC_INIT(
[libagdb],
[20231030],
[20231225],
[joachim.metz@gmail.com])

AC_CONFIG_SRCDIR(
Expand Down
80 changes: 8 additions & 72 deletions runtests.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/usr/bin/env bash
# Script that runs the tests
#
# Version: 20230507
# Version: 20231119

EXIT_SUCCESS=0;
EXIT_FAILURE=1;
Expand Down Expand Up @@ -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

Expand Down
25 changes: 5 additions & 20 deletions tests/test_runner.sh
Original file line number Diff line number Diff line change
@@ -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.
Expand All @@ -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;
Expand Down Expand Up @@ -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
#
Expand All @@ -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";
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 667a782

Please sign in to comment.