blob: 7b97cca0d2dff0d132ca6a027b4436b1f1600381 [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 needed_variables.
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('needed-variables.gyp')
20 base = open(test.built_file_path('test.ninja', subdir='obj')).read()
21
22 for i in range(1,5):
23 os.environ["PYTHONHASHSEED"] = str(i)
24 test.run_gyp('needed-variables.gyp')
25 contents = open(test.built_file_path('test.ninja', subdir='obj')).read()
26 if base != contents:
27 test.fail_test()
28
29 del os.environ["PYTHONHASHSEED"]
30 test.pass_test()