~ubuntu-branches/ubuntu/utopic/xen/utopic

« back to all changes in this revision

Viewing changes to tools/tests/regression/scripts/check_python_syntax.sh

  • Committer: Bazaar Package Importer
  • Author(s): Bastian Blank
  • Date: 2010-05-06 15:47:38 UTC
  • mto: (1.3.1) (15.1.1 sid) (4.1.1 experimental)
  • mto: This revision was merged to the branch mainline in revision 3.
  • Revision ID: james.westby@ubuntu.com-20100506154738-agoz0rlafrh1fnq7
Tags: upstream-4.0.0
ImportĀ upstreamĀ versionĀ 4.0.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!/bin/bash
 
2
#
 
3
# Checks the syntax of all .py files
 
4
# (compiles them into .pyc files)
 
5
#
 
6
 
 
7
REG_TEST_DIR=$1
 
8
# Python version, e.g. python-2.3
 
9
PYTHON=$2
 
10
PATH_TO_CHECK=$3
 
11
 
 
12
echo "Syntax check for $PYTHON"
 
13
PYTHON_EXECUTABLE=`echo $PYTHON | tr -d "-"`
 
14
export LD_LIBRARY_PATH=${REG_TEST_DIR}/installed/$PYTHON/lib
 
15
export PATH=${REG_TEST_DIR}/installed/$PYTHON/bin:$PATH
 
16
 
 
17
# -m is available starting with python 2.4
 
18
# When support for 2.3 (and earlier) is dropped,
 
19
# the following line will do.
 
20
# ${PYTHON_EXECUTABLE} -m compileall -f -q -x ".*\.hg.*|.*/tools/tests/regression/installed.*" ${PATH_TO_CHECK}
 
21
${PYTHON_EXECUTABLE} ${REG_TEST_DIR}/installed/$PYTHON/lib/${PYTHON_EXECUTABLE}/compileall.py -f -q -x ".*\.hg.*|.*/installed/python-.*" ${PATH_TO_CHECK}
 
22
exit $?