From c08d41e17656195eb829c467036c1949bd6e70ec Mon Sep 17 00:00:00 2001 From: Joachim Metz Date: Sun, 17 Mar 2019 09:15:03 +0100 Subject: [PATCH] Applied updates --- .travis.yml | 17 +++++++++++++---- configure.ac | 2 +- m4/python.m4 | 26 ++++++++++++++------------ tests/vmdk_test_macros.h | 7 +++++++ 4 files changed, 35 insertions(+), 17 deletions(-) diff --git a/.travis.yml b/.travis.yml index 0ff5be9..cd37fde 100644 --- a/.travis.yml +++ b/.travis.yml @@ -189,7 +189,7 @@ matrix: compiler: gcc os: osx osx_image: xcode8.3 - - name: "Mac OS gcc and pkgbuild" + - name: "Mac OS gcc and Python module and pkgbuild" env: - CONFIGURE_OPTIONS="--disable-dependency-tracking --prefix=/usr/local --enable-python --with-pyprefix" - TARGET="macos-gcc-pkgbuild" @@ -224,9 +224,18 @@ script: - if test ${TARGET} = "linux-gcc-python-setup-py" || test ${TARGET} = "macos-gcc-python-setup-py"; then ./configure ${CONFIGURE_OPTIONS} && make > /dev/null && python ./setup.py build; elif test ${TARGET} != "coverity"; then - ./configure ${CONFIGURE_OPTIONS} && make > /dev/null && make check CHECK_WITH_STDERR=1; - if test $? -ne 0 && test -f tests/test-suite.log; then - cat tests/test-suite.log; + ./configure ${CONFIGURE_OPTIONS} && make > /dev/null; RESULT=$?; + if test ${RESULT} -eq 0; then + if test ${TARGET} = "macos-gcc-python" || test ${TARGET} = "macos-gcc-pkgbuild"; then + install_name_tool -change /usr/local/lib/libvmdk.1.dylib ${PWD}/libvmdk/.libs/libvmdk.1.dylib ./pyvmdk/.libs/pyvmdk.so; + fi; + make check CHECK_WITH_STDERR=1; RESULT=$?; + fi; + if test ${RESULT} -ne 0; then + if test -f tests/test-suite.log; then + cat tests/test-suite.log; + fi; + return ${RESULT}; fi; if test ${TARGET} = "macos-gcc-pkgbuild"; then VERSION=`sed '5!d; s/^ \[//;s/\],$//' configure.ac` && diff --git a/configure.ac b/configure.ac index 23cbc58..00d6d46 100644 --- a/configure.ac +++ b/configure.ac @@ -2,7 +2,7 @@ AC_PREREQ( 2.59 ) AC_INIT( [libvmdk], - [20190310], + [20190316], [joachim.metz@gmail.com]) AC_CONFIG_SRCDIR( diff --git a/m4/python.m4 b/m4/python.m4 index 35b1926..666995c 100644 --- a/m4/python.m4 +++ b/m4/python.m4 @@ -1,6 +1,6 @@ dnl Functions for Python bindings dnl -dnl Version: 20170830 +dnl Version: 20190316 dnl Function to check if the python binary is available dnl "python${PYTHON_VERSION} python python# python#.#" @@ -8,17 +8,13 @@ AC_DEFUN([AX_PROG_PYTHON], [AS_IF( [test "x${PYTHON_VERSION}" != x], [ax_python_progs="python${PYTHON_VERSION}"], - [ax_python_progs="python python2 python2.7 python2.6 python2.5 python3 python3.7 python3.6 python3.5 python3.4 python3.3 python3.2 python3.1 python3.0"]) + [ax_python_progs="python python2 python2.7 python2.6 python2.5 python3 python3.8 python3.7 python3.6 python3.5 python3.4 python3.3 python3.2 python3.1 python3.0"]) AC_CHECK_PROGS( [PYTHON], [$ax_python_progs]) AS_IF( [test "x${PYTHON}" != x], [ax_prog_python_version=`${PYTHON} -c "import sys; sys.stdout.write(sys.version[[:3]])" 2>/dev/null`; - AC_SUBST( - [PYTHON_VERSION], - [$ax_prog_python_version]) - ax_prog_python_platform=`${PYTHON} -c "import sys; sys.stdout.write(sys.platform)" 2>/dev/null`; AC_SUBST( [PYTHON_PLATFORM], @@ -62,7 +58,7 @@ AC_DEFUN([AX_PROG_PYTHON2], dnl Function to check if the python3 binary is available dnl "python3 python3.#" AC_DEFUN([AX_PROG_PYTHON3], - [ax_python3_progs="python3 python3.4 python3.3 python3.2 python3.1 python3.0" + [ax_python3_progs="python3 python3.8 python3.7 python3.6 python3.5 python3.4 python3.3 python3.2 python3.1 python3.0" AC_CHECK_PROGS( [PYTHON3], [$ax_python3_progs]) @@ -90,10 +86,16 @@ dnl Function to check if the python-config binary is available dnl "python${PYTHON_VERSION}-config python-config" AC_DEFUN([AX_PROG_PYTHON_CONFIG], [AS_IF( - [test "x${PYTHON}" != x], + [test "x${PYTHON_CONFIG}" = x && test "x${PYTHON_VERSION}" != x], + [AC_CHECK_PROGS( + [PYTHON_CONFIG], + [python${PYTHON_VERSION}-config]) + ]) + AS_IF( + [test "x${PYTHON_CONFIG}" = x], [AC_CHECK_PROGS( [PYTHON_CONFIG], - [python${PYTHON_VERSION}-config python-config]) + [python-config]) ]) AS_IF( [test "x${PYTHON_CONFIG}" = x], @@ -108,7 +110,7 @@ AC_DEFUN([AX_PROG_PYTHON_CONFIG], dnl Function to check if the python2-config binary is available AC_DEFUN([AX_PROG_PYTHON2_CONFIG], [AS_IF( - [test "x${PYTHON2}" != x], + [test "x${PYTHON2_CONFIG}" = x], [AC_CHECK_PROGS( [PYTHON2_CONFIG], [python2-config]) @@ -126,7 +128,7 @@ AC_DEFUN([AX_PROG_PYTHON2_CONFIG], dnl Function to check if the python3-config binary is available AC_DEFUN([AX_PROG_PYTHON3_CONFIG], [AS_IF( - [test "x${PYTHON3}" != x], + [test "x${PYTHON3_CONFIG}" = x], [AC_CHECK_PROGS( [PYTHON3_CONFIG], [python3-config]) @@ -185,7 +187,7 @@ AC_DEFUN([AX_PYTHON_CHECK], AS_IF( [test "x${ac_cv_header_python_h}" != xyes], [ac_cv_enable_python=no], - [ac_cv_enable_python=$PYTHON_VERSION + [ac_cv_enable_python=${ax_prog_python_version} AC_SUBST( [PYTHON_CPPFLAGS], [$PYTHON_INCLUDES]) diff --git a/tests/vmdk_test_macros.h b/tests/vmdk_test_macros.h index b0972f3..a3a4e92 100644 --- a/tests/vmdk_test_macros.h +++ b/tests/vmdk_test_macros.h @@ -99,6 +99,13 @@ goto on_error; \ } +#define VMDK_TEST_ASSERT_NOT_EQUAL_SSIZE( name, value, expected_value ) \ + if( value == expected_value ) \ + { \ + fprintf( stdout, "%s:%d %s (%" PRIzd ") == %" PRIzd "\n", __FILE__, __LINE__, name, value, expected_value ); \ + goto on_error; \ + } + #define VMDK_TEST_ASSERT_EQUAL_INT8( name, value, expected_value ) \ if( value != expected_value ) \ { \