Commit 4cc943af authored by jim's avatar jim

Changed the way we run system commands in tests to get more

deterministic output by outputing all of standard output followed
by all of standard error.


git-svn-id: http://svn.zope.org/repos/main/zc.buildout/trunk@76843 62d5b8a3-27da-0310-9561-8e5933582275
parent 11ab11d9
...@@ -72,27 +72,26 @@ supply some input: ...@@ -72,27 +72,26 @@ supply some input:
... p self.options.keys() ... p self.options.keys()
... q ... q
... """), ... """),
Develop: '/sample-buildout/recipes' Develop: '/tmp/tmp6YPc7CbuildoutSetUp/_TEST_/sample-buildout/recipes'
Installing data-dir. Installing data-dir.
While: > /home/jim/p/zc/buildout/trunk/src/zc/buildout/buildout.py(925)__getitem__()
-> raise MissingOption("Missing option: %s:%s" % (self.name, key))
(Pdb) > /tmp/tmp6YPc7CbuildoutSetUp/_TEST_/sample-buildout/recipes/mkdir.py(14)install()
-> directory = self.options['directory']
(Pdb) ['path', 'recipe']
(Pdb) While:
Installing data-dir. Installing data-dir.
Traceback (most recent call last): Traceback (most recent call last):
File "/zc/buildout/buildout.py", line 1294, in main File "/zc/buildout/buildout.py", line 1352, in main
getattr(buildout, command)(args) getattr(buildout, command)(args)
File "/zc/buildout/buildout.py", line 371, in install File "/zc/buildout/buildout.py", line 383, in install
installed_files = self[part]._call(recipe.install) installed_files = self[part]._call(recipe.install)
File "/zc/buildout/buildout.py", line 929, in _call File "/zc/buildout/buildout.py", line 961, in _call
return f() return f()
File "/sample-buildout/recipes/mkdir.py", line 14, in install File "/sample-buildout/recipes/mkdir.py", line 14, in install
directory = self.options['directory'] directory = self.options['directory']
File "/zc/buildout/buildout.py", line 895, in __getitem__ File "/zc/buildout/buildout.py", line 925, in __getitem__
raise MissingOption("Missing option: %s:%s" % (self.name, key)) raise MissingOption("Missing option: %s:%s" % (self.name, key))
MissingOption: Missing option: data-dir:directory MissingOption: Missing option: data-dir:directory
<BLANKLINE> <BLANKLINE>
Starting pdb: Starting pdb:
> /Users/jim/p/buildout/trunk/src/zc/buildout/buildout.py(895)__getitem__()
-> raise MissingOption("Missing option: %s:%s" % (self.name, key))
(Pdb) > /sample-buildout/recipes/mkdir.py(14)install()
-> directory = self.options['directory']
(Pdb) ['path', 'recipe']
(Pdb)
...@@ -73,12 +73,16 @@ def write(dir, *args): ...@@ -73,12 +73,16 @@ def write(dir, *args):
fsync(f.fileno()) fsync(f.fileno())
f.close() f.close()
def system(command, input=''): def system(command, input=''):
i, o = os.popen4(command) i, o, e = os.popen3(command)
if input: if input:
i.write(input) i.write(input)
i.close() i.close()
return o.read() result = o.read()+e.read()
o.close()
e.close()
return result
def get(url): def get(url):
return urllib2.urlopen(url).read() return urllib2.urlopen(url).read()
......
...@@ -1674,15 +1674,15 @@ def install_source_dist_with_bad_py(): ...@@ -1674,15 +1674,15 @@ def install_source_dist_with_bad_py():
>>> print system(buildout), # doctest: +NORMALIZE_WHITESPACE >>> print system(buildout), # doctest: +NORMALIZE_WHITESPACE
Installing eggs. Installing eggs.
Getting distribution for 'badegg'. Getting distribution for 'badegg'.
Got badegg 1.
Installing bo.
Generated script '/sample-buildout/bin/bo'.
File "build/bdist.linux-i686/egg/badegg/scripts/one.py", line 2 File "build/bdist.linux-i686/egg/badegg/scripts/one.py", line 2
return 1 return 1
SyntaxError: 'return' outside function SyntaxError: 'return' outside function
File "/sample-buildout/eggs/badegg-1-py2.4.egg/badegg/scripts/one.py", line 2 File "/sample-buildout/eggs/tmppsHubz/badegg-1-py2.4.egg/badegg/scripts/one.py", line 2
return 1 return 1
SyntaxError: 'return' outside function SyntaxError: 'return' outside function
Got badegg 1.
Installing bo.
Generated script '/sample-buildout/bin/bo'.
>>> ls('eggs') # doctest: +ELLIPSIS >>> ls('eggs') # doctest: +ELLIPSIS
d badegg-1-py2.4.egg d badegg-1-py2.4.egg
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment