1#!/usr/bin/env python 2 3# Copyright (c) 2017 The WebRTC project authors. All Rights Reserved. 4# 5# Use of this source code is governed by a BSD-style license 6# that can be found in the LICENSE file in the root of the source 7# tree. An additional intellectual property rights grant can be found 8# in the file PATENTS. All contributing project authors may 9# be found in the AUTHORS file in the root of the source tree. 10 11import os 12import unittest 13 14#pylint: disable=relative-import 15import build_helpers 16 17 18TESTDATA_DIR = os.path.join(os.path.dirname(os.path.abspath(__file__)), 19 'testdata') 20 21 22class GnCheckTest(unittest.TestCase): 23 def testCircularDependencyError(self): 24 test_dir = os.path.join(TESTDATA_DIR, 'circular_dependency') 25 expected_errors = ['ERROR Dependency cycle:\n' 26 ' //:bar ->\n //:foo ->\n //:bar'] 27 self.assertListEqual(expected_errors, 28 build_helpers.RunGnCheck(test_dir)) 29 30 31if __name__ == '__main__': 32 unittest.main() 33