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

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

Issue 10010004: Implement @runtime-error in co19 tests for static analysis (no runtime) (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Formatting fix. Created 8 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
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 732 matching lines...) Expand 10 before | Expand all | Expand 10 after
743 case 'frogsh': 743 case 'frogsh':
744 case 'dart2js': 744 case 'dart2js':
745 case 'dartc': 745 case 'dartc':
746 return 'text/javascript'; 746 return 'text/javascript';
747 default: 747 default:
748 Expect.fail('Non-web runtime, so no scriptType for: ' + 748 Expect.fail('Non-web runtime, so no scriptType for: ' +
749 '${configuration["compiler"]}'); 749 '${configuration["compiler"]}');
750 return null; 750 return null;
751 } 751 }
752 } 752 }
753
754 String get hasRuntime() {
755 switch(configuration['runtime']) {
756 case null:
757 Expect.fail("configuration['runtime'] is not set");
758 case 'none':
759 return false;
760 default:
761 return true;
762 }
763 }
753 764
754 String getHtmlName(String filename) { 765 String getHtmlName(String filename) {
755 return filename.replaceAll('/', '_').replaceAll(':', '_') 766 return filename.replaceAll('/', '_').replaceAll(':', '_')
756 .replaceAll('\\', '_') + configuration['compiler'] + '-' + 767 .replaceAll('\\', '_') + configuration['compiler'] + '-' +
757 configuration['runtime'] + '.html'; 768 configuration['runtime'] + '.html';
758 } 769 }
759 770
760 String get dumpRenderTreeFilename() { 771 String get dumpRenderTreeFilename() {
761 if (configuration['drt'] != '') { 772 if (configuration['drt'] != '') {
762 return configuration['drt']; 773 return configuration['drt'];
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after
889 } 900 }
890 isStaticClean = true; 901 isStaticClean = true;
891 } 902 }
892 903
893 List<String> otherScripts = new List<String>(); 904 List<String> otherScripts = new List<String>();
894 matches = otherScriptsRegExp.allMatches(contents); 905 matches = otherScriptsRegExp.allMatches(contents);
895 for (var match in matches) { 906 for (var match in matches) {
896 otherScripts.addAll(match[1].split(' ').filter((e) => e != '')); 907 otherScripts.addAll(match[1].split(' ').filter((e) => e != ''));
897 } 908 }
898 909
899 if (contents.contains("@compile-error") || 910 if (contents.contains("@compile-error")) {
900 contents.contains("@runtime-error")) { 911 isNegative = true;
912 }
913
914 if (contents.contains("@runtime-error") && hasRuntime) {
901 isNegative = true; 915 isNegative = true;
902 } 916 }
903 917
904 bool isMultitest = multiTestRegExp.hasMatch(contents); 918 bool isMultitest = multiTestRegExp.hasMatch(contents);
905 bool containsLeadingHash = leadingHashRegExp.hasMatch(contents); 919 bool containsLeadingHash = leadingHashRegExp.hasMatch(contents);
906 Match isolateMatch = isolateStubsRegExp.firstMatch(contents); 920 Match isolateMatch = isolateStubsRegExp.firstMatch(contents);
907 String isolateStubs = isolateMatch != null ? isolateMatch[1] : ''; 921 String isolateStubs = isolateMatch != null ? isolateMatch[1] : '';
908 bool containsDomImport = domImportRegExp.hasMatch(contents); 922 bool containsDomImport = domImportRegExp.hasMatch(contents);
909 bool isLibraryDefinition = libraryDefinitionRegExp.hasMatch(contents); 923 bool isLibraryDefinition = libraryDefinitionRegExp.hasMatch(contents);
910 bool containsSourceOrImport = sourceOrImportRegExp.hasMatch(contents); 924 bool containsSourceOrImport = sourceOrImportRegExp.hasMatch(contents);
(...skipping 425 matching lines...) Expand 10 before | Expand all | Expand 10 after
1336 * $noCrash tests are expected to be flaky but not crash 1350 * $noCrash tests are expected to be flaky but not crash
1337 * $pass tests are expected to pass 1351 * $pass tests are expected to pass
1338 * $failOk tests are expected to fail that we won't fix 1352 * $failOk tests are expected to fail that we won't fix
1339 * $fail tests are expected to fail that we should fix 1353 * $fail tests are expected to fail that we should fix
1340 * $crash tests are expected to crash that we should fix 1354 * $crash tests are expected to crash that we should fix
1341 * $timeout tests are allowed to timeout 1355 * $timeout tests are allowed to timeout
1342 """; 1356 """;
1343 print(report); 1357 print(report);
1344 } 1358 }
1345 } 1359 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698