Commit 2be90f32 authored by Jim Fulton's avatar Jim Fulton

Added renormalizer to avoid spurious errors on windows

parent fa493023
...@@ -495,6 +495,8 @@ normalize_path = ( ...@@ -495,6 +495,8 @@ normalize_path = (
_normalize_path, _normalize_path,
) )
normalize_endings = re.compile('\r\n'), '\n'
normalize_script = ( normalize_script = (
re.compile('(\n?)- ([a-zA-Z_.-]+)-script.py\n- \\2.exe\n'), re.compile('(\n?)- ([a-zA-Z_.-]+)-script.py\n- \\2.exe\n'),
'\\1- \\2\n') '\\1- \\2\n')
......
...@@ -2738,6 +2738,7 @@ def test_suite(): ...@@ -2738,6 +2738,7 @@ def test_suite():
tearDown=zc.buildout.testing.buildoutTearDown, tearDown=zc.buildout.testing.buildoutTearDown,
checker=renormalizing.RENormalizing([ checker=renormalizing.RENormalizing([
zc.buildout.testing.normalize_path, zc.buildout.testing.normalize_path,
zc.buildout.testing.normalize_endings,
zc.buildout.testing.normalize_script, zc.buildout.testing.normalize_script,
zc.buildout.testing.normalize_egg_py, zc.buildout.testing.normalize_egg_py,
(re.compile('__buildout_signature__ = recipes-\S+'), (re.compile('__buildout_signature__ = recipes-\S+'),
...@@ -2767,6 +2768,7 @@ def test_suite(): ...@@ -2767,6 +2768,7 @@ def test_suite():
tearDown=zc.buildout.testing.buildoutTearDown, tearDown=zc.buildout.testing.buildoutTearDown,
checker=renormalizing.RENormalizing([ checker=renormalizing.RENormalizing([
zc.buildout.testing.normalize_path, zc.buildout.testing.normalize_path,
zc.buildout.testing.normalize_endings,
(re.compile(r'\S+buildout.py'), 'buildout.py'), (re.compile(r'\S+buildout.py'), 'buildout.py'),
(re.compile(r'line \d+'), 'line NNN'), (re.compile(r'line \d+'), 'line NNN'),
(re.compile(r'py\(\d+\)'), 'py(NNN)'), (re.compile(r'py\(\d+\)'), 'py(NNN)'),
...@@ -2779,6 +2781,7 @@ def test_suite(): ...@@ -2779,6 +2781,7 @@ def test_suite():
tearDown=zc.buildout.testing.buildoutTearDown, tearDown=zc.buildout.testing.buildoutTearDown,
checker=renormalizing.RENormalizing([ checker=renormalizing.RENormalizing([
zc.buildout.testing.normalize_path, zc.buildout.testing.normalize_path,
zc.buildout.testing.normalize_endings,
zc.buildout.testing.normalize_script, zc.buildout.testing.normalize_script,
zc.buildout.testing.normalize_egg_py, zc.buildout.testing.normalize_egg_py,
normalize_bang, normalize_bang,
...@@ -2799,6 +2802,7 @@ def test_suite(): ...@@ -2799,6 +2802,7 @@ def test_suite():
tearDown=zc.buildout.testing.buildoutTearDown, tearDown=zc.buildout.testing.buildoutTearDown,
checker=renormalizing.RENormalizing([ checker=renormalizing.RENormalizing([
zc.buildout.testing.normalize_path, zc.buildout.testing.normalize_path,
zc.buildout.testing.normalize_endings,
zc.buildout.testing.normalize_script, zc.buildout.testing.normalize_script,
zc.buildout.testing.normalize_egg_py, zc.buildout.testing.normalize_egg_py,
normalize_bang, normalize_bang,
...@@ -2811,6 +2815,7 @@ def test_suite(): ...@@ -2811,6 +2815,7 @@ def test_suite():
tearDown=zc.buildout.testing.buildoutTearDown, tearDown=zc.buildout.testing.buildoutTearDown,
checker=renormalizing.RENormalizing([ checker=renormalizing.RENormalizing([
zc.buildout.testing.normalize_path, zc.buildout.testing.normalize_path,
zc.buildout.testing.normalize_endings,
zc.buildout.testing.normalize_script, zc.buildout.testing.normalize_script,
zc.buildout.testing.normalize_egg_py, zc.buildout.testing.normalize_egg_py,
(re.compile("buildout: Running \S*setup.py"), (re.compile("buildout: Running \S*setup.py"),
...@@ -2841,6 +2846,7 @@ def test_suite(): ...@@ -2841,6 +2846,7 @@ def test_suite():
tearDown=zc.buildout.testing.buildoutTearDown, tearDown=zc.buildout.testing.buildoutTearDown,
checker=renormalizing.RENormalizing([ checker=renormalizing.RENormalizing([
zc.buildout.testing.normalize_path, zc.buildout.testing.normalize_path,
zc.buildout.testing.normalize_endings,
zc.buildout.testing.normalize_script, zc.buildout.testing.normalize_script,
zc.buildout.testing.normalize_egg_py, zc.buildout.testing.normalize_egg_py,
(re.compile('__buildout_signature__ = recipes-\S+'), (re.compile('__buildout_signature__ = recipes-\S+'),
...@@ -2885,12 +2891,10 @@ def test_suite(): ...@@ -2885,12 +2891,10 @@ def test_suite():
tearDown=zc.buildout.testing.buildoutTearDown, tearDown=zc.buildout.testing.buildoutTearDown,
checker=renormalizing.RENormalizing([ checker=renormalizing.RENormalizing([
zc.buildout.testing.normalize_path, zc.buildout.testing.normalize_path,
zc.buildout.testing.normalize_endings,
zc.buildout.testing.normalize_script, zc.buildout.testing.normalize_script,
normalize_bang, normalize_bang,
]), ]),
)) ))
return unittest.TestSuite(test_suite) return unittest.TestSuite(test_suite)
...@@ -44,6 +44,7 @@ def test_suite(): ...@@ -44,6 +44,7 @@ def test_suite():
setUp=setUp, tearDown=zc.buildout.testing.buildoutTearDown, setUp=setUp, tearDown=zc.buildout.testing.buildoutTearDown,
checker=renormalizing.RENormalizing([ checker=renormalizing.RENormalizing([
zc.buildout.testing.normalize_path, zc.buildout.testing.normalize_path,
zc.buildout.testing.normalize_endings,
zc.buildout.testing.normalize_script, zc.buildout.testing.normalize_script,
zc.buildout.testing.normalize_egg_py, zc.buildout.testing.normalize_egg_py,
zc.buildout.tests.normalize_bang, zc.buildout.tests.normalize_bang,
...@@ -57,6 +58,7 @@ def test_suite(): ...@@ -57,6 +58,7 @@ def test_suite():
setUp=setUp, tearDown=zc.buildout.testing.buildoutTearDown, setUp=setUp, tearDown=zc.buildout.testing.buildoutTearDown,
checker=renormalizing.RENormalizing([ checker=renormalizing.RENormalizing([
zc.buildout.testing.normalize_path, zc.buildout.testing.normalize_path,
zc.buildout.testing.normalize_endings,
(re.compile('__buildout_signature__ = ' (re.compile('__buildout_signature__ = '
'sample-\S+\s+' 'sample-\S+\s+'
'zc.recipe.egg-\S+\s+' 'zc.recipe.egg-\S+\s+'
...@@ -77,6 +79,7 @@ def test_suite(): ...@@ -77,6 +79,7 @@ def test_suite():
setUp=setUp, tearDown=zc.buildout.testing.buildoutTearDown, setUp=setUp, tearDown=zc.buildout.testing.buildoutTearDown,
checker=renormalizing.RENormalizing([ checker=renormalizing.RENormalizing([
zc.buildout.testing.normalize_path, zc.buildout.testing.normalize_path,
zc.buildout.testing.normalize_endings,
(re.compile("(d ((ext)?demo(needed)?|other)" (re.compile("(d ((ext)?demo(needed)?|other)"
"-\d[.]\d-py)\d[.]\d(-\S+)?[.]egg"), "-\d[.]\d-py)\d[.]\d(-\S+)?[.]egg"),
'\\1V.V.egg'), '\\1V.V.egg'),
...@@ -97,9 +100,11 @@ def test_suite(): ...@@ -97,9 +100,11 @@ def test_suite():
tearDown=zc.buildout.testing.buildoutTearDown, tearDown=zc.buildout.testing.buildoutTearDown,
checker=renormalizing.RENormalizing([ checker=renormalizing.RENormalizing([
zc.buildout.testing.normalize_path, zc.buildout.testing.normalize_path,
zc.buildout.testing.normalize_endings,
zc.buildout.testing.normalize_script, zc.buildout.testing.normalize_script,
(re.compile('Got setuptools \S+'), 'Got setuptools V'), (re.compile('Got setuptools \S+'), 'Got setuptools V'),
(re.compile('([d-] )?setuptools-\S+-py'), 'setuptools-V-py'), (re.compile('([d-] )?setuptools-\S+-py'),
'setuptools-V-py'),
(re.compile('-py2[.][0-35-9][.]'), 'py2.5.'), (re.compile('-py2[.][0-35-9][.]'), 'py2.5.'),
(re.compile('zc.buildout-\S+[.]egg'), (re.compile('zc.buildout-\S+[.]egg'),
'zc.buildout.egg'), 'zc.buildout.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