Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(90)

Side by Side Diff: tools/testing/dart/test_suite.dart

Issue 13962004: adjust location of URI helper files for spawn_uri tests in the browser. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « tests/isolate/spawn_uri_nested_vm_test.dart ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 902 matching lines...) Expand 10 before | Expand all | Expand 10 after
913 913
914 String dartWrapperFilename = '$tempDir/test.dart'; 914 String dartWrapperFilename = '$tempDir/test.dart';
915 String compiledDartWrapperFilename = '$tempDir/test.js'; 915 String compiledDartWrapperFilename = '$tempDir/test.js';
916 916
917 String htmlPath = '$tempDir/test.html'; 917 String htmlPath = '$tempDir/test.html';
918 if (isWrappingRequired && !isWebTest) { 918 if (isWrappingRequired && !isWebTest) {
919 // test.dart will import the dart test. 919 // test.dart will import the dart test.
920 _createWrapperFile(dartWrapperFilename, filePath); 920 _createWrapperFile(dartWrapperFilename, filePath);
921 } else { 921 } else {
922 dartWrapperFilename = filename; 922 dartWrapperFilename = filename;
923 // TODO(whesse): Once test.py is retired, adjust the relative path in
924 // the client/samples/dartcombat test to its css file, remove the
925 // "../../" from this path, and move this out of the isWebTest guard.
926 // Also remove getHtmlName, and just use test.html.
927 // TODO(efortuna): this shortening of htmlFilename is a band-aid until
928 // the above TODO gets fixed. Windows cannot have paths that are longer
929 // than 260 characters, and without this hack, we were running past the
930 // the limit.
931 String htmlFilename = getHtmlName(filename);
kustermann 2013/04/15 08:02:42 the 'getHtmlName' function is no longer used.
Emily Fortuna 2013/04/16 18:40:16 Done.
932 while ('$tempDir/../$htmlFilename'.length >= 260) {
933 htmlFilename = htmlFilename.substring(htmlFilename.length~/2);
934 }
935 htmlPath = '$tempDir/../$htmlFilename';
936 } 923 }
937 String scriptPath = (compiler == 'none') ? 924 String scriptPath = (compiler == 'none') ?
938 dartWrapperFilename : compiledDartWrapperFilename; 925 dartWrapperFilename : compiledDartWrapperFilename;
939 scriptPath = _createUrlPathFromFile(new Path(scriptPath)); 926 scriptPath = _createUrlPathFromFile(new Path(scriptPath));
940 927
941 // Create the HTML file for the test. 928 // Create the HTML file for the test.
942 RandomAccessFile htmlTest = new File(htmlPath).openSync(FileMode.WRITE); 929 RandomAccessFile htmlTest = new File(htmlPath).openSync(FileMode.WRITE);
943 String content = null; 930 String content = null;
944 Path dir = filePath.directoryPath; 931 Path dir = filePath.directoryPath;
945 String nameNoExt = filePath.filenameWithoutExtension; 932 String nameNoExt = filePath.filenameWithoutExtension;
(...skipping 13 matching lines...) Expand all
959 htmlTest.writeStringSync(content); 946 htmlTest.writeStringSync(content);
960 htmlTest.closeSync(); 947 htmlTest.closeSync();
961 948
962 // Construct the command(s) that compile all the inputs needed by the 949 // 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. 950 // browser test. For running Dart in DRT, this will be noop commands.
964 List<Command> commands = []; 951 List<Command> commands = [];
965 if (compiler != 'none') { 952 if (compiler != 'none') {
966 commands.add(_compileCommand( 953 commands.add(_compileCommand(
967 dartWrapperFilename, compiledDartWrapperFilename, 954 dartWrapperFilename, compiledDartWrapperFilename,
968 compiler, tempDir, vmOptions, optionsFromFile)); 955 compiler, tempDir, vmOptions, optionsFromFile));
956 }
969 957
970 // some tests require compiling multiple input scripts. 958 // some tests require compiling multiple input scripts.
971 List<String> otherScripts = optionsFromFile['otherScripts']; 959 List<String> otherScripts = optionsFromFile['otherScripts'];
ahe 2013/04/15 18:17:45 I don't understand why this is specific to browser
Emily Fortuna 2013/04/16 18:40:16 This is specific to browser tests because they are
ahe 2013/07/24 09:31:40 Sorry for the late reply. I still don't understan
972 for (String name in otherScripts) { 960 for (String name in otherScripts) {
973 Path namePath = new Path(name); 961 Path namePath = new Path(name);
962 String baseName = namePath.filenameWithoutExtension;
963 Path fromPath = filePath.directoryPath.join(namePath);
964 if (compiler != 'none') {
974 assert(namePath.extension == 'dart'); 965 assert(namePath.extension == 'dart');
975 String baseName = namePath.filenameWithoutExtension;
976 Path fromPath = filePath.directoryPath.join(namePath);
977 commands.add(_compileCommand( 966 commands.add(_compileCommand(
978 fromPath.toNativePath(), '$tempDir/$baseName.js', 967 fromPath.toNativePath(), '$tempDir/$baseName.js',
979 compiler, tempDir, vmOptions, optionsFromFile)); 968 compiler, tempDir, vmOptions, optionsFromFile));
980 } 969 }
970 if (compiler == 'none') {
971 // For the tests that require multiple input scripts but are not
972 // compiled, move the input scripts over with the script so they can
973 // be accessed.
974 String result = new File.fromPath(fromPath).readAsStringSync();
975 new File('$tempDir/$baseName.dart').writeAsStringSync(result);
976 }
981 } 977 }
982 978
983 // Variables for browser multi-tests. 979 // Variables for browser multi-tests.
984 List<String> subtestNames = info.optionsFromFile['subtestNames']; 980 List<String> subtestNames = info.optionsFromFile['subtestNames'];
985 TestCase multitestParentTest; 981 TestCase multitestParentTest;
986 int subtestIndex = 0; 982 int subtestIndex = 0;
987 // Construct the command that executes the browser test 983 // Construct the command that executes the browser test
988 do { 984 do {
989 List<Command> commandSet = new List<Command>.from(commands); 985 List<Command> commandSet = new List<Command>.from(commands);
990 if (subtestIndex != 0) { 986 if (subtestIndex != 0) {
(...skipping 947 matching lines...) Expand 10 before | Expand all | Expand 10 after
1938 * $pass tests are expected to pass 1934 * $pass tests are expected to pass
1939 * $failOk tests are expected to fail that we won't fix 1935 * $failOk tests are expected to fail that we won't fix
1940 * $fail tests are expected to fail that we should fix 1936 * $fail tests are expected to fail that we should fix
1941 * $crash tests are expected to crash that we should fix 1937 * $crash tests are expected to crash that we should fix
1942 * $timeout tests are allowed to timeout 1938 * $timeout tests are allowed to timeout
1943 * $compileErrorSkip tests are skipped on browsers due to compile-time error 1939 * $compileErrorSkip tests are skipped on browsers due to compile-time error
1944 """; 1940 """;
1945 print(report); 1941 print(report);
1946 } 1942 }
1947 } 1943 }
OLDNEW
« no previous file with comments | « tests/isolate/spawn_uri_nested_vm_test.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698