diff options
Diffstat (limited to '')
-rwxr-xr-x | bin/run-python-test-osx.sh | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/bin/run-python-test-osx.sh b/bin/run-python-test-osx.sh new file mode 100755 index 0000000..d2d40b8 --- /dev/null +++ b/bin/run-python-test-osx.sh @@ -0,0 +1,36 @@ +#!/usr/bin/env bash + +# I have to write this wrapper for OSX because ixion.so module is hardcoded to +# find libixion-<version>.dylib to the installed location, and the only way to +# have it use libixion-<version>.dylib in src/libixion/.libs is to physically +# re-write the path in ixion.so. + +PROGDIR=$(dirname $0) +source $PROGDIR/env.sh + +TESTPYTHONPATH=$PROGDIR/../src/python/.test +PYTESTFILEDIR=$PROGDIR/../test/python + +# Copy ixion.so into the special test directory. +mkdir -p $TESTPYTHONPATH +cp $PROGDIR/../src/python/.libs/ixion.so $TESTPYTHONPATH/ + +echo "library installation directory: $IXION_INSTLIBDIR" +echo "library base name: $IXION_LIBNAME" + +# Re-write the path to libixion.dylib in ixion.so. +install_name_tool -change \ + $IXION_INSTLIBDIR/$IXION_LIBNAME.dylib \ + $PROGDIR/../src/libixion/.libs/$IXION_LIBNAME.dylib \ + $TESTPYTHONPATH/ixion.so + +# Use that ixion.so module to run the tests. +export PYTHONPATH=$TESTPYTHONPATH + +TESTS=$(ls $PYTESTFILEDIR/*.py) + +for _file in $TESTS; do + echo running $_file... + $_file +done + |