michael@0: #!/usr/bin/env python michael@0: # Copyright (c) 2012 The LibYuv Project Authors. All rights reserved. michael@0: # michael@0: # Use of this source code is governed by a BSD-style license michael@0: # that can be found in the LICENSE file in the root of the source michael@0: # tree. An additional intellectual property rights grant can be found michael@0: # in the file PATENTS. All contributing project authors may michael@0: # be found in the AUTHORS file in the root of the source tree. michael@0: michael@0: import os michael@0: import re michael@0: import sys michael@0: michael@0: """ michael@0: Copied from Chrome's src/tools/valgrind/tsan/PRESUBMIT.py michael@0: michael@0: See http://dev.chromium.org/developers/how-tos/depottools/presubmit-scripts michael@0: for more details on the presubmit API built into gcl. michael@0: """ michael@0: michael@0: def CheckChange(input_api, output_api): michael@0: """Checks the TSan suppressions files for bad suppressions.""" michael@0: michael@0: # Add the path to the Chrome valgrind dir to the import path: michael@0: tools_vg_path = os.path.join(input_api.PresubmitLocalPath(), '..', '..', michael@0: 'valgrind') michael@0: sys.path.append(tools_vg_path) michael@0: import suppressions michael@0: michael@0: return suppressions.PresubmitCheck(input_api, output_api) michael@0: michael@0: def CheckChangeOnUpload(input_api, output_api): michael@0: return CheckChange(input_api, output_api) michael@0: michael@0: def CheckChangeOnCommit(input_api, output_api): michael@0: return CheckChange(input_api, output_api) michael@0: michael@0: def GetPreferredTrySlaves(): michael@0: # We don't have any tsan slaves yet, so there's no use for this method. michael@0: # When we have, the slave name(s) should be put into this list. michael@0: return []