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

Side by Side Diff: tests/fake_repos.py

Issue 2839008: Make the DEPS parsing saner. (Closed)
Patch Set: Take 3. fixes issue with double-parsed DEPS Created 10 years, 6 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 unified diff | Download patch
« no previous file with comments | « gclient.py ('k') | tests/gclient_smoketest.py » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 #!/usr/bin/python 1 #!/usr/bin/python
2 # Copyright (c) 2010 The Chromium Authors. All rights reserved. 2 # Copyright (c) 2010 The Chromium Authors. 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 """Generate fake repositories for testing.""" 6 """Generate fake repositories for testing."""
7 7
8 import atexit 8 import atexit
9 import errno 9 import errno
10 import logging 10 import logging
(...skipping 319 matching lines...) Expand 10 before | Expand all | Expand 10 after
330 return fs 330 return fs
331 331
332 # Testing: 332 # Testing:
333 # - dependency disapear 333 # - dependency disapear
334 # - dependency renamed 334 # - dependency renamed
335 # - versioned and unversioned reference 335 # - versioned and unversioned reference
336 # - relative and full reference 336 # - relative and full reference
337 # - deps_os 337 # - deps_os
338 # - var 338 # - var
339 # - hooks 339 # - hooks
340 # - From
340 # TODO(maruel): 341 # TODO(maruel):
341 # - From
342 # - File 342 # - File
343 # - $matching_files 343 # - $matching_files
344 # - use_relative_paths 344 # - use_relative_paths
345 fs = file_system(1, """ 345 fs = file_system(1, """
346 vars = { 346 vars = {
347 'DummyVariable': 'third_party', 347 'DummyVariable': 'third_party',
348 } 348 }
349 deps = { 349 deps = {
350 'src/other': 'svn://%(host)s/svn/trunk/other@1', 350 'src/other': 'svn://%(host)s/svn/trunk/other@1',
351 'src/third_party/fpp': '/trunk/' + Var('DummyVariable') + '/foo', 351 'src/third_party/fpp': '/trunk/' + Var('DummyVariable') + '/foo',
352 } 352 }
353 deps_os = { 353 deps_os = {
354 'mac': { 354 'mac': {
355 'src/third_party/prout': '/trunk/third_party/prout', 355 'src/third_party/prout': '/trunk/third_party/prout',
356 }, 356 },
357 }""" % { 'host': self.HOST }) 357 }""" % { 'host': self.HOST })
358 self._commit_svn(fs) 358 self._commit_svn(fs)
359 359
360 fs = file_system(2, """ 360 fs = file_system(2, """
361 deps = { 361 deps = {
362 'src/other': 'svn://%(host)s/svn/trunk/other', 362 'src/other': 'svn://%(host)s/svn/trunk/other',
363 'src/third_party/foo': '/trunk/third_party/foo@1', 363 #'src/third_party/foo': '/trunk/third_party/foo@1',
364 #'src/third_party/foo': From('src/other', 'foo/bar'), 364 'src/third_party/foo': From('src/other', 'foo/bar'),
365 } 365 }
366 # I think this is wrong to have the hooks run from the base of the gclient 366 # I think this is wrong to have the hooks run from the base of the gclient
367 # checkout. It's maybe a bit too late to change that behavior. 367 # checkout. It's maybe a bit too late to change that behavior.
368 hooks = [ 368 hooks = [
369 { 369 {
370 'pattern': '.', 370 'pattern': '.',
371 'action': ['python', '-c', 371 'action': ['python', '-c',
372 'open(\\'src/svn_hooked1\\', \\'w\\').write(\\'svn_hooked1\\')'], 372 'open(\\'src/svn_hooked1\\', \\'w\\').write(\\'svn_hooked1\\')'],
373 }, 373 },
374 { 374 {
(...skipping 23 matching lines...) Expand all
398 self.git_hashes[repo] = [None] 398 self.git_hashes[repo] = [None]
399 399
400 # Testing: 400 # Testing:
401 # - dependency disapear 401 # - dependency disapear
402 # - dependency renamed 402 # - dependency renamed
403 # - versioned and unversioned reference 403 # - versioned and unversioned reference
404 # - relative and full reference 404 # - relative and full reference
405 # - deps_os 405 # - deps_os
406 # - var 406 # - var
407 # - hooks 407 # - hooks
408 # - From
408 # TODO(maruel): 409 # TODO(maruel):
409 # - From
410 # - File 410 # - File
411 # - $matching_files 411 # - $matching_files
412 # - use_relative_paths 412 # - use_relative_paths
413 self._commit_git('repo_3', { 413 self._commit_git('repo_3', {
414 'origin': 'git/repo_3@1\n', 414 'origin': 'git/repo_3@1\n',
415 }) 415 })
416 416
417 self._commit_git('repo_3', { 417 self._commit_git('repo_3', {
418 'origin': 'git/repo_3@2\n', 418 'origin': 'git/repo_3@2\n',
419 }) 419 })
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
460 }) 460 })
461 461
462 self._commit_git('repo_4', { 462 self._commit_git('repo_4', {
463 'origin': 'git/repo_4@2\n', 463 'origin': 'git/repo_4@2\n',
464 }) 464 })
465 465
466 self._commit_git('repo_1', { 466 self._commit_git('repo_1', {
467 'DEPS': """ 467 'DEPS': """
468 deps = { 468 deps = {
469 'src/repo2': 'git://%(host)s/git/repo_2@%(hash)s', 469 'src/repo2': 'git://%(host)s/git/repo_2@%(hash)s',
470 'src/repo2/repo_renamed': '/repo_3', 470 #'src/repo2/repo_renamed': '/repo_3',
471 #'src/repo2/repo_renamed': From('src/repo2', 'foo/bar'), 471 'src/repo2/repo_renamed': From('src/repo2', 'foo/bar'),
472 } 472 }
473 # I think this is wrong to have the hooks run from the base of the gclient 473 # I think this is wrong to have the hooks run from the base of the gclient
474 # checkout. It's maybe a bit too late to change that behavior. 474 # checkout. It's maybe a bit too late to change that behavior.
475 hooks = [ 475 hooks = [
476 { 476 {
477 'pattern': '.', 477 'pattern': '.',
478 'action': ['python', '-c', 478 'action': ['python', '-c',
479 'open(\\'src/git_hooked1\\', \\'w\\').write(\\'git_hooked1\\')'], 479 'open(\\'src/git_hooked1\\', \\'w\\').write(\\'git_hooked1\\')'],
480 }, 480 },
481 { 481 {
(...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after
632 632
633 633
634 # Kind of hack. 634 # Kind of hack.
635 if '-l' in sys.argv: 635 if '-l' in sys.argv:
636 FakeRepos.SHOULD_LEAK = True 636 FakeRepos.SHOULD_LEAK = True
637 sys.argv.remove('-l') 637 sys.argv.remove('-l')
638 638
639 639
640 if __name__ == '__main__': 640 if __name__ == '__main__':
641 sys.exit(main(sys.argv)) 641 sys.exit(main(sys.argv))
OLDNEW
« no previous file with comments | « gclient.py ('k') | tests/gclient_smoketest.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698