OLD | NEW |
1 #!/usr/bin/python | 1 #!/usr/bin/python |
2 | 2 |
3 # Copyright 2014 Google Inc. | 3 # Copyright 2014 Google Inc. |
4 # | 4 # |
5 # Use of this source code is governed by a BSD-style license that can be | 5 # Use of this source code is governed by a BSD-style license that can be |
6 # found in the LICENSE file. | 6 # found in the LICENSE file. |
7 | 7 |
8 """ | 8 """ |
9 Test the VarsDict. | 9 Test the VarsDict. |
10 """ | 10 """ |
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
74 | 74 |
75 v_dict.LOCAL_STATIC_LIBRARIES.add('static') | 75 v_dict.LOCAL_STATIC_LIBRARIES.add('static') |
76 v_dict.LOCAL_STATIC_LIBRARIES.add(str(i)) | 76 v_dict.LOCAL_STATIC_LIBRARIES.add(str(i)) |
77 | 77 |
78 v_dict.LOCAL_C_INCLUDES.add('includes') | 78 v_dict.LOCAL_C_INCLUDES.add('includes') |
79 v_dict.LOCAL_C_INCLUDES.add(str(i)) | 79 v_dict.LOCAL_C_INCLUDES.add(str(i)) |
80 | 80 |
81 v_dict.LOCAL_EXPORT_C_INCLUDE_DIRS.add('exports') | 81 v_dict.LOCAL_EXPORT_C_INCLUDE_DIRS.add('exports') |
82 v_dict.LOCAL_EXPORT_C_INCLUDE_DIRS.add(str(i)) | 82 v_dict.LOCAL_EXPORT_C_INCLUDE_DIRS.add(str(i)) |
83 | 83 |
| 84 v_dict.DEFINES.add('defines') |
| 85 v_dict.DEFINES.add(str(i)) |
| 86 |
84 v_dict.KNOWN_TARGETS.add('known') | 87 v_dict.KNOWN_TARGETS.add('known') |
85 v_dict.KNOWN_TARGETS.add(str(i)) | 88 v_dict.KNOWN_TARGETS.add(str(i)) |
86 | 89 |
87 self.assert_consistency(v_dict) | 90 self.assert_consistency(v_dict) |
88 | 91 |
89 v_dict_list.append(v_dict) | 92 v_dict_list.append(v_dict) |
90 | 93 |
91 intersection = vars_dict_lib.intersect(v_dict_list) | 94 intersection = vars_dict_lib.intersect(v_dict_list) |
92 | 95 |
93 self.assert_consistency(intersection) | 96 self.assert_consistency(intersection) |
94 | 97 |
95 for key in intersection.keys(): | 98 for key in intersection.keys(): |
96 # Each field had one common item | 99 # Each field had one common item |
97 self.assertEqual(len(intersection[key]), 1) | 100 self.assertEqual(len(intersection[key]), 1) |
98 for item in intersection[key]: | 101 for item in intersection[key]: |
99 for other_v_dict in v_dict_list: | 102 for other_v_dict in v_dict_list: |
100 self.assertNotIn(item, other_v_dict[key]) | 103 self.assertNotIn(item, other_v_dict[key]) |
101 | 104 |
102 | 105 |
103 def main(): | 106 def main(): |
104 loader = unittest.TestLoader() | 107 loader = unittest.TestLoader() |
105 suite = loader.loadTestsFromTestCase(VarsDictTest) | 108 suite = loader.loadTestsFromTestCase(VarsDictTest) |
106 unittest.TextTestRunner(verbosity=2).run(suite) | 109 unittest.TextTestRunner(verbosity=2).run(suite) |
107 | 110 |
108 if __name__ == "__main__": | 111 if __name__ == "__main__": |
109 main() | 112 main() |
110 | 113 |
OLD | NEW |