summaryrefslogtreecommitdiffstats
path: root/chromium/tools/valgrind/drmemory/PRESUBMIT.py
blob: 11c71478b7816f6dd3abfbda0c177b03547db1d6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
# Copyright (c) 2012 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""
See http://dev.chromium.org/developers/how-tos/depottools/presubmit-scripts
for more details on the presubmit API built into gcl.
"""


def CheckChange(input_api, output_api):
  """Checks the DrMemory suppression files for bad suppressions."""

  # TODO(timurrrr): find out how to do relative imports
  # and remove this ugly hack. Also, the CheckChange function won't be needed.
  tools_vg_path = input_api.os_path.join(input_api.PresubmitLocalPath(), '..')
  import sys
  old_path = sys.path
  try:
    sys.path = sys.path + [tools_vg_path]
    import suppressions
    return suppressions.PresubmitCheck(input_api, output_api)
  finally:
    sys.path = old_path


def CheckChangeOnUpload(input_api, output_api):
  return CheckChange(input_api, output_api)


def CheckChangeOnCommit(input_api, output_api):
  return CheckChange(input_api, output_api)


def GetPreferredTrySlaves():
  return ['win_drmemory']