[prev in list] [next in list] [prev in thread] [next in thread]
List: ltp-cvs
Subject: [Ltp-cvs] ltp/testscripts/build build_test_function.sh, 1.1,
From: Garrett Cooper <yaberauneya () users ! sourceforge ! net>
Date: 2010-01-29 9:41:25
Message-ID: E1NanLx-0001Dx-1G () sfp-cvsdas-2 ! v30 ! ch3 ! sourceforge ! com
[Download RAW message or body]
Update of /cvsroot/ltp/ltp/testscripts/build
In directory sfp-cvsdas-2.v30.ch3.sourceforge.com:/tmp/cvs-serv4214/testscripts/build
Modified Files:
build_test_function.sh test_install_in_build_tree.sh
test_install_out_of_build_tree.sh test_out_of_build_tree.sh
Log Message:
1. env_pre.mk: Add additional build-tree states and unify them under the \
$(BUILD_TREE_STATE) variable. 2. Makefile: Resolve issue spotted by Mitani-san \
because it was an overlooked corner case that wasn't properly expressed until \
$(BUILD_TREE_STATE) was introduced. 3. testscripts/... : resolve some issues with the \
test scripts.
Signed-off-by: Garrett Cooper <yanegomi@gmail.com>
Index: test_install_in_build_tree.sh
===================================================================
RCS file: /cvsroot/ltp/ltp/testscripts/build/test_install_in_build_tree.sh,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** test_install_in_build_tree.sh 28 Jan 2010 15:16:47 -0000 1.2
--- test_install_in_build_tree.sh 29 Jan 2010 09:41:22 -0000 1.3
***************
*** 37,39 ****
install_ltp "$srcdir" "$srcdir" ""
# 5. Test.
! test_ltp "$install_dir"
--- 37,39 ----
install_ltp "$srcdir" "$srcdir" ""
# 5. Test.
! test_ltp ""
Index: test_out_of_build_tree.sh
===================================================================
RCS file: /cvsroot/ltp/ltp/testscripts/build/test_out_of_build_tree.sh,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** test_out_of_build_tree.sh 28 Jan 2010 15:16:47 -0000 1.2
--- test_out_of_build_tree.sh 29 Jan 2010 09:41:22 -0000 1.3
***************
*** 31,39 ****
pull_scm cvs "$tmp_srcdir"
# 2. Configure.
! configure "$srcdir" "$tmp_builddir" "$prefix" "$destdir"
# 3. -->> Compile out-of-build-tree. <<--
build "$srcdir" "$tmp_builddir"
# 4. Install.
! install_ltp "$srcdir" "$tmp_builddir" "$destdir"
# 5. Test.
! test_ltp "$install_dir"
--- 31,39 ----
pull_scm cvs "$tmp_srcdir"
# 2. Configure.
! configure "$srcdir" "$tmp_builddir" "$tmp_prefix" "$tmp_destdir"
# 3. -->> Compile out-of-build-tree. <<--
build "$srcdir" "$tmp_builddir"
# 4. Install.
! install_ltp "$srcdir" "$tmp_builddir" "$tmp_destdir"
# 5. Test.
! test_ltp "$("$abspath" "$tmp_destdir/${tmp_prefix:-/opt/ltp}")"
Index: build_test_function.sh
===================================================================
RCS file: /cvsroot/ltp/ltp/testscripts/build/build_test_function.sh,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** build_test_function.sh 28 Jan 2010 15:14:13 -0000 1.1
--- build_test_function.sh 29 Jan 2010 09:41:22 -0000 1.2
***************
*** 31,38 ****
fi
if tmp_destdir=$(mktemp -d) ; then
! vars="$vars $destdir"
else
tst_brkm tst_exit TBROK 'Failed to create tmp_destdir';
fi
if tmp_srcdir=$(mktemp -d) ; then
vars="$vars $tmp_srcdir"
--- 31,43 ----
fi
if tmp_destdir=$(mktemp -d) ; then
! vars="$vars $tmp_destdir"
else
tst_brkm tst_exit TBROK 'Failed to create tmp_destdir';
fi
+ if tmp_prefix=$(mktemp -d) ; then
+ vars="$vars $tmp_prefix"
+ else
+ tst_brkm tst_exit TBROK 'Failed to create tmp_prefix';
+ fi
if tmp_srcdir=$(mktemp -d) ; then
vars="$vars $tmp_srcdir"
***************
*** 41,50 ****
fi
trap cleanup EXIT
}
cleanup() {
! cd /
! trap '' EXIT
! rm -Rf $vars
}
--- 46,68 ----
fi
trap cleanup EXIT
+ cat <<EOF
+ ================================
+ SUMMARY OF VARIABLES:
+ ================================
+ builddir -> $tmp_builddir
+ destdir -> $tmp_destdir
+ prefix -> $tmp_prefix
+ srcdir -> $tmp_srcdir
+ ================================
+ EOF
+
}
cleanup() {
! if [ "x${NO_CLEAN:-0}" != 1 ] ; then
! cd /
! trap '' EXIT
! rm -Rf $vars
! fi
}
***************
*** 54,58 ****
export CVSROOT=:pserver:anonymous@ltp.cvs.sourceforge.net:/cvsroot/ltp
! if ([ -f ~/.cvspass ] || touch ~/.cvspass) ; then
cvs -d$CVSROOT login && cvs -z3 export -f -r HEAD ltp && srcdir="$PWD/ltp"
fi
--- 72,76 ----
export CVSROOT=:pserver:anonymous@ltp.cvs.sourceforge.net:/cvsroot/ltp
! if ( [ -f ~/.cvspass ] || touch ~/.cvspass ) ; then
cvs -d$CVSROOT login && cvs -z3 export -f -r HEAD ltp && srcdir="$PWD/ltp"
fi
***************
*** 88,100 ****
# global and thus I won't need to include the same checks down below...
configure() {
abspath=$(readlink -f "$testscript_dir/../../scripts/abspath.sh")
if [ "x$2" != x ] ; then
(test -d "$2" || mkdir -p "$2") || return $?
fi
make -C "$1" autotools || return $?
! ARGS=
! [ "x$3" != x ] && ARGS="--prefix=$("$abspath" $3)"
! cd "$2" && "$1/configure" $ARGS
! install_dir=$("$abspath" "$4/$3")
}
--- 106,120 ----
# global and thus I won't need to include the same checks down below...
configure() {
+
abspath=$(readlink -f "$testscript_dir/../../scripts/abspath.sh")
+
if [ "x$2" != x ] ; then
(test -d "$2" || mkdir -p "$2") || return $?
fi
+
make -C "$1" autotools || return $?
!
! cd "$2" && "$1/configure" ${3:+--prefix=$("$abspath" $3)}
!
}
***************
*** 104,108 ****
# 2 - build directory
build() {
! make ${2:--C "$2"} ${1:-top_srcdir=$1} all
}
--- 124,131 ----
# 2 - build directory
build() {
! make ${2:+-C "$2"} \
! ${1:+-f "$1/Makefile" "top_srcdir=$1"} \
! ${2:+"top_builddir=$2"} \
! all
}
***************
*** 111,122 ****
# 1 - source directory
# 2 - build directory
install_ltp() {
! make ${2:--C "$2"} ${1:-top_srcdir=$1} install
}
# Run a test on the installed tree.
#
! # 1 install directory - installed tree, e.g. $(DESTDIR)/$(prefix)
test_ltp() {
# XXX (garrcoop): I haven't tracked down the root cause for the
# issue, but some versions of sed combined with some terminal
--- 134,153 ----
# 1 - source directory
# 2 - build directory
+ # 3 - DESTDIR
install_ltp() {
! make ${2:+-C "$2"} \
! ${1:+-f "$1/Makefile" "top_srcdir=$1"} \
! ${2:+"top_builddir=$2"} \
! ${3:+"DESTDIR=$3"} \
! install
}
# Run a test on the installed tree.
#
! # 1 - install directory for tree, e.g. $(DESTDIR)/$(prefix)
test_ltp() {
+
+ [ "x${1}" != x ] && export LTPROOT="$1"
+
# XXX (garrcoop): I haven't tracked down the root cause for the
# issue, but some versions of sed combined with some terminal
***************
*** 124,127 ****
# platforms when executing runltp. Thus, we should effectively close
# /dev/stdin before executing runltp via execltp.
! cd "$1" && "$1/bin/execltp" < /dev/null
}
--- 155,159 ----
# platforms when executing runltp. Thus, we should effectively close
# /dev/stdin before executing runltp via execltp.
! "${1:-.}/bin/execltp" -v < /dev/null
!
}
Index: test_install_out_of_build_tree.sh
===================================================================
RCS file: /cvsroot/ltp/ltp/testscripts/build/test_install_out_of_build_tree.sh,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** test_install_out_of_build_tree.sh 28 Jan 2010 15:16:47 -0000 1.2
--- test_install_out_of_build_tree.sh 29 Jan 2010 09:41:22 -0000 1.3
***************
*** 1,5 ****
#!/bin/sh
#
! # install outside build-tree script.
#
# Copyright (C) 2010, Cisco Systems Inc.
--- 1,5 ----
#!/bin/sh
#
! # build / install outside build-tree script.
#
# Copyright (C) 2010, Cisco Systems Inc.
***************
*** 31,39 ****
pull_scm cvs "$tmp_srcdir"
# 2. Configure.
! configure "$srcdir" "$srcdir" "$prefix" "$destdir"
# 3. -->> Compile out-of-build-tree. <<--
build "$srcdir" "$srcdir"
# 4. Install.
! install_ltp "$srcdir" "$srcdir" "$destdir"
# 5. Test.
! test_ltp "$install_dir"
--- 31,39 ----
pull_scm cvs "$tmp_srcdir"
# 2. Configure.
! configure "$srcdir" "$srcdir" "$tmp_prefix" "$tmp_destdir"
# 3. -->> Compile out-of-build-tree. <<--
build "$srcdir" "$srcdir"
# 4. Install.
! install_ltp "$srcdir" "$srcdir" "$tmp_destdir"
# 5. Test.
! test_ltp "$("$abspath" "$tmp_destdir/${tmp_prefix:-/opt/ltp}")"
------------------------------------------------------------------------------
The Planet: dedicated and managed hosting, cloud storage, colocation
Stay online with enterprise data centers and the best network in the business
Choose flexible plans and management services without long-term contracts
Personal 24x7 support from experience hosting pros just a phone call away.
http://p.sf.net/sfu/theplanet-com
_______________________________________________
Ltp-cvs mailing list
Ltp-cvs@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-cvs
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic