| 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 776 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 787 dart2JsBootstrapDependencies, compilerPath, args, | 787 dart2JsBootstrapDependencies, compilerPath, args, |
| 788 configurationDir)]; | 788 configurationDir)]; |
| 789 if (info.hasCompileError) { | 789 if (info.hasCompileError) { |
| 790 // Do not attempt to run the compiled result. A compilation | 790 // Do not attempt to run the compiled result. A compilation |
| 791 // error should be reported by the compilation command. | 791 // error should be reported by the compilation command. |
| 792 } else if (configuration['runtime'] == 'vm') { | 792 } else if (configuration['runtime'] == 'vm') { |
| 793 // TODO(antonm): support checked. | 793 // TODO(antonm): support checked. |
| 794 var vmArguments = new List.from(vmOptions); | 794 var vmArguments = new List.from(vmOptions); |
| 795 vmArguments.addAll([ | 795 vmArguments.addAll([ |
| 796 '--ignore-unrecognized-flags', '$tempDir/out.dart']); | 796 '--ignore-unrecognized-flags', '$tempDir/out.dart']); |
| 797 // Turn off fancy stacks. |
| 798 if (!configuration['fancy-stacks']) { |
| 799 vmArguments.add('--no-fancy-stacks'); |
| 800 } |
| 797 commands.add(CommandBuilder.instance.getCommand( | 801 commands.add(CommandBuilder.instance.getCommand( |
| 798 "vm", vmFileName, vmArguments, configurationDir)); | 802 "vm", vmFileName, vmArguments, configurationDir)); |
| 799 } else { | 803 } else { |
| 800 throw 'Unsupported runtime ${configuration["runtime"]} for dart2dart'; | 804 throw 'Unsupported runtime ${configuration["runtime"]} for dart2dart'; |
| 801 } | 805 } |
| 802 return commands; | 806 return commands; |
| 803 | 807 |
| 804 case 'none': | 808 case 'none': |
| 805 var arguments = new List.from(vmOptions); | 809 var arguments = new List.from(vmOptions); |
| 806 arguments.addAll(args); | 810 arguments.addAll(args); |
| 811 // Turn off fancy stacks. |
| 812 if (!configuration['fancy-stacks']) { |
| 813 arguments.add('--no-fancy-stacks'); |
| 814 } |
| 807 return <Command>[CommandBuilder.instance.getCommand( | 815 return <Command>[CommandBuilder.instance.getCommand( |
| 808 'vm', dartShellFileName, arguments, configurationDir)]; | 816 'vm', dartShellFileName, arguments, configurationDir)]; |
| 809 | 817 |
| 810 case 'dartanalyzer': | 818 case 'dartanalyzer': |
| 811 case 'dart2analyzer': | 819 case 'dart2analyzer': |
| 812 return <Command>[CommandBuilder.instance.getAnalysisCommand( | 820 return <Command>[CommandBuilder.instance.getAnalysisCommand( |
| 813 compiler, dartShellFileName, args, configurationDir, | 821 compiler, dartShellFileName, args, configurationDir, |
| 814 flavor: compiler)]; | 822 flavor: compiler)]; |
| 815 | 823 |
| 816 default: | 824 default: |
| (...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 959 RandomAccessFile htmlTest = | 967 RandomAccessFile htmlTest = |
| 960 new File(htmlPath).openSync(mode: FileMode.WRITE); | 968 new File(htmlPath).openSync(mode: FileMode.WRITE); |
| 961 String content = null; | 969 String content = null; |
| 962 Path dir = filePath.directoryPath; | 970 Path dir = filePath.directoryPath; |
| 963 String nameNoExt = filePath.filenameWithoutExtension; | 971 String nameNoExt = filePath.filenameWithoutExtension; |
| 964 Path pngPath = dir.append('$nameNoExt.png'); | 972 Path pngPath = dir.append('$nameNoExt.png'); |
| 965 Path txtPath = dir.append('$nameNoExt.txt'); | 973 Path txtPath = dir.append('$nameNoExt.txt'); |
| 966 Path expectedOutput = null; | 974 Path expectedOutput = null; |
| 967 if (new File.fromPath(pngPath).existsSync()) { | 975 if (new File.fromPath(pngPath).existsSync()) { |
| 968 expectedOutput = pngPath; | 976 expectedOutput = pngPath; |
| 969 content = getHtmlLayoutContents(scriptType, new Path("$scriptPath")); | 977 content = getHtmlLayoutContents(scriptType, new Path("$scriptPath"), |
| 978 configuration['fancy-stacks']); |
| 970 } else if (new File.fromPath(txtPath).existsSync()) { | 979 } else if (new File.fromPath(txtPath).existsSync()) { |
| 971 expectedOutput = txtPath; | 980 expectedOutput = txtPath; |
| 972 content = getHtmlLayoutContents(scriptType, new Path("$scriptPath")); | 981 content = getHtmlLayoutContents(scriptType, new Path("$scriptPath"), |
| 982 configuration['fancy-stacks']); |
| 973 } else { | 983 } else { |
| 974 content = getHtmlContents(filename, scriptType, | 984 content = getHtmlContents(filename, scriptType, |
| 975 new Path("$scriptPath")); | 985 new Path("$scriptPath"), configuration['fancy-stacks']); |
| 976 } | 986 } |
| 977 htmlTest.writeStringSync(content); | 987 htmlTest.writeStringSync(content); |
| 978 htmlTest.closeSync(); | 988 htmlTest.closeSync(); |
| 979 | 989 |
| 980 // Construct the command(s) that compile all the inputs needed by the | 990 // Construct the command(s) that compile all the inputs needed by the |
| 981 // browser test. For running Dart in DRT, this will be noop commands. | 991 // browser test. For running Dart in DRT, this will be noop commands. |
| 982 List<Command> commands = []; | 992 List<Command> commands = []; |
| 983 if (compiler != 'none') { | 993 if (compiler != 'none') { |
| 984 commands.add(_compileCommand( | 994 commands.add(_compileCommand( |
| 985 dartWrapperFilename, compiledDartWrapperFilename, | 995 dartWrapperFilename, compiledDartWrapperFilename, |
| (...skipping 969 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1955 * $pass tests are expected to pass | 1965 * $pass tests are expected to pass |
| 1956 * $failOk tests are expected to fail that we won't fix | 1966 * $failOk tests are expected to fail that we won't fix |
| 1957 * $fail tests are expected to fail that we should fix | 1967 * $fail tests are expected to fail that we should fix |
| 1958 * $crash tests are expected to crash that we should fix | 1968 * $crash tests are expected to crash that we should fix |
| 1959 * $timeout tests are allowed to timeout | 1969 * $timeout tests are allowed to timeout |
| 1960 * $compileErrorSkip tests are skipped on browsers due to compile-time error | 1970 * $compileErrorSkip tests are skipped on browsers due to compile-time error |
| 1961 """; | 1971 """; |
| 1962 print(report); | 1972 print(report); |
| 1963 } | 1973 } |
| 1964 } | 1974 } |
| OLD | NEW |