OLD | NEW |
(Empty) | |
| 1 #!/usr/bin/env python |
| 2 |
| 3 # Copyright (c) 2015 Google Inc. All rights reserved. |
| 4 # Use of this source code is governed by a BSD-style license that can be |
| 5 # found in the LICENSE file. |
| 6 |
| 7 """ |
| 8 Verifies builds are the same even with different PYTHONHASHSEEDs. |
| 9 Tests all_targets, implicit_deps and solibs. |
| 10 """ |
| 11 |
| 12 import os |
| 13 import sys |
| 14 import TestGyp |
| 15 |
| 16 test = TestGyp.TestGyp() |
| 17 if test.format == 'ninja': |
| 18 os.environ["PYTHONHASHSEED"] = "1" |
| 19 test.run_gyp('solibs.gyp') |
| 20 base1 = open(test.built_file_path('c.ninja', subdir='obj')).read() |
| 21 base2 = open(test.built_file_path('build.ninja')).read() |
| 22 |
| 23 for i in range(1,5): |
| 24 os.environ["PYTHONHASHSEED"] = str(i) |
| 25 test.run_gyp('solibs.gyp') |
| 26 contents1 = open(test.built_file_path('c.ninja', subdir='obj')).read() |
| 27 contents2 = open(test.built_file_path('build.ninja')).read() |
| 28 if base1 != contents1: |
| 29 test.fail_test() |
| 30 if base2 != contents2: |
| 31 print base2 |
| 32 test.fail_test() |
| 33 |
| 34 del os.environ["PYTHONHASHSEED"] |
| 35 test.pass_test() |
OLD | NEW |