Yves Gerey 546ee613a4 clang-tidy helper script, with clang static analyzer included.
This CL makes it easy to invoke the tool for single cc files,
without having to install or configure anything.
It boils down to:
% tools_webrtc/clang_tidy.py path/to/file.cc [clang-tidy-args...]
If any issue is encountered, a colored diagnostic will be printed.
By default, it also includes checks from clang analyzer.

Warning! This is linux-only, and uses an old version of
clang-tidy based on LLVM 5.0. USE WITH CARE.

bug: webrtc:8793
Change-Id: I8964f2b939408326cc349c5f0ac0dfcff2da24c5
Reviewed-on: https://webrtc-review.googlesource.com/c/120221
Commit-Queue: Yves Gerey <yvesg@webrtc.org>
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#26858}
2019-02-26 17:06:40 +00:00

33 lines
1020 B
Python
Executable File

#!/usr/bin/env python
# Copyright (c) 2017 The WebRTC project authors. All Rights Reserved.
#
# Use of this source code is governed by a BSD-style license
# that can be found in the LICENSE file in the root of the source
# tree. An additional intellectual property rights grant can be found
# in the file PATENTS. All contributing project authors may
# be found in the AUTHORS file in the root of the source tree.
import os
import unittest
#pylint: disable=relative-import
import build_helpers
TESTDATA_DIR = os.path.join(os.path.dirname(os.path.abspath(__file__)),
'testdata')
class GnCheckTest(unittest.TestCase):
def testCircularDependencyError(self):
test_dir = os.path.join(TESTDATA_DIR, 'circular_dependency')
expected_errors = ['ERROR Dependency cycle:\n'
' //:bar ->\n //:foo ->\n //:bar']
self.assertListEqual(expected_errors,
build_helpers.RunGnCheck(test_dir))
if __name__ == '__main__':
unittest.main()