[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] [xen-unstable] tools/tests/regression/: Fix some paths and scripts.



# HG changeset patch
# User Keir Fraser <keir.fraser@xxxxxxxxxx>
# Date 1249212123 -3600
# Node ID c5d518a7c1a9a8d861c13ff5fca327c1c2c27fdd
# Parent  e6c966b3a4d8ceb8040c1a43264813a0fe1c1392
tools/tests/regression/: Fix some paths and scripts.

o scripts and Makefile are mostly location independent now
  (exception XEN_ROOT in Makefile)
o use of $() instead of ${} in Makefile

From: Andreas Florath <xen@xxxxxxxxxxxx>
Signed-off-by: Keir Fraser <Keir.Fraser@xxxxxxxxxxxxx>
---
 tools/tests/regression/Makefile                       |   84 ++++++++++--------
 tools/tests/regression/scripts/build_python.sh        |    8 -
 tools/tests/regression/scripts/check_python_syntax.sh |   19 ++--
 tools/tests/regression/scripts/download_python.sh     |    6 -
 4 files changed, 66 insertions(+), 51 deletions(-)

diff -r e6c966b3a4d8 -r c5d518a7c1a9 tools/tests/regression/Makefile
--- a/tools/tests/regression/Makefile   Thu Jul 30 17:56:23 2009 +0100
+++ b/tools/tests/regression/Makefile   Sun Aug 02 12:22:03 2009 +0100
@@ -5,7 +5,8 @@
 # To run this, at least the basic build / development environment must
 # be installed (gcc, ...)
 #
-XEN_ROOT=${PWD}/..
+XEN_ROOT=$(PWD)/../../..
+REG_TEST_DIR=$(PWD)
 
 PYTHON_VERSIONS=python-2.3 python-2.4 python-2.5 python-2.6 python-3.1
 
@@ -14,70 +15,81 @@ all: check-python-syntax
 
 .PHONY: check-python-syntax
 check-python-syntax: runtime-environment
-       @(set -e && for p in ${PYTHON_VERSIONS}; do \
-         ${XEN_ROOT}/tests/scripts/check_python_syntax.sh ${XEN_ROOT} $$p; 
done)
+       @(set -e && for p in $(PYTHON_VERSIONS); do \
+         /bin/sh $(REG_TEST_DIR)/scripts/check_python_syntax.sh \
+               $(REG_TEST_DIR) $$p $(XEN_ROOT); done)
 
 .PHONY: runtime-environment
-runtime-environment: ${PYTHON_VERSIONS}
+runtime-environment: $(PYTHON_VERSIONS)
 
 .PHONY: dist-clean
 dist-clean:
-       rm -fr ${XEN_ROOT}/tests/installed ${XEN_ROOT}/tests/downloads \
-               ${XEN_ROOT}/tests/build
+       rm -fr $(REG_TEST_DIR)/installed $(REG_TEST_DIR)/downloads \
+               $(REG_TEST_DIR)/build
 
 ### Python 2.3
 
 .PHONY: python-2.3
-python-2.3: ${XEN_ROOT}/tests/installed/python-2.3/bin/python2.3
+python-2.3: $(REG_TEST_DIR)/installed/python-2.3/bin/python2.3
 
-${XEN_ROOT}/tests/installed/python-2.3/bin/python2.3: \
-       ${XEN_ROOT}/tests/downloads/Python-2.3.7.tgz
-       @${XEN_ROOT}/tests/scripts/build_python.sh ${XEN_ROOT} 2.3 2.3.7
-${XEN_ROOT}/tests/downloads/Python-2.3.7.tgz:
-       @${XEN_ROOT}/tests/scripts/download_python.sh ${XEN_ROOT} 2.3.7
+$(REG_TEST_DIR)/installed/python-2.3/bin/python2.3: \
+       $(REG_TEST_DIR)/downloads/Python-2.3.7.tgz
+       @/bin/sh $(REG_TEST_DIR)/scripts/build_python.sh \
+               $(REG_TEST_DIR) 2.3 2.3.7
+$(REG_TEST_DIR)/downloads/Python-2.3.7.tgz:
+       @/bin/sh $(REG_TEST_DIR)/scripts/download_python.sh \
+               $(REG_TEST_DIR) 2.3.7
 
 ### Python 2.4
 
 .PHONY: python-2.4
-python-2.4: ${XEN_ROOT}/tests/installed/python-2.4/bin/python2.4
+python-2.4: $(REG_TEST_DIR)/installed/python-2.4/bin/python2.4
 
