| OLD | NEW |
| 1 #!/usr/bin/python | 1 #!/usr/bin/python |
| 2 # Copyright (c) 2016 The WebRTC project authors. All Rights Reserved. | 2 # Copyright (c) 2016 The WebRTC project authors. All Rights Reserved. |
| 3 # | 3 # |
| 4 # Use of this source code is governed by a BSD-style license | 4 # Use of this source code is governed by a BSD-style license |
| 5 # that can be found in the LICENSE file in the root of the source | 5 # that can be found in the LICENSE file in the root of the source |
| 6 # tree. An additional intellectual property rights grant can be found | 6 # tree. An additional intellectual property rights grant can be found |
| 7 # in the file PATENTS. All contributing project authors may | 7 # in the file PATENTS. All contributing project authors may |
| 8 # be found in the AUTHORS file in the root of the source tree. | 8 # be found in the AUTHORS file in the root of the source tree. |
| 9 | 9 |
| 10 """Tests for mb.py.""" | 10 """Tests for mb.py.""" |
| (...skipping 360 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 371 '/fake_src/testing/buildbot/gn_isolate_map.pyl'], | 371 '/fake_src/testing/buildbot/gn_isolate_map.pyl'], |
| 372 files=test_files, ret=0) | 372 files=test_files, ret=0) |
| 373 | 373 |
| 374 isolate_file = mbw.files['/fake_src/out/Default/base_unittests.isolate'] | 374 isolate_file = mbw.files['/fake_src/out/Default/base_unittests.isolate'] |
| 375 isolate_file_contents = ast.literal_eval(isolate_file) | 375 isolate_file_contents = ast.literal_eval(isolate_file) |
| 376 files = isolate_file_contents['variables']['files'] | 376 files = isolate_file_contents['variables']['files'] |
| 377 command = isolate_file_contents['variables']['command'] | 377 command = isolate_file_contents['variables']['command'] |
| 378 | 378 |
| 379 self.assertEqual(files, ['base_unittests']) | 379 self.assertEqual(files, ['base_unittests']) |
| 380 self.assertEqual(command, [ | 380 self.assertEqual(command, [ |
| 381 './../../build/android/test_wrapper/logdog_wrapper.py', | 381 '../../build/android/test_wrapper/logdog_wrapper.py', |
| 382 '--logdog-bin-cmd', './../../bin/logdog_butler', | 382 '--target', 'base_unittests', |
| 383 '--project', 'chromium', | 383 '--logdog-bin-cmd', '../../bin/logdog_butler', |
| 384 '--service-account-json', | 384 '--target-devices-file', '${SWARMING_BOT_FILE}' |
| 385 '/creds/service_accounts/service-account-luci-logdog-publisher.json', | |
| 386 '--prefix', 'android/swarming/logcats/${SWARMING_TASK_ID}', | |
| 387 '--source', '${ISOLATED_OUTDIR}/logcats', | |
| 388 '--name', 'unified_logcats', | |
| 389 'bin/run_base_unittests', | |
| 390 '--logcat-output-file', '${ISOLATED_OUTDIR}/logcats', | |
| 391 '--target-devices-file', '${SWARMING_BOT_FILE}', | |
| 392 '-v', | |
| 393 ]) | 385 ]) |
| 394 | 386 |
| 395 def test_gn_gen_swarming_android_junit_test(self): | 387 def test_gn_gen_swarming_android_junit_test(self): |
| 396 test_files = { | 388 test_files = { |
| 397 '/tmp/swarming_targets': 'base_unittests\n', | 389 '/tmp/swarming_targets': 'base_unittests\n', |
| 398 '/fake_src/testing/buildbot/gn_isolate_map.pyl': ( | 390 '/fake_src/testing/buildbot/gn_isolate_map.pyl': ( |
| 399 "{'base_unittests': {" | 391 "{'base_unittests': {" |
| 400 " 'label': '//base:base_unittests'," | 392 " 'label': '//base:base_unittests'," |
| 401 " 'type': 'junit_test'," | 393 " 'type': 'junit_test'," |
| 402 "}}\n" | 394 "}}\n" |
| 403 ), | 395 ), |
| 404 '/fake_src/out/Default/base_unittests.runtime_deps': ( | 396 '/fake_src/out/Default/base_unittests.runtime_deps': ( |
| 405 "base_unittests\n" | 397 "base_unittests\n" |
| 406 ), | 398 ), |
| 407 } | 399 } |
| 408 mbw = self.check(['gen', '-c', 'gn_android_bot', '//out/Default', | 400 mbw = self.check(['gen', '-c', 'gn_android_bot', '//out/Default', |
| 409 '--swarming-targets-file', '/tmp/swarming_targets', | 401 '--swarming-targets-file', '/tmp/swarming_targets', |
| 410 '--isolate-map-file', | 402 '--isolate-map-file', |
| 411 '/fake_src/testing/buildbot/gn_isolate_map.pyl'], | 403 '/fake_src/testing/buildbot/gn_isolate_map.pyl'], |
| 412 files=test_files, ret=0) | 404 files=test_files, ret=0) |
| 413 | 405 |
| 414 isolate_file = mbw.files['/fake_src/out/Default/base_unittests.isolate'] | 406 isolate_file = mbw.files['/fake_src/out/Default/base_unittests.isolate'] |
| 415 isolate_file_contents = ast.literal_eval(isolate_file) | 407 isolate_file_contents = ast.literal_eval(isolate_file) |
| 416 files = isolate_file_contents['variables']['files'] | 408 files = isolate_file_contents['variables']['files'] |
| 417 command = isolate_file_contents['variables']['command'] | 409 command = isolate_file_contents['variables']['command'] |
| 418 | 410 |
| 419 self.assertEqual(files, ['base_unittests']) | 411 self.assertEqual(files, ['base_unittests']) |
| 420 self.assertEqual(command, [ | 412 self.assertEqual(command, [ |
| 421 './../../build/android/test_wrapper/logdog_wrapper.py', | 413 '../../build/android/test_wrapper/logdog_wrapper.py', |
| 422 '--logdog-bin-cmd', './../../bin/logdog_butler', | 414 '--target', 'base_unittests', |
| 423 '--project', 'chromium', | 415 '--logdog-bin-cmd', '../../bin/logdog_butler', |
| 424 '--service-account-json', | |
| 425 '/creds/service_accounts/service-account-luci-logdog-publisher.json', | |
| 426 '--prefix', 'android/swarming/logcats/${SWARMING_TASK_ID}', | |
| 427 '--source', '${ISOLATED_OUTDIR}/logcats', | |
| 428 '--name', 'unified_logcats', | |
| 429 'bin/run_base_unittests', | |
| 430 '--logcat-output-file', '${ISOLATED_OUTDIR}/logcats', | |
| 431 '-v', | |
| 432 ]) | 416 ]) |
| 433 | 417 |
| 434 def test_gn_gen_non_parallel_console_test_launcher(self): | 418 def test_gn_gen_non_parallel_console_test_launcher(self): |
| 435 test_files = { | 419 test_files = { |
| 436 '/tmp/swarming_targets': 'base_unittests\n', | 420 '/tmp/swarming_targets': 'base_unittests\n', |
| 437 '/fake_src/testing/buildbot/gn_isolate_map.pyl': ( | 421 '/fake_src/testing/buildbot/gn_isolate_map.pyl': ( |
| 438 "{'base_unittests': {" | 422 "{'base_unittests': {" |
| 439 " 'label': '//base:base_unittests'," | 423 " 'label': '//base:base_unittests'," |
| 440 " 'type': 'non_parallel_console_test_launcher'," | 424 " 'type': 'non_parallel_console_test_launcher'," |
| 441 "}}\n" | 425 "}}\n" |
| (...skipping 336 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 778 self.check(['lookup', '-c', 'fake_config'], mbw=mbw, | 762 self.check(['lookup', '-c', 'fake_config'], mbw=mbw, |
| 779 ret=0, | 763 ret=0, |
| 780 out=("GYP_DEFINES='foo=bar baz=1'\n" | 764 out=("GYP_DEFINES='foo=bar baz=1'\n" |
| 781 "GYP_LINK_CONCURRENCY=1\n" | 765 "GYP_LINK_CONCURRENCY=1\n" |
| 782 "LLVM_FORCE_HEAD_REVISION=1\n" | 766 "LLVM_FORCE_HEAD_REVISION=1\n" |
| 783 "python build/gyp_chromium -G output_dir=_path_\n")) | 767 "python build/gyp_chromium -G output_dir=_path_\n")) |
| 784 | 768 |
| 785 | 769 |
| 786 if __name__ == '__main__': | 770 if __name__ == '__main__': |
| 787 unittest.main() | 771 unittest.main() |
| OLD | NEW |