Add test wrapper to work around PYTHONPATH

Change-Id: I39df23800a583aa09ade7c8e544257fe602fc669
This commit is contained in:
Peter Balland 2013-08-13 14:12:38 -07:00
parent d512189d22
commit 1c796ccec4
3 changed files with 23 additions and 1 deletions

2
README
View File

@ -15,5 +15,5 @@ Copyright (c) 2013 VMware, Inc. All rights reserved.
3. Run the unit tests
- from the root directory
nosetests
./scripts/run_tests

20
scripts/run_tests Executable file
View File

@ -0,0 +1,20 @@
#!/bin/sh
# Copyright (c) 2013 VMware, Inc. All rights reserved.
#
# Usage: run_tests
# TODO(pjb): Run from a build (rather than source) dir
SRCSCRIPT=`readlink -f $0`
SCRIPTDIR=`dirname $SRCSCRIPT`
ROOTDIR=`dirname $SCRIPTDIR`
PYSRCDIR=$ROOTDIR/src
THIRDPARTYDIR=$ROOTDIR/thirdparty
export PYTHONPATH=$SRCDIR:$THIRDPARTYDIR
# Use nosetests to find all unitests in tree
ARGS="$@"
cd $ROOTDIR
nosetests $ARGS

View File

@ -3,6 +3,8 @@
import unittest
from policy import CongressParser
class TestCompiler(unittest.TestCase):