mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
[benchmark] Benchmark_Driver: Correctly set SWIFT_DETERMINISTIC_HASHING
This commit is contained in:
@@ -56,6 +56,11 @@ class BenchmarkDriver(object):
|
||||
"""
|
||||
self.args = args
|
||||
self.run_env = os.environ.copy()
|
||||
|
||||
# Set a constant hash seed. Some tests are highly sensitive to
|
||||
# fluctuations in the number of hash collisions.
|
||||
self.run_env["SWIFT_DETERMINISTIC_HASHING"] = "1"
|
||||
|
||||
if hasattr(args, 'libdir') and args.libdir:
|
||||
# The benchmark binaries should pick up the built swift libraries
|
||||
# automatically, because their RPATH should point to ../lib/swift
|
||||
@@ -65,15 +70,13 @@ class BenchmarkDriver(object):
|
||||
self.run_env["DYLD_LIBRARY_PATH"] = args.libdir
|
||||
elif platform.system() == "Linux":
|
||||
self.run_env["LD_LIBRARY_PATH"] = args.libdir
|
||||
|
||||
self._subprocess = _subprocess or subprocess
|
||||
self.all_tests = []
|
||||
self.test_number = {}
|
||||
self.tests = tests or self._get_tests()
|
||||
self.parser = parser or LogParser()
|
||||
self.results = {}
|
||||
# Set a constant hash seed. Some tests are currently sensitive to
|
||||
# fluctuations in the number of hash collisions.
|
||||
os.environ["SWIFT_DETERMINISTIC_HASHING"] = "1"
|
||||
|
||||
def _invoke(self, cmd):
|
||||
return self._subprocess.check_output(
|
||||
|
||||
Reference in New Issue
Block a user