OLD | NEW |
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file |
2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
4 | 4 |
5 library test_helper; | 5 library test_helper; |
6 | 6 |
7 import 'dart:async'; | 7 import 'dart:async'; |
8 import 'dart:convert'; | 8 import 'dart:convert'; |
9 import 'dart:io'; | 9 import 'dart:io'; |
10 import 'package:observatory/service_io.dart'; | 10 import 'package:observatory/service_io.dart'; |
(...skipping 371 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
382 } | 382 } |
383 }); | 383 }); |
384 } | 384 } |
385 return await completer.future; | 385 return await completer.future; |
386 } | 386 } |
387 } | 387 } |
388 | 388 |
389 /// Runs [tests] in sequence, each of which should take an [Isolate] and | 389 /// Runs [tests] in sequence, each of which should take an [Isolate] and |
390 /// return a [Future]. Code for setting up state can run before and/or | 390 /// return a [Future]. Code for setting up state can run before and/or |
391 /// concurrently with the tests. Uses [mainArgs] to determine whether | 391 /// concurrently with the tests. Uses [mainArgs] to determine whether |
392 /// to run tests or testee in this invokation of the script. | 392 /// to run tests or testee in this invocation of the script. |
393 Future runIsolateTests(List<String> mainArgs, List<IsolateTest> tests, | 393 Future runIsolateTests(List<String> mainArgs, List<IsolateTest> tests, |
394 {testeeBefore(), | 394 {testeeBefore(), |
395 testeeConcurrent(), | 395 testeeConcurrent(), |
396 bool pause_on_start: false, | 396 bool pause_on_start: false, |
397 bool pause_on_exit: false, | 397 bool pause_on_exit: false, |
398 bool verbose_vm: false, | 398 bool verbose_vm: false, |
399 bool pause_on_unhandled_exceptions: false, | 399 bool pause_on_unhandled_exceptions: false, |
400 bool testeeControlsServer: false, | 400 bool testeeControlsServer: false, |
401 bool useAuthToken: false, | 401 bool useAuthToken: false, |
402 List<String> extraArgs}) async { | 402 List<String> extraArgs}) async { |
(...skipping 14 matching lines...) Expand all Loading... |
417 verbose_vm: verbose_vm, | 417 verbose_vm: verbose_vm, |
418 pause_on_unhandled_exceptions: pause_on_unhandled_exceptions, | 418 pause_on_unhandled_exceptions: pause_on_unhandled_exceptions, |
419 testeeControlsServer: testeeControlsServer, | 419 testeeControlsServer: testeeControlsServer, |
420 useAuthToken: useAuthToken); | 420 useAuthToken: useAuthToken); |
421 } | 421 } |
422 } | 422 } |
423 | 423 |
424 /// Runs [tests] in sequence, each of which should take an [Isolate] and | 424 /// Runs [tests] in sequence, each of which should take an [Isolate] and |
425 /// return a [Future]. Code for setting up state can run before and/or | 425 /// return a [Future]. Code for setting up state can run before and/or |
426 /// concurrently with the tests. Uses [mainArgs] to determine whether | 426 /// concurrently with the tests. Uses [mainArgs] to determine whether |
427 /// to run tests or testee in this invokation of the script. | 427 /// to run tests or testee in this invocation of the script. |
428 /// | 428 /// |
429 /// This is a special version of this test harness specifically for the | 429 /// This is a special version of this test harness specifically for the |
430 /// pause_on_unhandled_exceptions_test, which cannot properly function | 430 /// pause_on_unhandled_exceptions_test, which cannot properly function |
431 /// in an async context (because exceptions are *always* handled in async | 431 /// in an async context (because exceptions are *always* handled in async |
432 /// functions). | 432 /// functions). |
433 void runIsolateTestsSynchronous(List<String> mainArgs, List<IsolateTest> tests, | 433 void runIsolateTestsSynchronous(List<String> mainArgs, List<IsolateTest> tests, |
434 {void testeeBefore(), | 434 {void testeeBefore(), |
435 void testeeConcurrent(), | 435 void testeeConcurrent(), |
436 bool pause_on_start: false, | 436 bool pause_on_start: false, |
437 bool pause_on_exit: false, | 437 bool pause_on_exit: false, |
(...skipping 15 matching lines...) Expand all Loading... |
453 pause_on_start: pause_on_start, | 453 pause_on_start: pause_on_start, |
454 pause_on_exit: pause_on_exit, | 454 pause_on_exit: pause_on_exit, |
455 verbose_vm: verbose_vm, | 455 verbose_vm: verbose_vm, |
456 pause_on_unhandled_exceptions: pause_on_unhandled_exceptions); | 456 pause_on_unhandled_exceptions: pause_on_unhandled_exceptions); |
457 } | 457 } |
458 } | 458 } |
459 | 459 |
460 /// Runs [tests] in sequence, each of which should take an [Isolate] and | 460 /// Runs [tests] in sequence, each of which should take an [Isolate] and |
461 /// return a [Future]. Code for setting up state can run before and/or | 461 /// return a [Future]. Code for setting up state can run before and/or |
462 /// concurrently with the tests. Uses [mainArgs] to determine whether | 462 /// concurrently with the tests. Uses [mainArgs] to determine whether |
463 /// to run tests or testee in this invokation of the script. | 463 /// to run tests or testee in this invocation of the script. |
464 Future runVMTests(List<String> mainArgs, List<VMTest> tests, | 464 Future runVMTests(List<String> mainArgs, List<VMTest> tests, |
465 {testeeBefore(), | 465 {testeeBefore(), |
466 testeeConcurrent(), | 466 testeeConcurrent(), |
467 bool pause_on_start: false, | 467 bool pause_on_start: false, |
468 bool pause_on_exit: false, | 468 bool pause_on_exit: false, |
469 bool verbose_vm: false, | 469 bool verbose_vm: false, |
470 bool pause_on_unhandled_exceptions: false, | 470 bool pause_on_unhandled_exceptions: false, |
471 List<String> extraArgs}) async { | 471 List<String> extraArgs}) async { |
472 if (_isTestee()) { | 472 if (_isTestee()) { |
473 new _ServiceTesteeRunner().run( | 473 new _ServiceTesteeRunner().run( |
474 testeeBefore: testeeBefore, | 474 testeeBefore: testeeBefore, |
475 testeeConcurrent: testeeConcurrent, | 475 testeeConcurrent: testeeConcurrent, |
476 pause_on_start: pause_on_start, | 476 pause_on_start: pause_on_start, |
477 pause_on_exit: pause_on_exit); | 477 pause_on_exit: pause_on_exit); |
478 } else { | 478 } else { |
479 new _ServiceTesterRunner().run( | 479 new _ServiceTesterRunner().run( |
480 mainArgs: mainArgs, | 480 mainArgs: mainArgs, |
481 extraArgs: extraArgs, | 481 extraArgs: extraArgs, |
482 vmTests: tests, | 482 vmTests: tests, |
483 pause_on_start: pause_on_start, | 483 pause_on_start: pause_on_start, |
484 pause_on_exit: pause_on_exit, | 484 pause_on_exit: pause_on_exit, |
485 verbose_vm: verbose_vm, | 485 verbose_vm: verbose_vm, |
486 pause_on_unhandled_exceptions: pause_on_unhandled_exceptions); | 486 pause_on_unhandled_exceptions: pause_on_unhandled_exceptions); |
487 } | 487 } |
488 } | 488 } |
OLD | NEW |