You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucy.apache.org by ma...@apache.org on 2014/08/25 04:13:02 UTC
git commit: refs/heads/simplify_release_vetting - Fix and update
test_all.sh.
Repository: lucy
Updated Branches:
refs/heads/simplify_release_vetting [created] 729603df6
Fix and update test_all.sh.
* Perform a `git clone` of Clownfish and build on the spot. Allow the
option of specifying a local repo with CLOWNFISH environment var.
* Hide Clownfish build output unless it fails.
* Improve summary.
* Perform a local installation of Clownfish and CFC when testing the
Perl bindings.
Project: http://git-wip-us.apache.org/repos/asf/lucy/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucy/commit/729603df
Tree: http://git-wip-us.apache.org/repos/asf/lucy/tree/729603df
Diff: http://git-wip-us.apache.org/repos/asf/lucy/diff/729603df
Branch: refs/heads/simplify_release_vetting
Commit: 729603df62f77a358b3e17c41f44a6c683ffddd6
Parents: 481653b
Author: Marvin Humphrey <ma...@rectangular.com>
Authored: Sun Aug 24 19:08:32 2014 -0700
Committer: Marvin Humphrey <ma...@rectangular.com>
Committed: Sun Aug 24 19:08:32 2014 -0700
----------------------------------------------------------------------
devel/bin/test_all.sh | 134 ++++++++++++++++++++++++++++++++-------------
1 file changed, 97 insertions(+), 37 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/lucy/blob/729603df/devel/bin/test_all.sh
----------------------------------------------------------------------
diff --git a/devel/bin/test_all.sh b/devel/bin/test_all.sh
index c3ffa2e..63ae008 100755
--- a/devel/bin/test_all.sh
+++ b/devel/bin/test_all.sh
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!/bin/bash
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
@@ -15,45 +15,105 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-if test ! -f devel/bin/test_all.sh
-then
- echo Error: can only run from root dir of repository
+if [ ! -e LICENSE ]; then
+ echo "$0 must be run from the top level of the Lucy repository"
exit 1
fi
+export TOPLEVEL=`pwd`
-# C
-cd clownfish/compiler/c
-./configure && make -j && make -j test
-C_CFC_RESULT=$?
-cd ../../runtime/c
-./configure && make -j && make -j test
-C_CFISH_RUNTIME_RESULT=$?
-cd ../../../c
-./configure && make -j && make -j test
-C_LUCY_RESULT=$?
-make distclean
-
-# Perl
-cd ../clownfish/compiler/perl
-perl Build.PL && ./Build test
-PERL_CFC_RESULT=$?
-cd ../../runtime/perl
-perl Build.PL && ./Build test
-PERL_CFISH_RUNTIME_RESULT=$?
-cd ../../../perl
-perl Build.PL && ./Build test
-PERL_LUCY_RESULT=$?
-./Build realclean
-
-# Exit with a failing value if any test failed.
-if [ $C_CFC_RESULT -ne 0 ] \
- || [ $C_CFISH_RUNTIME_RESULT -ne 0 ] \
- || [ $C_LUCY_RESULT -ne 0 ] \
- || [ $PERL_CFC_RESULT -ne 0 ] \
- || [ $PERL_CFISH_RUNTIME_RESULT -ne 0 ] \
- || [ $PERL_LUCY_RESULT -ne 0 ]
-then
+echo "==============================="
+echo "Test all host bindings for Lucy"
+echo "==============================="
+echo
+
+# Exit status codes indicating that the target has built and tested
+# successfully.
+LUCY_C_STATUS=1
+LUCY_PERL_STATUS=1
+
+# Make a shallow clone of the clownfish repo.
+if [ -z "$CLOWNFISH" ]; then
+ export CLOWNFISH=https://git-wip-us.apache.org/repos/asf/lucy-clownfish.git
+fi
+git clone --depth=1 $CLOWNFISH clownfish
+if [ $? -ne 0 ]; then
+ echo FATAL: failed to clone Clownfish repository.
exit 1
fi
-exit 0
+source $TOPLEVEL/clownfish/devel/bin/setup_env.sh
+export CFLOG=$TOPLEVEL/clownfish.build.log
+rm -f $CFLOG
+
+# C bindings
+echo "Building and testing Clownfish dependencies for Lucy C bindings..."
+cd $TOPLEVEL/clownfish/compiler/c
+./configure >> $CFLOG && make -j >> $CFLOG && make -j test >> $CFLOG
+CFC_C_STATUS=$?
+cd $TOPLEVEL/clownfish/runtime/c
+./configure >> $CFLOG && make -j >> $CFLOG && make -j test >> $CFLOG
+CFRUNTIME_C_STATUS=$?
+if [ $CFC_C_STATUS -ne 0 ] || [ $CFRUNTIME_C_STATUS -ne 0 ]; then
+ cat $CFLOG
+ echo "Clownfish C build failed -- skipping Lucy C bindings."
+else
+ echo "Clownfish C build succeeded."
+ cd $TOPLEVEL/c
+ ./configure && make -j && make -j test
+ LUCY_C_STATUS=$?
+ make distclean
+ cd $TOPLEVEL/clownfish/runtime/c
+ make distclean
+fi
+
+## Perl bindings
+cd $TOPLEVEL
+echo "Building and testing Clownfish dependencies for Lucy Perl bindings..."
+rm -f $CFLOG
+mkdir perl5lib
+cd $TOPLEVEL/clownfish/compiler/perl
+perl Build.PL --install_base=$TOPLEVEL/perl5lib >> $CFLOG \
+ && ./Build test >> $CFLOG \
+ && ./Build install >> $CFLOG
+./Build realclean >> $CFLOG
+cd $TOPLEVEL/clownfish/runtime/perl
+perl Build.PL --install_base=$TOPLEVEL/perl5lib >> $CFLOG \
+ && ./Build test >> $CFLOG \
+ && ./Build install >> $CFLOG
+CFRESULT=$?
+./Build realclean >> $CFLOG
+if [ $CFRESULT -ne 0 ]; then
+ cat $CFLOG
+ echo "Clownfish Perl build failed -- skipping Lucy Perl bindings."
+else
+ echo "Clownfish Perl build succeeded."
+ cd $TOPLEVEL/perl
+ export PERL5LIB=$TOPLEVEL/perl5lib/lib/perl5
+ perl Build.PL
+ ./Build test
+ LUCY_PERL_STATUS=$?
+ ./Build realclean
+fi
+rm -rf $TOPLEVEL/perl5lib
+
+# Clean up.
+rm -rf $TOPLEVEL/clownfish
+rm -f $CFLOG
+
+# Print report and exit.
+RESULT=0
+function check_target {
+ if [ $2 == 0 ]; then
+ echo "Success:" $1
+ else
+ echo "FAIL: " $1
+ RESULT=1
+ fi
+}
+echo "==============================="
+echo " Test results "
+echo "==============================="
+check_target "c" $LUCY_C_STATUS
+check_target "perl" $LUCY_PERL_STATUS
+exit $RESULT
+