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

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

Issue 9188032: Allow test.dart dartc/junit_tests to be run from the compiler subdirectory. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 11 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 | « no previous file | 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) 2011, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2011, 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 #library("test_suite"); 5 #library("test_suite");
6 6
7 #import("status_file_parser.dart"); 7 #import("status_file_parser.dart");
8 #import("test_runner.dart"); 8 #import("test_runner.dart");
9 #import("multitest.dart"); 9 #import("multitest.dart");
10 10
(...skipping 778 matching lines...) Expand 10 before | Expand all | Expand 10 after
789 new Timer((timerUnused){ doDone(); }, 0); 789 new Timer((timerUnused){ doDone(); }, 0);
790 return; 790 return;
791 } 791 }
792 RegExp pattern = configuration['selectors']['dartc']; 792 RegExp pattern = configuration['selectors']['dartc'];
793 if (!pattern.hasMatch('junit_tests')) { 793 if (!pattern.hasMatch('junit_tests')) {
794 new Timer((timerUnused){ doDone(); }, 0); 794 new Timer((timerUnused){ doDone(); }, 0);
795 return; 795 return;
796 } 796 }
797 797
798 dartDir = new File('.').fullPathSync(); 798 dartDir = new File('.').fullPathSync();
799 if (dartDir.endsWith('compiler')) {
800 dartDir = new File('..').fullPathSync();
801 if (!new File('$dartDir/tools/test.dart').existsSync()) {
802 throw new Exception('Cannot find client checkout $dartDir');
803 }
804 }
799 buildDir = TestUtils.buildDir(configuration); 805 buildDir = TestUtils.buildDir(configuration);
800 computeClassPath(); 806 computeClassPath();
801 testClasses = <String>[]; 807 testClasses = <String>[];
802 // Do not read the status file. 808 // Do not read the status file.
803 // All exclusions are hardcoded in this script, as they are in testcfg.py. 809 // All exclusions are hardcoded in this script, as they are in testcfg.py.
804 processDirectory(); 810 processDirectory();
805 } 811 }
806 812
807 void processDirectory() { 813 void processDirectory() {
808 directoryPath = getDirname(directoryPath); 814 directoryPath = getDirname(directoryPath);
(...skipping 14 matching lines...) Expand all
823 if (index != -1) { 829 if (index != -1) {
824 String testRelativePath = 830 String testRelativePath =
825 filename.substring(index + 'compiler/javatests/'.length, 831 filename.substring(index + 'compiler/javatests/'.length,
826 filename.length - '.java'.length); 832 filename.length - '.java'.length);
827 String testClass = testRelativePath.replaceAll('/', '.'); 833 String testClass = testRelativePath.replaceAll('/', '.');
828 testClasses.add(testClass); 834 testClasses.add(testClass);
829 } 835 }
830 } 836 }
831 837
832 void createTest(successIgnored) { 838 void createTest(successIgnored) {
833 String d8 = '$dartDir/$buildDir/d8${TestUtils.executableSuffix}'; 839 String d8 = '$buildDir/d8${TestUtils.executableSuffix}';
Anders Johnsen 2012/01/12 14:31:26 Is buildDir absolute since we can do without dartD
Bill Hesse 2012/01/12 14:45:03 No, buildDir is relative to the current directory,
834 List<String> args = <String>[ 840 List<String> args = <String>[
835 '-ea', 841 '-ea',
836 '-classpath', classPath, 842 '-classpath', classPath,
837 '-Dcom.google.dart.runner.d8=$d8', 843 '-Dcom.google.dart.runner.d8=$d8',
838 '-Dcom.google.dart.corelib.SharedTests.test_py=$dartDir/tools/test.py', 844 '-Dcom.google.dart.corelib.SharedTests.test_py=$dartDir/tools/test.py',
839 'org.junit.runner.JUnitCore']; 845 'org.junit.runner.JUnitCore'];
840 args.addAll(testClasses); 846 args.addAll(testClasses);
841 847
842 doTest(new TestCase(suiteName, 848 doTest(new TestCase(suiteName,
843 'java', 849 'java',
844 args, 850 args,
845 configuration, 851 configuration,
846 completeHandler, 852 completeHandler,
847 new Set<String>.from([PASS]))); 853 new Set<String>.from([PASS])));
848 doDone(); 854 doDone();
849 } 855 }
850 856
851 void completeHandler(TestCase testCase) { 857 void completeHandler(TestCase testCase) {
852 } 858 }
853 859
854 void computeClassPath() { 860 void computeClassPath() {
855 classPath = Strings.join( 861 classPath = Strings.join(
856 ['$buildDir/compiler/lib/dartc.jar', 862 ['$buildDir/compiler/lib/dartc.jar',
857 '$buildDir/compiler/lib/corelib.jar', 863 '$buildDir/compiler/lib/corelib.jar',
858 '$buildDir/compiler-tests.jar', 864 '$buildDir/compiler-tests.jar',
859 '$buildDir/closure_out/compiler.jar', 865 '$buildDir/closure_out/compiler.jar',
860 // Third party libraries. 866 // Third party libraries.
861 'third_party/args4j/2.0.12/args4j-2.0.12.jar', 867 '$dartDir/third_party/args4j/2.0.12/args4j-2.0.12.jar',
862 'third_party/guava/r09/guava-r09.jar', 868 '$dartDir/third_party/guava/r09/guava-r09.jar',
863 'third_party/json/r2_20080312/json.jar', 869 '$dartDir/third_party/json/r2_20080312/json.jar',
864 'third_party/rhino/1_7R3/js.jar', 870 '$dartDir/third_party/rhino/1_7R3/js.jar',
865 'third_party/hamcrest/v1_3/hamcrest-core-1.3.0RC2.jar', 871 '$dartDir/third_party/hamcrest/v1_3/hamcrest-core-1.3.0RC2.jar',
866 'third_party/hamcrest/v1_3/hamcrest-generator-1.3.0RC2.jar', 872 '$dartDir/third_party/hamcrest/v1_3/hamcrest-generator-1.3.0RC2.jar',
867 'third_party/hamcrest/v1_3/hamcrest-integration-1.3.0RC2.jar', 873 '$dartDir/third_party/hamcrest/v1_3/hamcrest-integration-1.3.0RC2.jar',
868 'third_party/hamcrest/v1_3/hamcrest-library-1.3.0RC2.jar', 874 '$dartDir/third_party/hamcrest/v1_3/hamcrest-library-1.3.0RC2.jar',
869 'third_party/junit/v4_8_2/junit.jar'], 875 '$dartDir/third_party/junit/v4_8_2/junit.jar'],
870 ':'); // Path separator. 876 ':'); // Path separator.
871 } 877 }
872 } 878 }
873 879
874 880
875 class TestUtils { 881 class TestUtils {
876 static String get executableSuffix() => 882 static String get executableSuffix() =>
877 (new Platform().operatingSystem() == 'windows') ? '.exe' : ''; 883 (new Platform().operatingSystem() == 'windows') ? '.exe' : '';
878 884
879 static String executableName(Map configuration) { 885 static String executableName(Map configuration) {
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after
1009 * $noCrash tests are expected to be flaky but not crash 1015 * $noCrash tests are expected to be flaky but not crash
1010 * $pass tests are expected to pass 1016 * $pass tests are expected to pass
1011 * $failOk tests are expected to fail that we won't fix 1017 * $failOk tests are expected to fail that we won't fix
1012 * $fail tests are expected to fail that we should fix 1018 * $fail tests are expected to fail that we should fix
1013 * $crash tests are expected to crash that we should fix 1019 * $crash tests are expected to crash that we should fix
1014 * $timeout tests are allowed to timeout\ 1020 * $timeout tests are allowed to timeout\
1015 """; 1021 """;
1016 print(report); 1022 print(report);
1017 } 1023 }
1018 } 1024 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698