Skip to content

Commit

Permalink
Changes for CI tests
Browse files Browse the repository at this point in the history
  • Loading branch information
joachimmetz committed Apr 20, 2024
1 parent 24d8138 commit a8f5490
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 9 deletions.
4 changes: 4 additions & 0 deletions appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -242,6 +242,10 @@ environment:
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2022
CONFIGURE_OPTIONS: "--enable-python"

matrix:
allow_failures:
- TARGET: mingw-w64-gcc-python

install:
- cmd: if [%BUILD_ENVIRONMENT%]==[msbuild] (
git clone https://github.com/libyal/vstools.git ..\vstools )
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(
[libfwnt],
[20240415],
[20240420],
[[email protected]])

AC_CONFIG_SRCDIR(
Expand Down
10 changes: 6 additions & 4 deletions m4/python.m4
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
dnl Functions for Python bindings
dnl
dnl Version: 20231119
dnl Version: 20240418

dnl Function to check if the python binary is available
dnl "python${PYTHON_VERSION} python python# python#.#"
Expand Down Expand Up @@ -76,10 +76,12 @@ AC_DEFUN([AX_PYTHON_CHECK],
AC_MSG_RESULT(
[$PYTHON_LDFLAGS])
dnl For CygWin add the -no-undefined linker flag
dnl For CygWin and MinGW add the -no-undefined linker flag
AS_CASE(
[$host_os],
[cygwin*],[PYTHON_LDFLAGS="${PYTHON_LDFLAGS} -no-undefined"],
[$build],
[*-*-cygwin*],[PYTHON_LDFLAGS="${PYTHON_LDFLAGS} -no-undefined"],
[*-*-mingw*],[PYTHON_LDFLAGS="${PYTHON_LDFLAGS} -no-undefined"],
[*-*-msys*],[PYTHON_LDFLAGS="${PYTHON_LDFLAGS} -no-undefined"],
[*],[])
dnl Check for the existence of Python.h
Expand Down
19 changes: 15 additions & 4 deletions tests/test_python_module.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/usr/bin/env bash
# Tests Python module functions and types.
#
# Version: 20240413
# Version: 20240417

EXIT_SUCCESS=0;
EXIT_FAILURE=1;
Expand All @@ -15,12 +15,15 @@ OPTION_SETS=();
TEST_TOOL_DIRECTORY=".";
INPUT_GLOB="*";

LIBRARY_NAME="libfwnt";
PYTHON_MODULE="pyfwnt";

test_python_function()
{
local TEST_FUNCTION=$1;

local TEST_DESCRIPTION="Testing Python-bindings functions: ${TEST_FUNCTION}";
local TEST_SCRIPT="${TEST_TOOL_DIRECTORY}/pyfwnt_test_${TEST_FUNCTION}.py";
local TEST_SCRIPT="${TEST_TOOL_DIRECTORY}/${PYTHON_MODULE}_test_${TEST_FUNCTION}.py";

run_test_with_arguments "${TEST_DESCRIPTION}" "${TEST_SCRIPT}";
local RESULT=$?;
Expand All @@ -33,7 +36,7 @@ test_python_function_with_input()
local TEST_FUNCTION=$1;

local TEST_DESCRIPTION="Testing Python-bindings functions: ${TEST_FUNCTION}";
local TEST_SCRIPT="${TEST_TOOL_DIRECTORY}/pyfwnt_test_${TEST_FUNCTION}.py";
local TEST_SCRIPT="${TEST_TOOL_DIRECTORY}/${PYTHON_MODULE}_test_${TEST_FUNCTION}.py";

if ! test -d "input";
then
Expand All @@ -50,7 +53,7 @@ test_python_function_with_input()
return ${EXIT_IGNORE};
fi

local TEST_PROFILE_DIRECTORY=$(get_test_profile_directory "input" "pyfwnt");
local TEST_PROFILE_DIRECTORY=$(get_test_profile_directory "input" "${PYTHON_MODULE}");

local IGNORE_LIST=$(read_ignore_list "${TEST_PROFILE_DIRECTORY}");

Expand Down Expand Up @@ -138,6 +141,14 @@ fi

source ${TEST_RUNNER};

PLATFORM=`uname -s | sed 's/-.*$//'`;

if test "${PLATFORM}" = "MINGW64_NT" || test "${PLATFORM}" = "MSYS_NT";
then
cp ../${LIBRARY_NAME}/.libs/*.dll ../${PYTHON_MODULE}/.libs/;
cp ../${PYTHON_MODULE}/.libs/${PYTHON_MODULE}.dll ../${PYTHON_MODULE}/.libs/${PYTHON_MODULE}.pyd;
fi

RESULT=${EXIT_IGNORE};

for TEST_FUNCTION in ${TEST_FUNCTIONS};
Expand Down

0 comments on commit a8f5490

Please sign in to comment.