From e8334afd7f2920b706a3d28250a3e2b6dbd49538 Mon Sep 17 00:00:00 2001 From: valmat Date: Tue, 18 Mar 2014 15:18:11 +0600 Subject: Unit tests. For description see https://github.com/CopernicaMarketingSoftware/PHP-CPP/pull/25#issuecomment-37882236 --- tests/prepare.sh | 44 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100755 tests/prepare.sh (limited to 'tests/prepare.sh') diff --git a/tests/prepare.sh b/tests/prepare.sh new file mode 100755 index 0000000..e052c72 --- /dev/null +++ b/tests/prepare.sh @@ -0,0 +1,44 @@ +#!/bin/bash +# +# do not run this script. +# Create a local copy of the directory with the extension for run without installation +# + + +EXTDLOC=ext_dir +SO=extfortest.so + +EXTDIR=$(php-config --extension-dir) + +#echo $EXTDIR + +mkdir -p "./$EXTDLOC" +for LIBFILE in `find $EXTDIR -type f -or -type l -name "*.so"`; do + + BN=$(basename $LIBFILE) + PWD=$(pwd) + NF="$PWD/$EXTDLOC/$BN" + + # if still no exist + if [ ! -L $NF ]; + then + if [ -L $LIBFILE ]; + then + #echo "cp $LIBFILE $NF" + cp --no-dereference $LIBFILE $NF + else + ln -s $LIBFILE $NF + fi + else + : + fi; +done + +# current extention +if [ ! -L "$PWD/$EXTDLOC/$SO" ]; +then + ln -s "$PWD/cpp/$SO" "$PWD/$EXTDLOC/$SO" +fi + + + -- cgit v1.2.3