| 423 | ret=1) |
| 424 | |
| 425 | def test_gen_swarming(self): |
| 426 | files = { |
| 427 | '/tmp/swarming_targets': |
| 428 | 'base_unittests\n', |
| 429 | '/fake_src/testing/buildbot/gn_isolate_map.pyl': |
| 430 | ("{'base_unittests': {" |
| 431 | " 'label': '//base:base_unittests'," |
| 432 | " 'type': 'console_test_launcher'," |
| 433 | "}}\n"), |
| 434 | } |
| 435 | |
| 436 | mbw = self.fake_mbw(files) |
| 437 | |
| 438 | def fake_call(cmd, env=None, buffer_output=True, input=''): |
| 439 | del cmd |
| 440 | del env |
| 441 | del buffer_output |
| 442 | del input |
| 443 | mbw.files['/fake_src/out/Default/base_unittests.runtime_deps'] = ( |
| 444 | 'base_unittests\n') |
| 445 | return 0, '', '' |
| 446 | |
| 447 | mbw.Call = fake_call |
| 448 | |
| 449 | self.check([ |
| 450 | 'gen', '-c', 'debug_remoteexec', '--swarming-targets-file', |
| 451 | '/tmp/swarming_targets', '//out/Default' |
| 452 | ], |
| 453 | mbw=mbw, |
| 454 | ret=0) |
| 455 | self.assertIn('/fake_src/out/Default/base_unittests.isolate', mbw.files) |
| 456 | self.assertIn('/fake_src/out/Default/base_unittests.isolated.gen.json', |
| 457 | mbw.files) |
| 458 | |
| 459 | def test_gen_swarming_script(self): |
| 460 | files = { |