Add test wrapper to work around PYTHONPATH
Change-Id: I39df23800a583aa09ade7c8e544257fe602fc669
This commit is contained in:
parent
d512189d22
commit
1c796ccec4
2
README
2
README
|
@ -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
|
||||
|
||||
|
|
|
@ -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
|
|
@ -3,6 +3,8 @@
|
|||
|
||||
import unittest
|
||||
|
||||
from policy import CongressParser
|
||||
|
||||
|
||||
class TestCompiler(unittest.TestCase):
|
||||
|
||||
|
|
Loading…
Reference in New Issue