Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(93)

Unified Diff: test/determinism/gyptest-determinism.py

Issue 1506733002: GYP: Make GYP build deterministic (Closed) Base URL: https://chromium.googlesource.com/external/gyp.git@master
Patch Set: Shrinks test case down, more thorough testing. Created 5 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« pylib/gyp/ninja_syntax.py ('K') | « test/determinism/determinism.gyp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/determinism/gyptest-determinism.py
diff --git a/test/determinism/gyptest-determinism.py b/test/determinism/gyptest-determinism.py
new file mode 100644
index 0000000000000000000000000000000000000000..549a7f67e25c086c2b0c5ae1b393903bf50b05bb
--- /dev/null
+++ b/test/determinism/gyptest-determinism.py
@@ -0,0 +1,29 @@
+#!/usr/bin/env python
+
+# Copyright (c) 2015 Google Inc. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+"""
+Verifies builds are the same even with different PYTHONHASHSEEDs.
+"""
+
+import os
+import sys
+import TestGyp
+
+test = TestGyp.TestGyp()
+if test.format == 'ninja':
+ os.environ["PYTHONHASHSEED"] = "1"
+ test.run_gyp('determinism.gyp')
+ base = open(test.built_file_path('build.ninja')).read()
+
+ for i in range(1,5):
+ os.environ["PYTHONHASHSEED"] = str(i)
+ test.run_gyp('determinism.gyp')
+ contents = open(test.built_file_path('build.ninja')).read()
+ if base != contents:
+ test.fail_test()
+
+ del os.environ["PYTHONHASHSEED"]
+ test.pass_test()
« pylib/gyp/ninja_syntax.py ('K') | « test/determinism/determinism.gyp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698