| OLD | NEW |
| 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, 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 /** | 5 /** |
| 6 * Classes and methods for enumerating and preparing tests. | 6 * Classes and methods for enumerating and preparing tests. |
| 7 * | 7 * |
| 8 * This library includes: | 8 * This library includes: |
| 9 * | 9 * |
| 10 * - Creating tests by listing all the Dart files in certain directories, | 10 * - Creating tests by listing all the Dart files in certain directories, |
| (...skipping 521 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 532 String optionsName = ''; | 532 String optionsName = ''; |
| 533 if (optionsFromFile['vmOptions'].length > 1) { | 533 if (optionsFromFile['vmOptions'].length > 1) { |
| 534 optionsName = Strings.join(vmOptions, '-').replaceAll('-','') | 534 optionsName = Strings.join(vmOptions, '-').replaceAll('-','') |
| 535 .replaceAll('=','') | 535 .replaceAll('=','') |
| 536 .replaceAll('/',''); | 536 .replaceAll('/',''); |
| 537 } | 537 } |
| 538 Directory tempDir = createOutputDirectory(testPath, optionsName); | 538 Directory tempDir = createOutputDirectory(testPath, optionsName); |
| 539 | 539 |
| 540 String dartWrapperFilename = '${tempDir.path}/test.dart'; | 540 String dartWrapperFilename = '${tempDir.path}/test.dart'; |
| 541 String compiledDartWrapperFilename = '${tempDir.path}/test.js'; | 541 String compiledDartWrapperFilename = '${tempDir.path}/test.js'; |
| 542 String domLibraryImport = 'dart:dom'; | |
| 543 | 542 |
| 544 String htmlPath = '${tempDir.path}/test.html'; | 543 String htmlPath = '${tempDir.path}/test.html'; |
| 545 if (!isWebTest) { | 544 if (!isWebTest) { |
| 546 // test.dart will import the dart test directly, if it is a library, | 545 // test.dart will import the dart test directly, if it is a library, |
| 547 // or indirectly through test_as_library.dart, if it is not. | 546 // or indirectly through test_as_library.dart, if it is not. |
| 548 String dartLibraryFilename; | 547 String dartLibraryFilename; |
| 549 if (isLibraryDefinition) { | 548 if (isLibraryDefinition) { |
| 550 dartLibraryFilename = testPath; | 549 dartLibraryFilename = testPath; |
| 551 } else { | 550 } else { |
| 552 dartLibraryFilename = 'test_as_library.dart'; | 551 dartLibraryFilename = 'test_as_library.dart'; |
| 553 File file = new File('${tempDir.path}/$dartLibraryFilename'); | 552 File file = new File('${tempDir.path}/$dartLibraryFilename'); |
| 554 RandomAccessFile dartLibrary = file.openSync(FileMode.WRITE); | 553 RandomAccessFile dartLibrary = file.openSync(FileMode.WRITE); |
| 555 dartLibrary.writeStringSync(WrapDartTestInLibrary(testPath)); | 554 dartLibrary.writeStringSync(WrapDartTestInLibrary(testPath)); |
| 556 dartLibrary.closeSync(); | 555 dartLibrary.closeSync(); |
| 557 } | 556 } |
| 558 | 557 |
| 559 File file = new File(dartWrapperFilename); | 558 File file = new File(dartWrapperFilename); |
| 560 RandomAccessFile dartWrapper = file.openSync(FileMode.WRITE); | 559 RandomAccessFile dartWrapper = file.openSync(FileMode.WRITE); |
| 561 dartWrapper.writeStringSync(DartTestWrapper( | 560 dartWrapper.writeStringSync( |
| 562 domLibraryImport, | 561 DartTestWrapper(dartDir, dartLibraryFilename)); |
| 563 '$dartDir/tests/isolate/src/TestFramework.dart', | |
| 564 dartLibraryFilename)); | |
| 565 dartWrapper.closeSync(); | 562 dartWrapper.closeSync(); |
| 566 } else { | 563 } else { |
| 567 dartWrapperFilename = testPath; | 564 dartWrapperFilename = testPath; |
| 568 // TODO(whesse): Once test.py is retired, adjust the relative path in | 565 // TODO(whesse): Once test.py is retired, adjust the relative path in |
| 569 // the client/samples/dartcombat test to its css file, remove the | 566 // the client/samples/dartcombat test to its css file, remove the |
| 570 // "../../" from this path, and move this out of the isWebTest guard. | 567 // "../../" from this path, and move this out of the isWebTest guard. |
| 571 // Also remove getHtmlName, and just use test.html. | 568 // Also remove getHtmlName, and just use test.html. |
| 572 // TODO(efortuna): this shortening of htmlFilename is a band-aid until | 569 // TODO(efortuna): this shortening of htmlFilename is a band-aid until |
| 573 // the above TODO gets fixed. Windows cannot have paths that are longer | 570 // the above TODO gets fixed. Windows cannot have paths that are longer |
| 574 // than 260 characters, and without this hack, we were running past the | 571 // than 260 characters, and without this hack, we were running past the |
| (...skipping 795 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1370 * $noCrash tests are expected to be flaky but not crash | 1367 * $noCrash tests are expected to be flaky but not crash |
| 1371 * $pass tests are expected to pass | 1368 * $pass tests are expected to pass |
| 1372 * $failOk tests are expected to fail that we won't fix | 1369 * $failOk tests are expected to fail that we won't fix |
| 1373 * $fail tests are expected to fail that we should fix | 1370 * $fail tests are expected to fail that we should fix |
| 1374 * $crash tests are expected to crash that we should fix | 1371 * $crash tests are expected to crash that we should fix |
| 1375 * $timeout tests are allowed to timeout | 1372 * $timeout tests are allowed to timeout |
| 1376 """; | 1373 """; |
| 1377 print(report); | 1374 print(report); |
| 1378 } | 1375 } |
| 1379 } | 1376 } |
| OLD | NEW |