| 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 502 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 513 String optionsName = ''; | 513 String optionsName = ''; |
| 514 if (optionsFromFile['vmOptions'].length > 1) { | 514 if (optionsFromFile['vmOptions'].length > 1) { |
| 515 optionsName = Strings.join(vmOptions, '-').replaceAll('-','') | 515 optionsName = Strings.join(vmOptions, '-').replaceAll('-','') |
| 516 .replaceAll('=','') | 516 .replaceAll('=','') |
| 517 .replaceAll('/',''); | 517 .replaceAll('/',''); |
| 518 } | 518 } |
| 519 Directory tempDir = createOutputDirectory(testPath, optionsName); | 519 Directory tempDir = createOutputDirectory(testPath, optionsName); |
| 520 | 520 |
| 521 String dartWrapperFilename = '${tempDir.path}/test.dart'; | 521 String dartWrapperFilename = '${tempDir.path}/test.dart'; |
| 522 String compiledDartWrapperFilename = '${tempDir.path}/test.js'; | 522 String compiledDartWrapperFilename = '${tempDir.path}/test.js'; |
| 523 String domLibraryImport = 'dart:dom'; | |
| 524 | 523 |
| 525 String htmlPath = '${tempDir.path}/test.html'; | 524 String htmlPath = '${tempDir.path}/test.html'; |
| 526 if (!isWebTest) { | 525 if (!isWebTest) { |
| 527 // test.dart will import the dart test directly, if it is a library, | 526 // test.dart will import the dart test directly, if it is a library, |
| 528 // or indirectly through test_as_library.dart, if it is not. | 527 // or indirectly through test_as_library.dart, if it is not. |
| 529 String dartLibraryFilename; | 528 String dartLibraryFilename; |
| 530 if (isLibraryDefinition) { | 529 if (isLibraryDefinition) { |
| 531 dartLibraryFilename = testPath; | 530 dartLibraryFilename = testPath; |
| 532 } else { | 531 } else { |
| 533 dartLibraryFilename = 'test_as_library.dart'; | 532 dartLibraryFilename = 'test_as_library.dart'; |
| 534 File file = new File('${tempDir.path}/$dartLibraryFilename'); | 533 File file = new File('${tempDir.path}/$dartLibraryFilename'); |
| 535 RandomAccessFile dartLibrary = file.openSync(FileMode.WRITE); | 534 RandomAccessFile dartLibrary = file.openSync(FileMode.WRITE); |
| 536 dartLibrary.writeStringSync(WrapDartTestInLibrary(testPath)); | 535 dartLibrary.writeStringSync(WrapDartTestInLibrary(testPath)); |
| 537 dartLibrary.closeSync(); | 536 dartLibrary.closeSync(); |
| 538 } | 537 } |
| 539 | 538 |
| 540 File file = new File(dartWrapperFilename); | 539 File file = new File(dartWrapperFilename); |
| 541 RandomAccessFile dartWrapper = file.openSync(FileMode.WRITE); | 540 RandomAccessFile dartWrapper = file.openSync(FileMode.WRITE); |
| 542 dartWrapper.writeStringSync(DartTestWrapper( | 541 dartWrapper.writeStringSync( |
| 543 domLibraryImport, | 542 DartTestWrapper('$dartDir', dartLibraryFilename)); |
| 544 '$dartDir/tests/isolate/src/TestFramework.dart', | |
| 545 dartLibraryFilename)); | |
| 546 dartWrapper.closeSync(); | 543 dartWrapper.closeSync(); |
| 547 } else { | 544 } else { |
| 548 dartWrapperFilename = testPath; | 545 dartWrapperFilename = testPath; |
| 549 // TODO(whesse): Once test.py is retired, adjust the relative path in | 546 // TODO(whesse): Once test.py is retired, adjust the relative path in |
| 550 // the client/samples/dartcombat test to its css file, remove the | 547 // the client/samples/dartcombat test to its css file, remove the |
| 551 // "../../" from this path, and move this out of the isWebTest guard. | 548 // "../../" from this path, and move this out of the isWebTest guard. |
| 552 // Also remove getHtmlName, and just use test.html. | 549 // Also remove getHtmlName, and just use test.html. |
| 553 // TODO(efortuna): this shortening of htmlFilename is a band-aid until | 550 // TODO(efortuna): this shortening of htmlFilename is a band-aid until |
| 554 // the above TODO gets fixed. Windows cannot have paths that are longer | 551 // the above TODO gets fixed. Windows cannot have paths that are longer |
| 555 // than 260 characters, and without this hack, we were running past the | 552 // than 260 characters, and without this hack, we were running past the |
| (...skipping 824 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1380 * $noCrash tests are expected to be flaky but not crash | 1377 * $noCrash tests are expected to be flaky but not crash |
| 1381 * $pass tests are expected to pass | 1378 * $pass tests are expected to pass |
| 1382 * $failOk tests are expected to fail that we won't fix | 1379 * $failOk tests are expected to fail that we won't fix |
| 1383 * $fail tests are expected to fail that we should fix | 1380 * $fail tests are expected to fail that we should fix |
| 1384 * $crash tests are expected to crash that we should fix | 1381 * $crash tests are expected to crash that we should fix |
| 1385 * $timeout tests are allowed to timeout | 1382 * $timeout tests are allowed to timeout |
| 1386 """; | 1383 """; |
| 1387 print(report); | 1384 print(report); |
| 1388 } | 1385 } |
| 1389 } | 1386 } |
| OLD | NEW |