Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(870)

Unified Diff: pylib/gyp/common_test.py

Issue 10378042: Correct the order in which OutputDirectory and IntermediateDirectory are defined. (Closed) Base URL: http://gyp.googlecode.com/svn/trunk/
Patch Set: Created 8 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « pylib/gyp/common.py ('k') | pylib/gyp/generator/msvs.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pylib/gyp/common_test.py
===================================================================
--- pylib/gyp/common_test.py (revision 0)
+++ pylib/gyp/common_test.py (revision 0)
@@ -0,0 +1,44 @@
+#!/usr/bin/env python
+
+# Copyright (c) 2012 Google Inc. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+"""Unit tests for the common.py file."""
+
+import gyp.common
+import unittest
+
+
+class TestTopologicallySorted(unittest.TestCase):
+ def test_Valid(self):
+ """Test that sorting works on a valid graph with one possible order."""
+ graph = {
+ 'a': ['b', 'c'],
+ 'b': [],
+ 'c': ['d'],
+ 'd': ['b'],
+ }
+ def GetEdge(node):
+ return tuple(graph[node])
+ self.assertEqual(
+ gyp.common.TopologicallySorted(graph.keys(), GetEdge),
+ ['a', 'c', 'd', 'b'])
+
+ def test_Cycle(self):
+ """Test that an exception is thrown on a cyclic graph."""
+ graph = {
+ 'a': ['b'],
+ 'b': ['c'],
+ 'c': ['d'],
+ 'd': ['a'],
+ }
+ def GetEdge(node):
+ return tuple(graph[node])
+ self.assertRaises(
+ gyp.common.CycleError, gyp.common.TopologicallySorted,
+ graph.keys(), GetEdge)
+
+
+if __name__ == '__main__':
+ unittest.main()
Property changes on: pylib/gyp/common_test.py
___________________________________________________________________
Added: svn:executable
+ *
Added: svn:eol-style
+ LF
« no previous file with comments | « pylib/gyp/common.py ('k') | pylib/gyp/generator/msvs.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698