
import os
import TestGyp

test = TestGyp.TestGyp(formats=['make'])

test.run_gyp('shared_dependency.gyp',
             chdir='src')
test.relocate('src', 'relocate/src')

test.build('shared_dependency.gyp', test.ALL, chdir='relocate/src')

with open('relocate/src/Makefile') as makefile:
  make_contents = makefile.read()

# If we remove the code to generate lib1, Make should still be able
# to build lib2 since lib1.so already exists.
make_contents = make_contents.replace('include lib1.target.mk', '')
with open('relocate/src/Makefile', 'w') as makefile:
  makefile.write(make_contents)

test.build('shared_dependency.gyp', test.ALL, chdir='relocate/src')

test.pass_test()


# Python 2.5 needs this for the with statement.
from __future__ import with_statement

import os
import TestGyp

test = TestGyp.TestGyp(formats=['make'])

test.run_gyp('shared_dependency.gyp',
             chdir='src')
test.relocate('src', 'relocate/src')

test.build('shared_dependency.gyp', test.ALL, chdir='relocate/src')

with open('relocate/src/Makefile') as makefile:
  make_contents = makefile.read()

# If we remove the code to generate lib1, Make should still be able
# to build lib2 since lib1.so already exists.
make_contents = make_contents.replace('include lib1.target.mk', '')
with open('relocate/src/Makefile', 'w') as makefile:
  makefile.write(make_contents)

test.build('shared_dependency.gyp', test.ALL, chdir='relocate/src')

test.pass_test()

Add with_statement import for python2.5.
Add with_statement import for python2.5.

See http://www.python.org/dev/peps/pep-0343/ which describes
the with statement.
Review URL: http://codereview.chromium.org/5690003

git-svn-id: e7e1075985beda50ea81ac4472467b4f6e91fc78@863 78cadc50-ecff-11dd-a971-7dbc132099af

+ 
+ # Python 2.5 needs this for the with statement.
+ from __future__ import with_statement
  
  import os
  import TestGyp
  
  test = TestGyp.TestGyp(formats=['make'])
  
  test.run_gyp('shared_dependency.gyp',
               chdir='src')
  test.relocate('src', 'relocate/src')
  
  test.build('shared_dependency.gyp', test.ALL, chdir='relocate/src')
  
  with open('relocate/src/Makefile') as makefile:
    make_contents = makefile.read()
  
  # If we remove the code to generate lib1, Make should still be able
  # to build lib2 since lib1.so already exists.
  make_contents = make_contents.replace('include lib1.target.mk', '')
  with open('relocate/src/Makefile', 'w') as makefile:
    makefile.write(make_contents)
  
  test.build('shared_dependency.gyp', test.ALL, chdir='relocate/src')
  
  test.pass_test()
  
Add with_statement import for python2.5.
## Code Before:

import os
import TestGyp

test = TestGyp.TestGyp(formats=['make'])

test.run_gyp('shared_dependency.gyp',
             chdir='src')
test.relocate('src', 'relocate/src')

test.build('shared_dependency.gyp', test.ALL, chdir='relocate/src')

with open('relocate/src/Makefile') as makefile:
  make_contents = makefile.read()

# If we remove the code to generate lib1, Make should still be able
# to build lib2 since lib1.so already exists.
make_contents = make_contents.replace('include lib1.target.mk', '')
with open('relocate/src/Makefile', 'w') as makefile:
  makefile.write(make_contents)

test.build('shared_dependency.gyp', test.ALL, chdir='relocate/src')

test.pass_test()

## Instruction:
Add with_statement import for python2.5.
## Code After:

# Python 2.5 needs this for the with statement.
from __future__ import with_statement

import os
import TestGyp

test = TestGyp.TestGyp(formats=['make'])

test.run_gyp('shared_dependency.gyp',
             chdir='src')
test.relocate('src', 'relocate/src')

test.build('shared_dependency.gyp', test.ALL, chdir='relocate/src')

with open('relocate/src/Makefile') as makefile:
  make_contents = makefile.read()

# If we remove the code to generate lib1, Make should still be able
# to build lib2 since lib1.so already exists.
make_contents = make_contents.replace('include lib1.target.mk', '')
with open('relocate/src/Makefile', 'w') as makefile:
  makefile.write(make_contents)

test.build('shared_dependency.gyp', test.ALL, chdir='relocate/src')

test.pass_test()