-${XEN_ROOT}/tests/installed/python-2.4/bin/python2.4: \
-       ${XEN_ROOT}/tests/downloads/Python-2.4.6.tgz
-       @${XEN_ROOT}/tests/scripts/build_python.sh ${XEN_ROOT} 2.4 2.4.6
-${XEN_ROOT}/tests/downloads/Python-2.4.6.tgz:
-       @${XEN_ROOT}/tests/scripts/download_python.sh ${XEN_ROOT} 2.4.6
+$(REG_TEST_DIR)/installed/python-2.4/bin/python2.4: \
+       $(REG_TEST_DIR)/downloads/Python-2.4.6.tgz
+       @/bin/sh $(REG_TEST_DIR)/scripts/build_python.sh \
+               $(REG_TEST_DIR) 2.4 2.4.6
+$(REG_TEST_DIR)/downloads/Python-2.4.6.tgz:
+       @/bin/sh $(REG_TEST_DIR)/scripts/download_python.sh \
+               $(REG_TEST_DIR) 2.4.6
 
 ### Python 2.5
 
 .PHONY: python-2.5
-python-2.5: ${XEN_ROOT}/tests/installed/python-2.5/bin/python2.5
+python-2.5: $(REG_TEST_DIR)/installed/python-2.5/bin/python2.5
 
-${XEN_ROOT}/tests/installed/python-2.5/bin/python2.5: \
-       ${XEN_ROOT}/tests/downloads/Python-2.5.4.tgz
-       @${XEN_ROOT}/tests/scripts/build_python.sh ${XEN_ROOT} 2.5 2.5.4
-${XEN_ROOT}/tests/downloads/Python-2.5.4.tgz:
-       @${XEN_ROOT}/tests/scripts/download_python.sh ${XEN_ROOT} 2.5.4
+$(REG_TEST_DIR)/installed/python-2.5/bin/python2.5: \
+       $(REG_TEST_DIR)/downloads/Python-2.5.4.tgz
+       @/bin/sh $(REG_TEST_DIR)/scripts/build_python.sh \
+               $(REG_TEST_DIR) 2.5 2.5.4
+$(REG_TEST_DIR)/downloads/Python-2.5.4.tgz:
+       @/bin/sh $(REG_TEST_DIR)/scripts/download_python.sh \
+               $(REG_TEST_DIR) 2.5.4
 
 ### Python 2.6
 
 .PHONY: python-2.6
-python-2.6: ${XEN_ROOT}/tests/installed/python-2.6/bin/python2.6
+python-2.6: $(REG_TEST_DIR)/installed/python-2.6/bin/python2.6
 
-${XEN_ROOT}/tests/installed/python-2.6/bin/python2.6: \
-       ${XEN_ROOT}/tests/downloads/Python-2.6.2.tgz
-       @${XEN_ROOT}/tests/scripts/build_python.sh ${XEN_ROOT} 2.6 2.6.2
-${XEN_ROOT}/tests/downloads/Python-2.6.2.tgz:
-       @${XEN_ROOT}/tests/scripts/download_python.sh ${XEN_ROOT} 2.6.2
+$(REG_TEST_DIR)/installed/python-2.6/bin/python2.6: \
+       $(REG_TEST_DIR)/downloads/Python-2.6.2.tgz
+       @/bin/sh $(REG_TEST_DIR)/scripts/build_python.sh \
+               $(REG_TEST_DIR) 2.6 2.6.2
+$(REG_TEST_DIR)/downloads/Python-2.6.2.tgz:
+       @/bin/sh $(REG_TEST_DIR)/scripts/download_python.sh \
+               $(REG_TEST_DIR) 2.6.2
 
 ### Python 3.0.1 has reached end of life and is not (longer) supported
 
 ### Python 3.1
 
 .PHONY: python-3.1
-python-3.1: ${XEN_ROOT}/tests/installed/python-3.1/bin/python3.1
+python-3.1: $(REG_TEST_DIR)/installed/python-3.1/bin/python3.1
 
-${XEN_ROOT}/tests/installed/python-3.1/bin/python3.1: \
-       ${XEN_ROOT}/tests/downloads/Python-3.1.tgz
-       @${XEN_ROOT}/tests/scripts/build_python.sh ${XEN_ROOT} 3.1 3.1
-${XEN_ROOT}/tests/downloads/Python-3.1.tgz:
-       @${XEN_ROOT}/tests/scripts/download_python.sh ${XEN_ROOT} 3.1
+$(REG_TEST_DIR)/installed/python-3.1/bin/python3.1: \
+       $(REG_TEST_DIR)/downloads/Python-3.1.tgz
+       @/bin/sh $(REG_TEST_DIR)/scripts/build_python.sh \
+               $(REG_TEST_DIR) 3.1 3.1
+$(REG_TEST_DIR)/downloads/Python-3.1.tgz:
+       @/bin/sh $(REG_TEST_DIR)/scripts/download_python.sh \
+               $(REG_TEST_DIR) 3.1
diff -r e6c966b3a4d8 -r c5d518a7c1a9 
tools/tests/regression/scripts/build_python.sh
--- a/tools/tests/regression/scripts/build_python.sh    Thu Jul 30 17:56:23 
2009 +0100
+++ b/tools/tests/regression/scripts/build_python.sh    Sun Aug 02 12:22:03 
2009 +0100
@@ -6,19 +6,19 @@
 
 set -e
 
