| OLD | NEW |
| 1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
| 2 | 2 |
| 3 # Copyright (c) 2012 Google Inc. All rights reserved. | 3 # Copyright (c) 2012 Google Inc. All rights reserved. |
| 4 # Use of this source code is governed by a BSD-style license that can be | 4 # Use of this source code is governed by a BSD-style license that can be |
| 5 # found in the LICENSE file. | 5 # found in the LICENSE file. |
| 6 | 6 |
| 7 """ | 7 """ |
| 8 Make sure we don't cause unnecessary builds due to import libs appearing | 8 Make sure we don't cause unnecessary builds due to import libs appearing |
| 9 to be out of date. | 9 to be out of date. |
| 10 """ | 10 """ |
| 11 | 11 |
| 12 from __future__ import print_function |
| 13 |
| 12 import TestGyp | 14 import TestGyp |
| 13 | 15 |
| 14 import os | 16 import os |
| 15 import sys | 17 import sys |
| 16 import time | 18 import time |
| 17 | 19 |
| 18 if sys.platform == 'win32': | 20 if sys.platform == 'win32': |
| 19 test = TestGyp.TestGyp(formats=['msvs', 'ninja']) | 21 test = TestGyp.TestGyp(formats=['msvs', 'ninja']) |
| 20 | 22 |
| 21 if not os.environ.get('ProgramFiles(x86)'): | 23 if not os.environ.get('ProgramFiles(x86)'): |
| 22 # TODO(scottmg) | 24 # TODO(scottmg) |
| 23 print 'Skipping test on x86, http://crbug.com/365833' | 25 print('Skipping test on x86, http://crbug.com/365833') |
| 24 test.pass_test() | 26 test.pass_test() |
| 25 | 27 |
| 26 CHDIR = 'importlib' | 28 CHDIR = 'importlib' |
| 27 test.run_gyp('importlib.gyp', chdir=CHDIR) | 29 test.run_gyp('importlib.gyp', chdir=CHDIR) |
| 28 test.build('importlib.gyp', test.ALL, chdir=CHDIR) | 30 test.build('importlib.gyp', test.ALL, chdir=CHDIR) |
| 29 | 31 |
| 30 # Delay briefly so that there's time for this touch not to have the | 32 # Delay briefly so that there's time for this touch not to have the |
| 31 # timestamp as the previous run. | 33 # timestamp as the previous run. |
| 32 test.sleep() | 34 test.sleep() |
| 33 | 35 |
| 34 # Touch the .cc file; the .dll will rebuild, but the import libs timestamp | 36 # Touch the .cc file; the .dll will rebuild, but the import libs timestamp |
| 35 # won't be updated. | 37 # won't be updated. |
| 36 test.touch('importlib/has-exports.cc') | 38 test.touch('importlib/has-exports.cc') |
| 37 test.build('importlib.gyp', 'test_importlib', chdir=CHDIR) | 39 test.build('importlib.gyp', 'test_importlib', chdir=CHDIR) |
| 38 | 40 |
| 39 # This is the important part. The .dll above will relink and have an updated | 41 # This is the important part. The .dll above will relink and have an updated |
| 40 # timestamp, however the import .libs timestamp won't be updated. So, we | 42 # timestamp, however the import .libs timestamp won't be updated. So, we |
| 41 # have to handle restating inputs in ninja so the final binary doesn't | 43 # have to handle restating inputs in ninja so the final binary doesn't |
| 42 # continually relink (due to thinking the .lib isn't up to date). | 44 # continually relink (due to thinking the .lib isn't up to date). |
| 43 test.up_to_date('importlib.gyp', test.ALL, chdir=CHDIR) | 45 test.up_to_date('importlib.gyp', test.ALL, chdir=CHDIR) |
| 44 | 46 |
| 45 test.pass_test() | 47 test.pass_test() |
| OLD | NEW |