Skip to content

Commit

Permalink
rundevel.py: add src to PYTHONPATH
Browse files Browse the repository at this point in the history
  • Loading branch information
pekkaklarck committed Nov 9, 2015
1 parent cb812ae commit 3abd04a
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions rundevel.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
sys.exit(__doc__)

curdir = dirname(abspath(__file__))
src = join(curdir, 'src')
tmp = join(curdir, 'tmp')
tmp2 = join(tmp, 'rundevel')
if not exists(tmp):
Expand All @@ -30,9 +31,13 @@

os.environ['ROBOT_SYSLOG_FILE'] = join(tmp, 'syslog.txt')
os.environ['ROBOT_INTERNAL_TRACES'] = 'yes'
os.environ['TEMPDIR'] = tmp2 # Used by tests under atest/testdata
os.environ['TEMPDIR'] = tmp2 # Used by tests under atest/testdata
if 'PYTHONPATH' not in os.environ: # Allow executed scripts to import robot
os.environ['PYTHONPATH'] = src
else:
os.environ['PYTHONPATH'] = os.pathsep.join([src, os.environ['PYTHONPATH']])

sys.path.insert(0, join(curdir, 'src'))
sys.path.insert(0, src)
from robot import run_cli, rebot_cli

if sys.argv[1] == 'rebot':
Expand All @@ -41,7 +46,8 @@
else:
runner = run_cli
args = ['--pythonpath', join(curdir, 'atest', 'testresources', 'testlibs'),
'--pythonpath', tmp, '--loglevel', 'DEBUG']
'--pythonpath', tmp,
'--loglevel', 'DEBUG']
args += sys.argv[2:] if sys.argv[1] == 'run' else sys.argv[1:]

runner(['--outputdir', tmp] + args)

0 comments on commit 3abd04a

Please sign in to comment.