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 361 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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', | |
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 ]) | 384 ]) |
394 | 385 |
395 def test_gn_gen_swarming_android_junit_test(self): | 386 def test_gn_gen_swarming_android_junit_test(self): |
396 test_files = { | 387 test_files = { |
397 '/tmp/swarming_targets': 'base_unittests\n', | 388 '/tmp/swarming_targets': 'base_unittests\n', |
398 '/fake_src/testing/buildbot/gn_isolate_map.pyl': ( | 389 '/fake_src/testing/buildbot/gn_isolate_map.pyl': ( |
399 "{'base_unittests': {" | 390 "{'base_unittests': {" |
400 " 'label': '//base:base_unittests'," | 391 " 'label': '//base:base_unittests'," |
401 " 'type': 'junit_test'," | 392 " 'type': 'junit_test'," |
402 "}}\n" | 393 "}}\n" |
403 ), | 394 ), |
404 '/fake_src/out/Default/base_unittests.runtime_deps': ( | 395 '/fake_src/out/Default/base_unittests.runtime_deps': ( |
405 "base_unittests\n" | 396 "base_unittests\n" |
406 ), | 397 ), |
407 } | 398 } |
408 mbw = self.check(['gen', '-c', 'gn_android_bot', '//out/Default', | 399 mbw = self.check(['gen', '-c', 'gn_android_bot', '//out/Default', |
409 '--swarming-targets-file', '/tmp/swarming_targets', | 400 '--swarming-targets-file', '/tmp/swarming_targets', |
410 '--isolate-map-file', | 401 '--isolate-map-file', |
411 '/fake_src/testing/buildbot/gn_isolate_map.pyl'], | 402 '/fake_src/testing/buildbot/gn_isolate_map.pyl'], |
412 files=test_files, ret=0) | 403 files=test_files, ret=0) |
413 | 404 |
414 isolate_file = mbw.files['/fake_src/out/Default/base_unittests.isolate'] | 405 isolate_file = mbw.files['/fake_src/out/Default/base_unittests.isolate'] |
415 isolate_file_contents = ast.literal_eval(isolate_file) | 406 isolate_file_contents = ast.literal_eval(isolate_file) |
416 files = isolate_file_contents['variables']['files'] | 407 files = isolate_file_contents['variables']['files'] |
417 command = isolate_file_contents['variables']['command'] | 408 command = isolate_file_contents['variables']['command'] |
418 | 409 |
419 self.assertEqual(files, ['base_unittests']) | 410 self.assertEqual(files, ['base_unittests']) |
420 self.assertEqual(command, [ | 411 self.assertEqual(command, [ |
421 './../../build/android/test_wrapper/logdog_wrapper.py', | 412 './../../build/android/test_wrapper/logdog_wrapper.py', |
422 '--logdog-bin-cmd', './../../bin/logdog_butler', | 413 '--target', 'base_unittests', |
423 '--project', 'chromium', | 414 '--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 ]) | 415 ]) |
433 | 416 |
434 def test_gn_gen_non_parallel_console_test_launcher(self): | 417 def test_gn_gen_non_parallel_console_test_launcher(self): |
435 test_files = { | 418 test_files = { |
436 '/tmp/swarming_targets': 'base_unittests\n', | 419 '/tmp/swarming_targets': 'base_unittests\n', |
437 '/fake_src/testing/buildbot/gn_isolate_map.pyl': ( | 420 '/fake_src/testing/buildbot/gn_isolate_map.pyl': ( |
438 "{'base_unittests': {" | 421 "{'base_unittests': {" |
439 " 'label': '//base:base_unittests'," | 422 " 'label': '//base:base_unittests'," |
440 " 'type': 'non_parallel_console_test_launcher'," | 423 " 'type': 'non_parallel_console_test_launcher'," |
441 "}}\n" | 424 "}}\n" |
(...skipping 336 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
778 self.check(['lookup', '-c', 'fake_config'], mbw=mbw, | 761 self.check(['lookup', '-c', 'fake_config'], mbw=mbw, |
779 ret=0, | 762 ret=0, |
780 out=("GYP_DEFINES='foo=bar baz=1'\n" | 763 out=("GYP_DEFINES='foo=bar baz=1'\n" |
781 "GYP_LINK_CONCURRENCY=1\n" | 764 "GYP_LINK_CONCURRENCY=1\n" |
782 "LLVM_FORCE_HEAD_REVISION=1\n" | 765 "LLVM_FORCE_HEAD_REVISION=1\n" |
783 "python build/gyp_chromium -G output_dir=_path_\n")) | 766 "python build/gyp_chromium -G output_dir=_path_\n")) |
784 | 767 |
785 | 768 |
786 if __name__ == '__main__': | 769 if __name__ == '__main__': |
787 unittest.main() | 770 unittest.main() |
OLD | NEW |