| OLD | NEW |
| 1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
| 2 # Copyright (c) 2014 Google Inc. All rights reserved. | 2 # Copyright (c) 2014 Google Inc. All rights reserved. |
| 3 # Use of this source code is governed by a BSD-style license that can be | 3 # Use of this source code is governed by a BSD-style license that can be |
| 4 # found in the LICENSE file. | 4 # found in the LICENSE file. |
| 5 | 5 |
| 6 """Tests for analyzer | 6 """Tests for analyzer |
| 7 """ | 7 """ |
| 8 | 8 |
| 9 import json | 9 import json |
| 10 import TestGyp | 10 import TestGyp |
| (...skipping 218 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 229 # Verifies paths with // are fixed up correctly. | 229 # Verifies paths with // are fixed up correctly. |
| 230 _CreateConfigFile(['parent_source.c'], []) | 230 _CreateConfigFile(['parent_source.c'], []) |
| 231 run_analyzer() | 231 run_analyzer() |
| 232 EnsureContains(matched=True, build_targets={'exe', 'exe3'}) | 232 EnsureContains(matched=True, build_targets={'exe', 'exe3'}) |
| 233 | 233 |
| 234 # Verifies relative paths are resolved correctly. | 234 # Verifies relative paths are resolved correctly. |
| 235 _CreateConfigFile(['subdir/subdir_source.h'], []) | 235 _CreateConfigFile(['subdir/subdir_source.h'], []) |
| 236 run_analyzer() | 236 run_analyzer() |
| 237 EnsureContains(matched=True, build_targets={'exe'}) | 237 EnsureContains(matched=True, build_targets={'exe'}) |
| 238 | 238 |
| 239 # Verifies relative paths in inputs are resolved correctly. |
| 240 _CreateConfigFile(['rel_path1.h'], []) |
| 241 run_analyzer() |
| 242 EnsureContains(matched=True, build_targets={'exe'}) |
| 243 |
| 239 # Various permutations when passing in targets. | 244 # Various permutations when passing in targets. |
| 240 _CreateConfigFile(['exe2.c', 'subdir/subdir2b_source.c'], ['exe', 'exe3']) | 245 _CreateConfigFile(['exe2.c', 'subdir/subdir2b_source.c'], ['exe', 'exe3']) |
| 241 run_analyzer() | 246 run_analyzer() |
| 242 EnsureContains(matched=True, targets={'exe3'}, build_targets={'exe2', 'exe3'}) | 247 EnsureContains(matched=True, targets={'exe3'}, build_targets={'exe2', 'exe3'}) |
| 243 | 248 |
| 244 _CreateConfigFile(['exe2.c', 'subdir/subdir2b_source.c'], ['exe']) | 249 _CreateConfigFile(['exe2.c', 'subdir/subdir2b_source.c'], ['exe']) |
| 245 run_analyzer() | 250 run_analyzer() |
| 246 EnsureContains(matched=True, build_targets={'exe2', 'exe3'}) | 251 EnsureContains(matched=True, build_targets={'exe2', 'exe3'}) |
| 247 | 252 |
| 248 # Verifies duplicates are ignored. | 253 # Verifies duplicates are ignored. |
| (...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 355 | 360 |
| 356 _CreateConfigFile(['d.c'], []) | 361 _CreateConfigFile(['d.c'], []) |
| 357 run_analyzer4() | 362 run_analyzer4() |
| 358 EnsureContains(matched=True, build_targets={'a', 'b', 'c', 'd'}) | 363 EnsureContains(matched=True, build_targets={'a', 'b', 'c', 'd'}) |
| 359 | 364 |
| 360 _CreateConfigFile(['i.c'], []) | 365 _CreateConfigFile(['i.c'], []) |
| 361 run_analyzer4() | 366 run_analyzer4() |
| 362 EnsureContains(matched=True, build_targets={'h', 'i'}) | 367 EnsureContains(matched=True, build_targets={'h', 'i'}) |
| 363 | 368 |
| 364 test.pass_test() | 369 test.pass_test() |
| OLD | NEW |