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 1094 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1105 if (configuration["checked"]) { | 1105 if (configuration["checked"]) { |
1106 dartFlags.add('--enable_asserts'); | 1106 dartFlags.add('--enable_asserts'); |
1107 dartFlags.add("--enable_type_checks"); | 1107 dartFlags.add("--enable_type_checks"); |
1108 } | 1108 } |
1109 dartFlags.addAll(vmOptions); | 1109 dartFlags.addAll(vmOptions); |
1110 } | 1110 } |
1111 | 1111 |
1112 commandSet.add(CommandBuilder.instance.getContentShellCommand( | 1112 commandSet.add(CommandBuilder.instance.getContentShellCommand( |
1113 contentShellFilename, fullHtmlPath, contentShellOptions, | 1113 contentShellFilename, fullHtmlPath, contentShellOptions, |
1114 dartFlags, configurationDir)); | 1114 dartFlags, configurationDir)); |
1115 } else if (configuration['use_browser_controller']) { | 1115 } else { |
| 1116 assert(configuration['use_browser_controller']); |
1116 // This command is not actually run, it is used for reproducing | 1117 // This command is not actually run, it is used for reproducing |
1117 // the failure. | 1118 // the failure. |
1118 args = ['tools/testing/dart/launch_browser.dart', | 1119 args = ['tools/testing/dart/launch_browser.dart', |
1119 runtime, | 1120 runtime, |
1120 fullHtmlPath]; | 1121 fullHtmlPath]; |
1121 commandSet.add(CommandBuilder.instance.getBrowserTestCommand( | 1122 commandSet.add(CommandBuilder.instance.getBrowserTestCommand( |
1122 runtime, fullHtmlPath, TestUtils.dartTestExecutable.toString(), | 1123 runtime, fullHtmlPath, TestUtils.dartTestExecutable.toString(), |
1123 args, configurationDir, checkedMode: configuration['checked'])); | 1124 args, configurationDir, checkedMode: configuration['checked'])); |
1124 } else { | |
1125 assert(TestUtils.usesWebDriver(runtime)); | |
1126 args = [ | |
1127 dartDir.append('tools/testing/run_selenium.py').toNativePath(), | |
1128 '--browser=$runtime', | |
1129 // NOTE: This value will be overridden by the test runner | |
1130 '--timeout=${configuration['timeout']}', | |
1131 '--out=$fullHtmlPath']; | |
1132 if (runtime == 'dartium') { | |
1133 var dartiumLocation = | |
1134 Locations.getBrowserLocation('dartium', configuration); | |
1135 args.add('--executable=$dartiumLocation'); | |
1136 } | |
1137 if (subtestIndex != 0) { | |
1138 args.add('--force-refresh'); | |
1139 } | |
1140 commandSet.add(CommandBuilder.instance.getSeleniumTestCommand( | |
1141 runtime, fullHtmlPath, 'python', args, configurationDir)); | |
1142 } | 1125 } |
1143 | 1126 |
1144 // Create BrowserTestCase and queue it. | 1127 // Create BrowserTestCase and queue it. |
1145 String testDisplayName = '$suiteName/$testName'; | 1128 String testDisplayName = '$suiteName/$testName'; |
1146 var testCase; | 1129 var testCase; |
1147 if (info.optionsFromFile['isMultiHtmlTest']) { | 1130 if (info.optionsFromFile['isMultiHtmlTest']) { |
1148 testDisplayName = '$testDisplayName/${subtestNames[subtestIndex]}'; | 1131 testDisplayName = '$testDisplayName/${subtestNames[subtestIndex]}'; |
1149 testCase = new BrowserTestCase(testDisplayName, | 1132 testCase = new BrowserTestCase(testDisplayName, |
1150 commandSet, configuration, | 1133 commandSet, configuration, |
1151 expectations['$testName/${subtestNames[subtestIndex]}'], | 1134 expectations['$testName/${subtestNames[subtestIndex]}'], |
(...skipping 758 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1910 if ((compiler == "dart2js" || compiler == "dart2dart") && | 1893 if ((compiler == "dart2js" || compiler == "dart2dart") && |
1911 configuration["minified"]) { | 1894 configuration["minified"]) { |
1912 args.add("--minify"); | 1895 args.add("--minify"); |
1913 } | 1896 } |
1914 if (compiler == "dartanalyzer" || compiler == "dart2analyzer") { | 1897 if (compiler == "dartanalyzer" || compiler == "dart2analyzer") { |
1915 args.add("--show-package-warnings"); | 1898 args.add("--show-package-warnings"); |
1916 } | 1899 } |
1917 return args; | 1900 return args; |
1918 } | 1901 } |
1919 | 1902 |
1920 static bool usesWebDriver(String runtime) { | 1903 static bool isBrowserRuntime(String runtime) { |
1921 const BROWSERS = const [ | 1904 const BROWSERS = const [ |
| 1905 'drt', |
1922 'dartium', | 1906 'dartium', |
1923 'ie9', | 1907 'ie9', |
1924 'ie10', | 1908 'ie10', |
1925 'safari', | 1909 'safari', |
1926 'opera', | 1910 'opera', |
1927 'chrome', | 1911 'chrome', |
1928 'ff', | 1912 'ff', |
1929 'chromeOnAndroid', | 1913 'chromeOnAndroid', |
1930 'ContentShellOnAndroid', | 1914 'ContentShellOnAndroid', |
1931 'DartiumOnAndroid' | 1915 'DartiumOnAndroid' |
1932 ]; | 1916 ]; |
1933 return BROWSERS.contains(runtime); | 1917 return BROWSERS.contains(runtime); |
1934 } | 1918 } |
1935 | 1919 |
1936 static bool isBrowserRuntime(String runtime) => | |
1937 runtime == 'drt' || TestUtils.usesWebDriver(runtime); | |
1938 | |
1939 static bool isJsCommandLineRuntime(String runtime) => | 1920 static bool isJsCommandLineRuntime(String runtime) => |
1940 const ['d8', 'jsshell'].contains(runtime); | 1921 const ['d8', 'jsshell'].contains(runtime); |
1941 | 1922 |
1942 static bool isCommandLineAnalyzer(String compiler) => | 1923 static bool isCommandLineAnalyzer(String compiler) => |
1943 compiler == 'dartanalyzer' || compiler == 'dart2analyzer'; | 1924 compiler == 'dartanalyzer' || compiler == 'dart2analyzer'; |
1944 | 1925 |
1945 static String buildDir(Map configuration) { | 1926 static String buildDir(Map configuration) { |
1946 // FIXME(kustermann,ricow): Our code assumes that the returned 'buildDir' | 1927 // FIXME(kustermann,ricow): Our code assumes that the returned 'buildDir' |
1947 // is relative to the current working directory. | 1928 // is relative to the current working directory. |
1948 // Thus, if we pass in an absolute path (e.g. '--build-directory=/tmp/out') | 1929 // Thus, if we pass in an absolute path (e.g. '--build-directory=/tmp/out') |
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2061 * $pass tests are expected to pass | 2042 * $pass tests are expected to pass |
2062 * $failOk tests are expected to fail that we won't fix | 2043 * $failOk tests are expected to fail that we won't fix |
2063 * $fail tests are expected to fail that we should fix | 2044 * $fail tests are expected to fail that we should fix |
2064 * $crash tests are expected to crash that we should fix | 2045 * $crash tests are expected to crash that we should fix |
2065 * $timeout tests are allowed to timeout | 2046 * $timeout tests are allowed to timeout |
2066 * $compileErrorSkip tests are skipped on browsers due to compile-time error | 2047 * $compileErrorSkip tests are skipped on browsers due to compile-time error |
2067 """; | 2048 """; |
2068 print(report); | 2049 print(report); |
2069 } | 2050 } |
2070 } | 2051 } |
OLD | NEW |