blob: cf49f5008484b7270cef06bd1aaa7af7ea8f19d9 [file] [log] [blame]
Ben Murdoch097c5b22016-05-18 11:27:45 +01001#!/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"""
8Verifies builds are the same even with different PYTHONHASHSEEDs.
9Tests both solibs and implicit_deps.
10"""
11
12import os
13import sys
14import TestGyp
15
16test = TestGyp.TestGyp()
17if test.format == 'ninja':
18 os.environ["PYTHONHASHSEED"] = "1"
19 test.run_gyp('empty-targets.gyp')
20 base = open(test.built_file_path('build.ninja')).read()
21
22 for i in range(1,5):
23 os.environ["PYTHONHASHSEED"] = str(i)
24 test.run_gyp('empty-targets.gyp')
25 contents = open(test.built_file_path('build.ninja')).read()
26 if base != contents:
27 test.fail_test()
28
29 del os.environ["PYTHONHASHSEED"]
30 test.pass_test()