Skip to content

Commit

Permalink
Applied updates
Browse files Browse the repository at this point in the history
  • Loading branch information
joachimmetz committed Mar 17, 2019
1 parent 62cdd48 commit c08d41e
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 17 deletions.
17 changes: 13 additions & 4 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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` &&
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.59 )

AC_INIT(
[libvmdk],
[20190310],
[20190316],
[joachim.metz@gmail.com])

AC_CONFIG_SRCDIR(
Expand Down
26 changes: 14 additions & 12 deletions m4/python.m4
Original file line number Diff line number Diff line change
@@ -1,24 +1,20 @@
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#.#"
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],
Expand Down Expand Up @@ -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])
Expand Down Expand Up @@ -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],
Expand All @@ -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])
Expand All @@ -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])
Expand Down Expand Up @@ -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])
Expand Down
7 changes: 7 additions & 0 deletions tests/vmdk_test_macros.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 ) \
{ \
Expand Down

0 comments on commit c08d41e

Please sign in to comment.