Chromium Code Reviews| 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 948 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 959 htmlTest.writeStringSync(content); | 959 htmlTest.writeStringSync(content); |
| 960 htmlTest.closeSync(); | 960 htmlTest.closeSync(); |
| 961 | 961 |
| 962 // Construct the command(s) that compile all the inputs needed by the | 962 // Construct the command(s) that compile all the inputs needed by the |
| 963 // browser test. For running Dart in DRT, this will be noop commands. | 963 // browser test. For running Dart in DRT, this will be noop commands. |
| 964 List<Command> commands = []; | 964 List<Command> commands = []; |
| 965 if (compiler != 'none') { | 965 if (compiler != 'none') { |
| 966 commands.add(_compileCommand( | 966 commands.add(_compileCommand( |
| 967 dartWrapperFilename, compiledDartWrapperFilename, | 967 dartWrapperFilename, compiledDartWrapperFilename, |
| 968 compiler, tempDir, vmOptions, optionsFromFile)); | 968 compiler, tempDir, vmOptions, optionsFromFile)); |
| 969 } | |
| 969 | 970 |
| 970 // some tests require compiling multiple input scripts. | 971 // some tests require compiling multiple input scripts. |
| 971 List<String> otherScripts = optionsFromFile['otherScripts']; | 972 List<String> otherScripts = optionsFromFile['otherScripts']; |
| 972 for (String name in otherScripts) { | 973 for (String name in otherScripts) { |
| 973 Path namePath = new Path(name); | 974 Path namePath = new Path(name); |
| 975 String baseName = namePath.filenameWithoutExtension; | |
| 976 Path fromPath = filePath.directoryPath.join(namePath); | |
| 977 if (compiler != 'none') { | |
| 974 assert(namePath.extension == 'dart'); | 978 assert(namePath.extension == 'dart'); |
| 975 String baseName = namePath.filenameWithoutExtension; | |
| 976 Path fromPath = filePath.directoryPath.join(namePath); | |
| 977 commands.add(_compileCommand( | 979 commands.add(_compileCommand( |
| 978 fromPath.toNativePath(), '$tempDir/$baseName.js', | 980 fromPath.toNativePath(), '$tempDir/../$baseName.js', |
|
kustermann
2013/04/11 20:32:44
We can't do that (i.e. '..'). If multiple tests ha
| |
| 979 compiler, tempDir, vmOptions, optionsFromFile)); | 981 compiler, tempDir, vmOptions, optionsFromFile)); |
| 980 } | 982 } |
| 983 // Because of our test server's configuration, browser tests expect | |
| 984 // these helper files to be at the top level of the generated_tests | |
| 985 // directory (we could modify the tests, but then the same test couldn't | |
| 986 // be run both on the command line and in the browser). | |
| 987 if (compiler == 'none') { | |
| 988 File fromFile = new File.fromPath(fromPath); | |
| 989 File toFile = new File('$tempDir/../$baseName.dart'); | |
| 990 fromFile.openRead().pipe(toFile.openWrite()); | |
|
kustermann
2013/04/11 20:32:44
This is an asynchronous operation. It could happen
| |
| 991 } | |
| 981 } | 992 } |
| 982 | 993 |
| 983 // Variables for browser multi-tests. | 994 // Variables for browser multi-tests. |
| 984 List<String> subtestNames = info.optionsFromFile['subtestNames']; | 995 List<String> subtestNames = info.optionsFromFile['subtestNames']; |
| 985 TestCase multitestParentTest; | 996 TestCase multitestParentTest; |
| 986 int subtestIndex = 0; | 997 int subtestIndex = 0; |
| 987 // Construct the command that executes the browser test | 998 // Construct the command that executes the browser test |
| 988 do { | 999 do { |
| 989 List<Command> commandSet = new List<Command>.from(commands); | 1000 List<Command> commandSet = new List<Command>.from(commands); |
| 990 if (subtestIndex != 0) { | 1001 if (subtestIndex != 0) { |
| (...skipping 947 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1938 * $pass tests are expected to pass | 1949 * $pass tests are expected to pass |
| 1939 * $failOk tests are expected to fail that we won't fix | 1950 * $failOk tests are expected to fail that we won't fix |
| 1940 * $fail tests are expected to fail that we should fix | 1951 * $fail tests are expected to fail that we should fix |
| 1941 * $crash tests are expected to crash that we should fix | 1952 * $crash tests are expected to crash that we should fix |
| 1942 * $timeout tests are allowed to timeout | 1953 * $timeout tests are allowed to timeout |
| 1943 * $compileErrorSkip tests are skipped on browsers due to compile-time error | 1954 * $compileErrorSkip tests are skipped on browsers due to compile-time error |
| 1944 """; | 1955 """; |
| 1945 print(report); | 1956 print(report); |
| 1946 } | 1957 } |
| 1947 } | 1958 } |
| OLD | NEW |