OLD | NEW |
1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2011, 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_suite"); | 5 #library("test_suite"); |
6 | 6 |
7 #import("status_file_parser.dart"); | 7 #import("status_file_parser.dart"); |
8 #import("test_runner.dart"); | 8 #import("test_runner.dart"); |
9 #import("multitest.dart"); | 9 #import("multitest.dart"); |
10 | 10 |
(...skipping 340 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
351 String dartWrapperFilename = '${tempDir.path}/test.dart'; | 351 String dartWrapperFilename = '${tempDir.path}/test.dart'; |
352 if (!isWebTest) { | 352 if (!isWebTest) { |
353 // test.dart will import the dart test directly, if it is a library, | 353 // test.dart will import the dart test directly, if it is a library, |
354 // or indirectly through test_as_library.dart, if it is not. | 354 // or indirectly through test_as_library.dart, if it is not. |
355 String dartLibraryFilename; | 355 String dartLibraryFilename; |
356 if (isLibraryDefinition) { | 356 if (isLibraryDefinition) { |
357 dartLibraryFilename = dartTestFilename; | 357 dartLibraryFilename = dartTestFilename; |
358 } else { | 358 } else { |
359 dartLibraryFilename = 'test_as_library.dart'; | 359 dartLibraryFilename = 'test_as_library.dart'; |
360 File file = new File('${tempDir.path}/$dartLibraryFilename'); | 360 File file = new File('${tempDir.path}/$dartLibraryFilename'); |
361 RandomAccessFile dartLibrary = file.openSync(writable: true); | 361 RandomAccessFile dartLibrary = file.openSync(FileMode.WRITE); |
362 dartLibrary.writeStringSync(WrapDartTestInLibrary(dartTestFilename)); | 362 dartLibrary.writeStringSync(WrapDartTestInLibrary(dartTestFilename)); |
363 dartLibrary.closeSync(); | 363 dartLibrary.closeSync(); |
364 } | 364 } |
365 | 365 |
366 File file = new File(dartWrapperFilename); | 366 File file = new File(dartWrapperFilename); |
367 RandomAccessFile dartWrapper = file.openSync(writable: true); | 367 RandomAccessFile dartWrapper = file.openSync(FileMode.WRITE); |
368 dartWrapper.writeStringSync(DartTestWrapper( | 368 dartWrapper.writeStringSync(DartTestWrapper( |
369 'dart:dom', | 369 'dart:dom', |
370 '../../../tests/isolate/src/TestFramework.dart', | 370 '../../../tests/isolate/src/TestFramework.dart', |
371 dartLibraryFilename)); | 371 dartLibraryFilename)); |
372 dartWrapper.closeSync(); | 372 dartWrapper.closeSync(); |
373 } else { | 373 } else { |
374 return; // TODO(whesse): Implement client web tests on dartium. | 374 return; // TODO(whesse): Implement client web tests on dartium. |
375 } | 375 } |
376 // Create the HTML file for the test. | 376 // Create the HTML file for the test. |
377 File htmlTestBase = new File('${tempDir.path}/${getHtmlName(filename)}'); | 377 File htmlTestBase = new File('${tempDir.path}/${getHtmlName(filename)}'); |
378 RandomAccessFile htmlTest = htmlTestBase.openSync(writable: true); | 378 RandomAccessFile htmlTest = htmlTestBase.openSync(FileMode.WRITE); |
379 htmlTest.writeStringSync(GetHtmlContents( | 379 htmlTest.writeStringSync(GetHtmlContents( |
380 filename, | 380 filename, |
381 '../../../client/testing/unittest/test_controller.js', | 381 '../../../client/testing/unittest/test_controller.js', |
382 scriptType, | 382 scriptType, |
383 '../../../$dartWrapperFilename')); | 383 '../../../$dartWrapperFilename')); |
384 htmlTest.closeSync(); | 384 htmlTest.closeSync(); |
385 | 385 |
386 for (var vmOptions in optionsFromFile["vmOptions"]) { | 386 for (var vmOptions in optionsFromFile["vmOptions"]) { |
387 var drtFlags = ['-no-timeout']; | 387 var drtFlags = ['-no-timeout']; |
388 var dartFlags = ['--enable_asserts', '--enable_type_checks']; | 388 var dartFlags = ['--enable_asserts', '--enable_type_checks']; |
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
462 | 462 |
463 if (!isWebTest) { | 463 if (!isWebTest) { |
464 // test.dart will import the dart test directly, if it is a library, | 464 // test.dart will import the dart test directly, if it is a library, |
465 // or indirectly through test_as_library.dart, if it is not. | 465 // or indirectly through test_as_library.dart, if it is not. |
466 String dartLibraryFilename; | 466 String dartLibraryFilename; |
467 if (isLibraryDefinition) { | 467 if (isLibraryDefinition) { |
468 dartLibraryFilename = testPath; | 468 dartLibraryFilename = testPath; |
469 } else { | 469 } else { |
470 dartLibraryFilename = 'test_as_library.dart'; | 470 dartLibraryFilename = 'test_as_library.dart'; |
471 File file = new File('${tempDir.path}/$dartLibraryFilename'); | 471 File file = new File('${tempDir.path}/$dartLibraryFilename'); |
472 RandomAccessFile dartLibrary = file.openSync(writable: true); | 472 RandomAccessFile dartLibrary = file.openSync(FileMode.WRITE); |
473 dartLibrary.writeStringSync(WrapDartTestInLibrary(testPath)); | 473 dartLibrary.writeStringSync(WrapDartTestInLibrary(testPath)); |
474 dartLibrary.closeSync(); | 474 dartLibrary.closeSync(); |
475 } | 475 } |
476 | 476 |
477 File file = new File(dartWrapperFilename); | 477 File file = new File(dartWrapperFilename); |
478 RandomAccessFile dartWrapper = file.openSync(writable: true); | 478 RandomAccessFile dartWrapper = file.openSync(FileMode.WRITE); |
479 dartWrapper.writeStringSync(DartTestWrapper( | 479 dartWrapper.writeStringSync(DartTestWrapper( |
480 domLibraryImport, | 480 domLibraryImport, |
481 '$dartDir/tests/isolate/src/TestFramework.dart', | 481 '$dartDir/tests/isolate/src/TestFramework.dart', |
482 dartLibraryFilename)); | 482 dartLibraryFilename)); |
483 dartWrapper.closeSync(); | 483 dartWrapper.closeSync(); |
484 } else { | 484 } else { |
485 return; // TODO(whesse): Implement client web tests on dartium. | 485 return; // TODO(whesse): Implement client web tests on dartium. |
486 } | 486 } |
487 // Create the HTML file for the test. | 487 // Create the HTML file for the test. |
488 File htmlTestBase = new File('${tempDir.path}/${getHtmlName(filename)}'); | 488 File htmlTestBase = new File('${tempDir.path}/${getHtmlName(filename)}'); |
489 RandomAccessFile htmlTest = htmlTestBase.openSync(writable: true); | 489 RandomAccessFile htmlTest = htmlTestBase.openSync(FileMode.WRITE); |
490 htmlTest.writeStringSync(GetHtmlContents( | 490 htmlTest.writeStringSync(GetHtmlContents( |
491 filename, | 491 filename, |
492 '$dartDir/client/testing/unittest/test_controller.js', | 492 '$dartDir/client/testing/unittest/test_controller.js', |
493 scriptType, | 493 scriptType, |
494 compiledDartWrapperFilename)); | 494 compiledDartWrapperFilename)); |
495 htmlTest.closeSync(); | 495 htmlTest.closeSync(); |
496 | 496 |
497 for (var vmOptions in optionsFromFile["vmOptions"]) { | 497 for (var vmOptions in optionsFromFile["vmOptions"]) { |
498 List<String> compilerArgs; | 498 List<String> compilerArgs; |
499 String compilerExecutable = TestUtils.compilerPath(configuration); | 499 String compilerExecutable = TestUtils.compilerPath(configuration); |
(...skipping 526 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1026 * $noCrash tests are expected to be flaky but not crash | 1026 * $noCrash tests are expected to be flaky but not crash |
1027 * $pass tests are expected to pass | 1027 * $pass tests are expected to pass |
1028 * $failOk tests are expected to fail that we won't fix | 1028 * $failOk tests are expected to fail that we won't fix |
1029 * $fail tests are expected to fail that we should fix | 1029 * $fail tests are expected to fail that we should fix |
1030 * $crash tests are expected to crash that we should fix | 1030 * $crash tests are expected to crash that we should fix |
1031 * $timeout tests are allowed to timeout\ | 1031 * $timeout tests are allowed to timeout\ |
1032 """; | 1032 """; |
1033 print(report); | 1033 print(report); |
1034 } | 1034 } |
1035 } | 1035 } |
OLD | NEW |