-XEN_ROOT=$1
+REG_TEST_DIR=$1
 DEST=$2
 PKG_VERS=$3
 
 SUB_MAKES_MINUS_J=-j4
 
-BUILD_DIR=${XEN_ROOT}/tests/build
+BUILD_DIR=${REG_TEST_DIR}/build
 
 mkdir -p ${BUILD_DIR}
-(cd ${BUILD_DIR} && tar -xf ${XEN_ROOT}/tests/downloads/Python-$PKG_VERS.tgz)
+(cd ${BUILD_DIR} && tar -xf ${REG_TEST_DIR}/downloads/Python-$PKG_VERS.tgz)
 (cd ${BUILD_DIR}/Python-$PKG_VERS &&
  ./configure --enable-shared --enable-ipv6 --without-cxx \
-       --with-threads --prefix=${XEN_ROOT}/tests/installed/python-$DEST &&
+       --with-threads --prefix=${REG_TEST_DIR}/installed/python-$DEST &&
 make ${SUB_MAKES_MINUS_J} &&
 make install)
 rm -fr ${BUILD_DIR}/Python-$PKG_VERS
diff -r e6c966b3a4d8 -r c5d518a7c1a9 
tools/tests/regression/scripts/check_python_syntax.sh
--- a/tools/tests/regression/scripts/check_python_syntax.sh     Thu Jul 30 
17:56:23 2009 +0100
+++ b/tools/tests/regression/scripts/check_python_syntax.sh     Sun Aug 02 
12:22:03 2009 +0100
@@ -4,16 +4,19 @@
 # (compiles them into .pyc files)
 #
 
-XEN_ROOT=$1
-p=$2
+REG_TEST_DIR=$1
+# Python version, e.g. python-2.3
+PYTHON=$2
+PATH_TO_CHECK=$3
 
-echo "Syntax check for $p"
-PYTHON_EXECUTABLE=`echo $p | tr -d "-"`
-export LD_LIBRARY_PATH=${XEN_ROOT}/tests/installed/$p/lib
-export PATH=${XEN_ROOT}/tests/installed/$p/bin:$PATH
+echo "Syntax check for $PYTHON"
+PYTHON_EXECUTABLE=`echo $PYTHON | tr -d "-"`
+export LD_LIBRARY_PATH=${REG_TEST_DIR}/installed/$PYTHON/lib
+export PATH=${REG_TEST_DIR}/installed/$PYTHON/bin:$PATH
+
 # -m is available starting with python 2.4
 # When support for 2.3 (and earlier) is dropped,
 # the following line will do.
-# ${PYTHON_EXECUTABLE} -m compileall -f -q -x 
".*\.hg.*|^\.\./tests/installed.*" ..
-${PYTHON_EXECUTABLE} 
${XEN_ROOT}/tests/installed/$p/lib/${PYTHON_EXECUTABLE}/compileall.py -f -q -x 
".*\.hg.*|.*/tests/installed.*" ..
+# ${PYTHON_EXECUTABLE} -m compileall -f -q -x 
".*\.hg.*|.*/tools/tests/regression/installed.*" ${PATH_TO_CHECK}
+${PYTHON_EXECUTABLE} 
${REG_TEST_DIR}/installed/$PYTHON/lib/${PYTHON_EXECUTABLE}/compileall.py -f -q 
-x ".*\.hg.*|.*/installed/python-.*" ${PATH_TO_CHECK}
 exit $?
diff -r e6c966b3a4d8 -r c5d518a7c1a9 
tools/tests/regression/scripts/download_python.sh
--- a/tools/tests/regression/scripts/download_python.sh Thu Jul 30 17:56:23 
2009 +0100
+++ b/tools/tests/regression/scripts/download_python.sh Sun Aug 02 12:22:03 
2009 +0100
@@ -5,8 +5,8 @@
 
 set -e
 
-XEN_ROOT=$1
+REG_TEST_DIR=$1
 VERSION=$2
 
-mkdir -p ${XEN_ROOT}/tests/downloads
-wget -q -O ${XEN_ROOT}/tests/downloads/Python-${VERSION}.tgz 
http://www.python.org/ftp/python/${VERSION}/Python-${VERSION}.tgz
+mkdir -p ${REG_TEST_DIR}/downloads
+wget -q -O ${REG_TEST_DIR}/downloads/Python-${VERSION}.tgz 
http://www.python.org/ftp/python/${VERSION}/Python-${VERSION}.tgz

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.